diff --git a/home/isabel/ghostty.nix b/home/isabel/ghostty.nix --- a/home/isabel/ghostty.nix +++ b/home/isabel/ghostty.nix @@ -23,8 +23,8 @@ window-save-state = "always"; # let fontconfig handle this on linux - font-family = lib.mkIf isDarwin config.garden.style.fonts.name; - font-size = lib.mkIf isDarwin 13; + font-family = lib.modules.mkIf isDarwin config.garden.style.fonts.name; + font-size = lib.modules.mkIf isDarwin 13; # home-manager does this for us shell-integration = "none"; diff --git a/home/isabel/hyprland/default.nix b/home/isabel/hyprland/default.nix --- a/home/isabel/hyprland/default.nix +++ b/home/isabel/hyprland/default.nix @@ -19,9 +19,9 @@ mode = "${mon.res}@${toString mon.hz}"; }) monitors; in { - options.programs.hyprland.enable = lib.mkEnableOption "Enable Hyprland as the Wayland window manager"; + options.programs.hyprland.enable = lib.options.mkEnableOption "Enable Hyprland as the Wayland window manager"; - config = lib.mkIf config.programs.hyprland.enable { + config = lib.modules.mkIf config.programs.hyprland.enable { garden.packages = { inherit (pkgs) hyprpicker cosmic-files; }; wayland.windowManager.hyprland = { diff --git a/home/isabel/mpv.nix b/home/isabel/mpv.nix --- a/home/isabel/mpv.nix +++ b/home/isabel/mpv.nix @@ -45,7 +45,7 @@ # mpv as our image viewer mpv-image-viewer.image-positioning ]) - ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ + ++ lib.lists.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.mpvScripts.mpris ]; }; diff --git a/home/isabel/vicinae/extension.nix b/home/isabel/vicinae/extension.nix --- a/home/isabel/vicinae/extension.nix +++ b/home/isabel/vicinae/extension.nix @@ -3,7 +3,7 @@ lib, buildNpmPackage, fetchFromGitHub, }: -lib.extendMkDerivation { +lib.customisation.extendMkDerivation { constructDrv = buildNpmPackage; extendDrvArgs = @@ -14,7 +14,7 @@ version ? "0", type ? "vicinae", ... }@args: - lib.checkListOfEnum "${finalAttrs.pname}: type must be one of vicinae or raycast" + lib.trivial.checkListOfEnum "${finalAttrs.pname}: type must be one of vicinae or raycast" [ "vicinae" "raycast" ] [ type ] { diff --git a/modules/base/catppuccin.nix b/modules/base/catppuccin.nix --- a/modules/base/catppuccin.nix +++ b/modules/base/catppuccin.nix @@ -22,7 +22,7 @@ nativeBuildInputs = [ pkgs.makeBinaryWrapper ]; postBuild = '' wrapProgram $out/bin/whiskers \ - --add-flag ${lib.escapeShellArg "--color-overrides=${ + --add-flag ${lib.strings.escapeShellArg "--color-overrides=${ builtins.toJSON { mocha = { base = "000000"; diff --git a/modules/base/nix/environment.nix b/modules/base/nix/environment.nix --- a/modules/base/nix/environment.nix +++ b/modules/base/nix/environment.nix @@ -1,5 +1,5 @@ { lib, ... }: { # https://github.com/NixOS/nixpkgs/blob/eca4605163a534aed1981de0f5f1d7d7639d1640/nixos/modules/programs/environment.nix#L18 - environment.variables.NIXPKGS_CONFIG = lib.mkForce ""; + environment.variables.NIXPKGS_CONFIG = lib.modules.mkForce ""; } diff --git a/modules/base/system/fonts.nix b/modules/base/system/fonts.nix --- a/modules/base/system/fonts.nix +++ b/modules/base/system/fonts.nix @@ -4,7 +4,7 @@ pkgs, ... }: { - fonts.packages = lib.attrValues { + fonts.packages = lib.attrsets.attrValues { inherit (pkgs) corefonts diff --git a/modules/flake/checks/default.nix b/modules/flake/checks/default.nix --- a/modules/flake/checks/default.nix +++ b/modules/flake/checks/default.nix @@ -3,7 +3,7 @@ let inherit (pkgs) lib; - scope = lib.makeScope pkgs.newScope (scopeSelf: { + scope = lib.customisation.makeScope pkgs.newScope (scopeSelf: { inherit (inputs) self; # keep-sorted start block=yes newline_separated=yes @@ -17,4 +17,4 @@ }); in -lib.filterAttrs (_: lib.isDerivation) scope +lib.attrsets.filterAttrs (_: lib.attrsets.isDerivation) scope diff --git a/modules/flake/default.nix b/modules/flake/default.nix --- a/modules/flake/default.nix +++ b/modules/flake/default.nix @@ -11,9 +11,9 @@ "aarch64-linux" "aarch64-darwin" ]; - forAllSystems = fn: lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system}); + forAllSystems = fn: lib.attrsets.genAttrs systems (system: fn nixpkgs.legacyPackages.${system}); - mkHosts = lib.mapAttrs self.lib.mkHost; + mkHosts = lib.attrsets.mapAttrs self.lib.mkHost; in { diff --git a/modules/flake/lib/mkhost.nix b/modules/flake/lib/mkhost.nix --- a/modules/flake/lib/mkhost.nix +++ b/modules/flake/lib/mkhost.nix @@ -99,7 +99,7 @@ } ] # if we are on darwin we need to import the nixpkgs source, its used in some # modules, if this is not set then you will get an error - ++ lib.optional (class == "darwin") { + ++ lib.lists.optional (class == "darwin") { key = "dotfiles#nixpkgs-darwin"; _file = "${__curPos.file}"; diff --git a/modules/flake/packages/default.nix b/modules/flake/packages/default.nix --- a/modules/flake/packages/default.nix +++ b/modules/flake/packages/default.nix @@ -1,7 +1,7 @@ # I would highly advise you do not use my flake as an input and instead you vendor this # if you want to use this code. { pkgs, inputs, ... }: -removeAttrs (pkgs.lib.makeScope pkgs.newScope (self: { +removeAttrs (pkgs.lib.customisation.makeScope pkgs.newScope (self: { inherit inputs; # keep-sorted start block=yes newline_separated=yes diff --git a/modules/flake/packages/docs/lib.nix b/modules/flake/packages/docs/lib.nix --- a/modules/flake/packages/docs/lib.nix +++ b/modules/flake/packages/docs/lib.nix @@ -45,13 +45,13 @@ description=$3 nixdoc -c "$name" -d "lib.$name: $description" -f "$name.nix" > "$out/$name.md" } - ${lib.concatMapStrings ( + ${lib.strings.concatMapStrings ( { name, description, }: '' - docgen ${name} ${lib.escapeShellArg description} + docgen ${name} ${lib.strings.escapeShellArg description} '' ) libset} diff --git a/modules/flake/packages/docs/options.nix b/modules/flake/packages/docs/options.nix --- a/modules/flake/packages/docs/options.nix +++ b/modules/flake/packages/docs/options.nix @@ -56,7 +56,7 @@ decl: let declStr = toString decl; in - if lib.hasPrefix selfStr declStr then + if lib.strings.hasPrefix selfStr declStr then gitHubDeclaration "isabelroses" "dotfiles" (removePrefix "/" (removePrefix selfStr declStr)) else decl diff --git a/modules/flake/programs/formatter.nix b/modules/flake/programs/formatter.nix --- a/modules/flake/programs/formatter.nix +++ b/modules/flake/programs/formatter.nix @@ -39,7 +39,7 @@ # keep-sorted end (writeShellScriptBin "statix-fix" '' for file in "$@"; do - ${lib.getExe statix} fix "$file" + ${lib.meta.getExe statix} fix "$file" done '') ]; diff --git a/modules/home/environment/xdg.nix b/modules/home/environment/xdg.nix --- a/modules/home/environment/xdg.nix +++ b/modules/home/environment/xdg.nix @@ -64,8 +64,8 @@ mimeTypes = [ "inode/directory" ]; }; }; - associations' = lib.concatMapAttrs ( - _: val: lib.listToAttrs (lib.map (mt: lib.nameValuePair mt "${val.app}.desktop") val.mimeTypes) + associations' = lib.attrsets.concatMapAttrs ( + _: val: lib.attrsets.listToAttrs (lib.lists.map (mt: lib.attrsets.nameValuePair mt "${val.app}.desktop") val.mimeTypes) ) appsToAssoc; specifics = { @@ -117,7 +117,7 @@ associations.added = associations; defaultApplications = associations; }; - portal.enable = lib.mkForce false; + portal.enable = lib.modules.mkForce false; }; # You can generate something like this using xdg-ninja diff --git a/modules/iso/image.nix b/modules/iso/image.nix --- a/modules/iso/image.nix +++ b/modules/iso/image.nix @@ -7,7 +7,7 @@ ... }: let inherit (lib.sources) cleanSource; - inherit (lib) mkImageMediaOverride; + inherit (lib.modules) mkImageMediaOverride; # Get the hostname from our networking name provided in the mkNixosIso builder # If none is set then default to "nixos" diff --git a/modules/nixos/catppuccin.nix b/modules/nixos/catppuccin.nix --- a/modules/nixos/catppuccin.nix +++ b/modules/nixos/catppuccin.nix @@ -11,7 +11,7 @@ config = { # pick our ports catppuccin.forgejo.enable = true; - console.colors = lib.mkIf config.catppuccin.enable [ + console.colors = lib.modules.mkIf config.catppuccin.enable [ "000000" "f38ba8" "a6e3a1" diff --git a/modules/nixos/emulation.nix b/modules/nixos/emulation.nix --- a/modules/nixos/emulation.nix +++ b/modules/nixos/emulation.nix @@ -11,7 +11,7 @@ inherit (lib.modules) mkIf; inherit (lib.options) mkOption mkEnableOption; inherit (lib.strings) splitString; inherit (lib.trivial) flip pipe; - inherit (lib) filter; + inherit (lib.lists) filter; inherit (lib.types) listOf str diff --git a/modules/nixos/environment/console.nix b/modules/nixos/environment/console.nix --- a/modules/nixos/environment/console.nix +++ b/modules/nixos/environment/console.nix @@ -1,7 +1,7 @@ { lib, pkgs, ... }: { console = { - enable = lib.mkDefault true; + enable = lib.modules.mkDefault true; earlySetup = true; keyMap = "en"; diff --git a/modules/nixos/environment/locale.nix b/modules/nixos/environment/locale.nix --- a/modules/nixos/environment/locale.nix +++ b/modules/nixos/environment/locale.nix @@ -1,14 +1,14 @@ { lib, config, ... }: { time = { - timeZone = lib.mkDefault (if config.garden.profiles.server.enable then "UTC" else "Europe/London"); + timeZone = lib.modules.mkDefault (if config.garden.profiles.server.enable then "UTC" else "Europe/London"); hardwareClockInLocalTime = true; }; i18n = { - defaultLocale = lib.mkDefault "en_GB.UTF-8"; + defaultLocale = lib.modules.mkDefault "en_GB.UTF-8"; - extraLocales = lib.mkDefault [ + extraLocales = lib.modules.mkDefault [ "en_US.UTF-8/UTF-8" "en_GB.UTF-8/UTF-8" ]; diff --git a/modules/nixos/hardware/cloud/oracle/garden.nix b/modules/nixos/hardware/cloud/oracle/garden.nix --- a/modules/nixos/hardware/cloud/oracle/garden.nix +++ b/modules/nixos/hardware/cloud/oracle/garden.nix @@ -8,7 +8,7 @@ options.garden.profiles.oracle = { enable = mkEnableOption "Oracle Cloud profile"; }; - config = lib.mkIf config.garden.profiles.oracle.enable { + config = lib.modules.mkIf config.garden.profiles.oracle.enable { services.thermald.enable = mkForce false; # Unavailable - device lacks thermal sensors. }; } diff --git a/modules/nixos/hardware/cloud/overrides.nix b/modules/nixos/hardware/cloud/overrides.nix --- a/modules/nixos/hardware/cloud/overrides.nix +++ b/modules/nixos/hardware/cloud/overrides.nix @@ -52,7 +52,7 @@ "virtio_scsi" "9p" "9pnet_virtio" ] - ++ lib.optionals (!config.garden.profiles.oracle.enable) [ + ++ lib.lists.optionals (!config.garden.profiles.oracle.enable) [ "vmw_pvscsi" ]; diff --git a/modules/nixos/hardware/media/sound.nix b/modules/nixos/hardware/media/sound.nix --- a/modules/nixos/hardware/media/sound.nix +++ b/modules/nixos/hardware/media/sound.nix @@ -10,7 +10,7 @@ in { config = mkIf config.garden.profiles.graphical.enable { # no thanks lol - services.pulseaudio.enable = lib.mkForce false; + services.pulseaudio.enable = lib.modules.mkForce false; # pipewire is newer and just better services.pipewire = { diff --git a/modules/nixos/headless.nix b/modules/nixos/headless.nix --- a/modules/nixos/headless.nix +++ b/modules/nixos/headless.nix @@ -57,7 +57,7 @@ }; # don't start a tty on the serial consoles; we have no need for it here services = { - "serial-getty@ttyS0".enable = lib.mkDefault false; + "serial-getty@ttyS0".enable = lib.modules.mkDefault false; "serial-getty@hvc0".enable = false; "getty@tty1".enable = false; "autovt@".enable = false; diff --git a/modules/nixos/networking/tailscale.nix b/modules/nixos/networking/tailscale.nix --- a/modules/nixos/networking/tailscale.nix +++ b/modules/nixos/networking/tailscale.nix @@ -29,7 +29,7 @@ isClient = mkOption { type = bool; default = config.garden.profiles.workstation.enable; - defaultText = lib.literalExpression "config.garden.profiles.workstation.enable"; + defaultText = lib.options.literalExpression "config.garden.profiles.workstation.enable"; example = true; description = '' Whether the target host should utilize Tailscale client features"; @@ -41,7 +41,7 @@ isServer = mkOption { type = bool; default = config.garden.profiles.server.enable; - defaultText = lib.literalExpression "config.garden.profiles.server.enable"; + defaultText = lib.options.literalExpression "config.garden.profiles.server.enable"; example = true; description = '' Whether the target host should utilize Tailscale server features. diff --git a/modules/nixos/services/arr.nix b/modules/nixos/services/arr.nix --- a/modules/nixos/services/arr.nix +++ b/modules/nixos/services/arr.nix @@ -41,7 +41,7 @@ defaultText = "true"; }; }; - config = lib.mkIf cfg.enable { + config = lib.modules.mkIf cfg.enable { garden.services = { jellyfin.enable = true; sonarr.enable = true; diff --git a/modules/nixos/services/borgbackup.nix b/modules/nixos/services/borgbackup.nix --- a/modules/nixos/services/borgbackup.nix +++ b/modules/nixos/services/borgbackup.nix @@ -62,7 +62,7 @@ description = "Define borg backup jobs."; }; }; - config = lib.mkIf cfg.enable { + config = lib.modules.mkIf cfg.enable { sops.secrets.borg-sshkey = mkSecret { file = "borg"; key = "sshkey"; diff --git a/modules/nixos/services/forgejo.nix b/modules/nixos/services/forgejo.nix --- a/modules/nixos/services/forgejo.nix +++ b/modules/nixos/services/forgejo.nix @@ -86,7 +86,7 @@ DISABLE_ROUTER_LOG = true; # LANDING_PAGE = "/explore/repos"; SSH_CREATE_AUTHORIZED_KEYS_FILE = true; - SSH_PORT = lib.head config.services.openssh.ports; + SSH_PORT = lib.lists.head config.services.openssh.ports; # fix gravatar images OFFLINE_MODE = false; @@ -180,7 +180,7 @@ openssh.settings.UsePAM = mkForce true; postgresql = { ensureDatabases = [ "forgejo" ]; - ensureUsers = lib.singleton { + ensureUsers = lib.lists.singleton { name = "forgejo"; ensureDBOwnership = true; }; diff --git a/modules/nixos/services/mailserver.nix b/modules/nixos/services/mailserver.nix --- a/modules/nixos/services/mailserver.nix +++ b/modules/nixos/services/mailserver.nix @@ -18,7 +18,7 @@ imports = [ inputs.simple-nixos-mailserver.nixosModules.default ]; options.garden.services.mailserver = mkServiceOption "mailserver" { domain = "mail.${rdomain}"; }; - config = lib.mkMerge [ + config = lib.modules.mkMerge [ { # for some reason without doing it like this we get an eval error saying # that "null cannot be coerced to a string". which i assume is caused by @@ -317,7 +317,7 @@ }; postgresql = { ensureDatabases = [ "roundcube" ]; - ensureUsers = lib.singleton { + ensureUsers = lib.lists.singleton { name = "roundcube"; ensureDBOwnership = true; }; diff --git a/modules/nixos/services/matrix.nix b/modules/nixos/services/matrix.nix --- a/modules/nixos/services/matrix.nix +++ b/modules/nixos/services/matrix.nix @@ -163,7 +163,7 @@ LC_CTYPE = "C"; ''; ensureDatabases = [ "matrix-sliding-sync" ]; - ensureUsers = lib.singleton { + ensureUsers = lib.lists.singleton { name = "matrix-sliding-sync"; ensureDBOwnership = true; }; diff --git a/modules/nixos/services/postgresql.nix b/modules/nixos/services/postgresql.nix --- a/modules/nixos/services/postgresql.nix +++ b/modules/nixos/services/postgresql.nix @@ -126,7 +126,7 @@ log_connections = true; log_statement = "all"; logging_collector = true; log_disconnections = true; - log_destination = lib.mkForce "syslog"; + log_destination = lib.modules.mkForce "syslog"; }; }; }; diff --git a/modules/nixos/services/snot.nix b/modules/nixos/services/snot.nix --- a/modules/nixos/services/snot.nix +++ b/modules/nixos/services/snot.nix @@ -40,7 +40,7 @@ users."did:plc:qxichs7jsycphrsmbujwqbfb" = "isabel"; }; }; - postgresql.ensureUsers = lib.singleton { name = "snot"; }; + postgresql.ensureUsers = lib.lists.singleton { name = "snot"; }; nginx.virtualHosts.${cfg.domain} = { locations."/" = { @@ -50,7 +50,7 @@ }; }; }; - systemd.services.postgresql-setup.script = lib.mkAfter '' + systemd.services.postgresql-setup.script = lib.modules.mkAfter '' psql -d forgejo <<'EOF' GRANT CONNECT ON DATABASE forgejo TO "snot"; ALTER DEFAULT PRIVILEGES FOR ROLE forgejo GRANT SELECT ON TABLES TO "snot"; diff --git a/modules/nixos/services/vaultwarden.nix b/modules/nixos/services/vaultwarden.nix --- a/modules/nixos/services/vaultwarden.nix +++ b/modules/nixos/services/vaultwarden.nix @@ -81,7 +81,7 @@ }; postgresql = { ensureDatabases = [ "vaultwarden" ]; - ensureUsers = lib.singleton { + ensureUsers = lib.lists.singleton { name = "vaultwarden"; ensureDBOwnership = true; }; diff --git a/modules/nixos/services/wakapi.nix b/modules/nixos/services/wakapi.nix --- a/modules/nixos/services/wakapi.nix +++ b/modules/nixos/services/wakapi.nix @@ -83,7 +83,7 @@ }; postgresql = { ensureDatabases = [ "wakapi" ]; - ensureUsers = lib.singleton { + ensureUsers = lib.lists.singleton { name = "wakapi"; ensureDBOwnership = true; }; diff --git a/modules/nixos/system/runners.nix b/modules/nixos/system/runners.nix --- a/modules/nixos/system/runners.nix +++ b/modules/nixos/system/runners.nix @@ -12,7 +12,7 @@ cfg = config.garden.system.security.binaries; in { options.garden.system.security = { - binaries.enable = lib.mkEnableOption "allow for none patched binaries to be run"; + binaries.enable = lib.options.mkEnableOption "allow for none patched binaries to be run"; }; config = mkIf cfg.enable { diff --git a/modules/nixos/system/terminfo.nix b/modules/nixos/system/terminfo.nix --- a/modules/nixos/system/terminfo.nix +++ b/modules/nixos/system/terminfo.nix @@ -6,7 +6,7 @@ config, ... }: { - config = lib.mkIf config.services.openssh.enable { + config = lib.modules.mkIf config.services.openssh.enable { garden.packages = { inherit (pkgs.ghostty) terminfo; }; diff --git a/systems/freyja/default.nix b/systems/freyja/default.nix --- a/systems/freyja/default.nix +++ b/systems/freyja/default.nix @@ -31,5 +31,5 @@ }; }; }; - services.smartd.enable = lib.mkForce false; + services.smartd.enable = lib.modules.mkForce false; }