diff --git a/lib/default.nix b/lib/default.nix index 0c54a7645..c75d4c60b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -17,23 +17,21 @@ lib pkgs ; - configuration = - { ... }: - { - imports = modules ++ [ - { - programs.home-manager.path = builtins.path { - path = ../.; - name = "source"; - }; - } - ]; + configuration = { + imports = modules ++ [ + { + programs.home-manager.path = builtins.path { + path = ../.; + name = "source"; + }; + } + ]; - nixpkgs = { - config = lib.mkDefault pkgs.config; + nixpkgs = { + config = lib.mkDefault pkgs.config; - inherit (pkgs) overlays; - }; + inherit (pkgs) overlays; }; + }; }; } diff --git a/modules/programs/nnn.nix b/modules/programs/nnn.nix index 63fe8fe29..8a241e673 100644 --- a/modules/programs/nnn.nix +++ b/modules/programs/nnn.nix @@ -13,43 +13,40 @@ let renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings); - pluginModule = types.submodule ( - { ... }: - { - options = { - src = mkOption { - type = with types; nullOr path; - example = literalExpression '' - (pkgs.fetchFromGitHub { - owner = "jarun"; - repo = "nnn"; - rev = "v4.0"; - sha256 = "sha256-Hpc8YaJeAzJoEi7aJ6DntH2VLkoR6ToP6tPYn3llR7k="; - }) + "/plugins"; - ''; - default = null; - description = '' - Path to the plugin folder. - ''; - }; - - mappings = mkOption { - type = with types; attrsOf str; - description = '' - Key mappings to the plugins. - ''; - default = { }; - example = literalExpression '' - { - c = "fzcd"; - f = "finder"; - v = "imgview"; - }; - ''; - }; + pluginModule = types.submodule ({ + options = { + src = mkOption { + type = with types; nullOr path; + example = literalExpression '' + (pkgs.fetchFromGitHub { + owner = "jarun"; + repo = "nnn"; + rev = "v4.0"; + sha256 = "sha256-Hpc8YaJeAzJoEi7aJ6DntH2VLkoR6ToP6tPYn3llR7k="; + }) + "/plugins"; + ''; + default = null; + description = '' + Path to the plugin folder. + ''; }; - } - ); + + mappings = mkOption { + type = with types; attrsOf str; + description = '' + Key mappings to the plugins. + ''; + default = { }; + example = literalExpression '' + { + c = "fzcd"; + f = "finder"; + v = "imgview"; + }; + ''; + }; + }; + }); in { meta.maintainers = with lib.maintainers; [ thiagokokada ]; diff --git a/modules/services/swayidle.nix b/modules/services/swayidle.nix index 07dde660a..481dd4406 100644 --- a/modules/services/swayidle.nix +++ b/modules/services/swayidle.nix @@ -21,49 +21,45 @@ in options.services.swayidle = let - timeoutModule = - { ... }: - { - options = { - timeout = mkOption { - type = types.ints.positive; - example = 60; - description = "Timeout in seconds."; - }; + timeoutModule = { + options = { + timeout = mkOption { + type = types.ints.positive; + example = 60; + description = "Timeout in seconds."; + }; - command = mkOption { - type = types.str; - description = "Command to run after timeout seconds of inactivity."; - }; + command = mkOption { + type = types.str; + description = "Command to run after timeout seconds of inactivity."; + }; - resumeCommand = mkOption { - type = with types; nullOr str; - default = null; - description = "Command to run when there is activity again."; - }; + resumeCommand = mkOption { + type = with types; nullOr str; + default = null; + description = "Command to run when there is activity again."; }; }; + }; - eventModule = - { ... }: - { - options = { - event = mkOption { - type = types.enum [ - "before-sleep" - "after-resume" - "lock" - "unlock" - ]; - description = "Event name."; - }; + eventModule = { + options = { + event = mkOption { + type = types.enum [ + "before-sleep" + "after-resume" + "lock" + "unlock" + ]; + description = "Event name."; + }; - command = mkOption { - type = types.str; - description = "Command to run when event occurs."; - }; + command = mkOption { + type = types.str; + description = "Command to run when event occurs."; }; }; + }; in { diff --git a/tests/default.nix b/tests/default.nix index 79fc32103..88ff40ece 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -42,7 +42,7 @@ let if lib.isDerivation value then scrubbedValue // newDrvAttrs else scrubbedValue else value; - scrubDerivations = attrs: lib.mapAttrs scrubDerivation attrs; + scrubDerivations = lib.mapAttrs scrubDerivation; # Globally unscrub a few selected packages that are used by a wide selection of tests. whitelist = @@ -111,10 +111,7 @@ let pkgs = let overlays = - config.test.stubOverlays - ++ lib.optionals ( - config.nixpkgs.overlays != null && config.nixpkgs.overlays != [ ] - ) config.nixpkgs.overlays; + config.test.stubOverlays ++ lib.optionals (config.nixpkgs.overlays != null) config.nixpkgs.overlays; stubbedPkgs = if overlays == [ ] then scrubbedPkgs diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix index cb6db390a..30d3cd238 100644 --- a/tests/integration/nixos/basics.nix +++ b/tests/integration/nixos/basics.nix @@ -4,30 +4,26 @@ name = "nixos-basics"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ ../../../nixos ]; # Import the HM NixOS module. + nodes.machine = { + imports = [ ../../../nixos ]; # Import the HM NixOS module. - virtualisation.memorySize = 2048; + virtualisation.memorySize = 2048; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - }; - - home-manager.users.alice = - { ... }: - { - home.stateVersion = "24.11"; - home.file.test.text = "testfile"; - # Enable a light-weight systemd service. - services.pueue.enable = true; - }; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; }; + home-manager.users.alice = { + home.stateVersion = "24.11"; + home.file.test.text = "testfile"; + # Enable a light-weight systemd service. + services.pueue.enable = true; + }; + }; + testScript = '' def login_as_alice(): machine.wait_until_tty_matches("1", "login: ") diff --git a/tests/integration/nixos/legacy-profile-management-new-conf.nix b/tests/integration/nixos/legacy-profile-management-new-conf.nix index ff044faf0..3b4ac420b 100644 --- a/tests/integration/nixos/legacy-profile-management-new-conf.nix +++ b/tests/integration/nixos/legacy-profile-management-new-conf.nix @@ -1,4 +1,3 @@ -{ ... }: { imports = [ ../../../nixos ]; # Import the HM NixOS module. @@ -9,11 +8,9 @@ }; home-manager = { - users.alice = - { ... }: - { - home.stateVersion = "24.11"; - home.file.test.text = "testfile new profile"; - }; + users.alice = { + home.stateVersion = "24.11"; + home.file.test.text = "testfile new profile"; + }; }; } diff --git a/tests/integration/nixos/legacy-profile-management.nix b/tests/integration/nixos/legacy-profile-management.nix index 1192badbe..2c5313ce5 100644 --- a/tests/integration/nixos/legacy-profile-management.nix +++ b/tests/integration/nixos/legacy-profile-management.nix @@ -4,52 +4,46 @@ name = "nixos-legacy-profile-management"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ - # Make the nixpkgs channel available. - "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" - # Import the HM NixOS module. - ../../../nixos - ]; + nodes.machine = { + imports = [ + # Make the nixpkgs channel available. + "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" + # Import the HM NixOS module. + ../../../nixos + ]; - system.stateVersion = "24.11"; + system.stateVersion = "24.11"; - users.users.alice = { - isNormalUser = true; - }; + users.users.alice = { + isNormalUser = true; + }; - specialisation = { - legacy.configuration = { - home-manager = { - # Force legacy profile management. - enableLegacyProfileManagement = true; + specialisation = { + legacy.configuration = { + home-manager = { + # Force legacy profile management. + enableLegacyProfileManagement = true; - users.alice = - { ... }: - { - home.stateVersion = "24.11"; - home.file.test.text = "testfile legacy"; - }; + users.alice = { + home.stateVersion = "24.11"; + home.file.test.text = "testfile legacy"; }; }; + }; - modern.configuration = { - home-manager = { - # Assert that we expect the option to default to false. - enableLegacyProfileManagement = pkgs.lib.mkOptionDefault false; + modern.configuration = { + home-manager = { + # Assert that we expect the option to default to false. + enableLegacyProfileManagement = pkgs.lib.mkOptionDefault false; - users.alice = - { ... }: - { - home.stateVersion = "24.11"; - home.file.test.text = "testfile modern"; - }; + users.alice = { + home.stateVersion = "24.11"; + home.file.test.text = "testfile modern"; }; }; }; }; + }; testScript = { nodes, ... }: diff --git a/tests/integration/standalone/alice-home-specialisation.nix b/tests/integration/standalone/alice-home-specialisation.nix index c1f46c43e..b749a338f 100644 --- a/tests/integration/standalone/alice-home-specialisation.nix +++ b/tests/integration/standalone/alice-home-specialisation.nix @@ -1,5 +1,3 @@ -{ ... }: - { home.username = "alice"; home.homeDirectory = "/home/alice"; diff --git a/tests/integration/standalone/flake-basics.nix b/tests/integration/standalone/flake-basics.nix index 75c3cb785..137b2a254 100644 --- a/tests/integration/standalone/flake-basics.nix +++ b/tests/integration/standalone/flake-basics.nix @@ -4,28 +4,26 @@ name = "standalone-flake-basics"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 3072; - nix = { - registry.home-manager.to = { - type = "path"; - path = ../../..; - }; - settings.extra-experimental-features = [ - "nix-command" - "flakes" - ]; - }; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 3072; + nix = { + registry.home-manager.to = { + type = "path"; + path = ../../..; }; + settings.extra-experimental-features = [ + "nix-command" + "flakes" + ]; }; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + }; + }; testScript = '' start_all() diff --git a/tests/integration/standalone/home-with-symbols.nix b/tests/integration/standalone/home-with-symbols.nix index 9a8ba148f..587f070dc 100644 --- a/tests/integration/standalone/home-with-symbols.nix +++ b/tests/integration/standalone/home-with-symbols.nix @@ -10,19 +10,17 @@ in name = "home-with-symbols"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - home = nixHome; - }; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + home = nixHome; }; + }; testScript = '' import shlex diff --git a/tests/integration/standalone/kitty.nix b/tests/integration/standalone/kitty.nix index 2a768279a..f96927922 100644 --- a/tests/integration/standalone/kitty.nix +++ b/tests/integration/standalone/kitty.nix @@ -3,18 +3,16 @@ name = "kitty-theme-path"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - }; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; }; + }; testScript = '' start_all() diff --git a/tests/integration/standalone/mu/default.nix b/tests/integration/standalone/mu/default.nix index bc1926cbc..87c858d36 100644 --- a/tests/integration/standalone/mu/default.nix +++ b/tests/integration/standalone/mu/default.nix @@ -2,18 +2,16 @@ { name = "mu-store-init"; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - }; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; }; + }; testScript = '' start_all() diff --git a/tests/integration/standalone/nh.nix b/tests/integration/standalone/nh.nix index 7fa6ae094..1a0533b34 100644 --- a/tests/integration/standalone/nh.nix +++ b/tests/integration/standalone/nh.nix @@ -9,30 +9,28 @@ in name = "works-with-nh-stable"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; - environment.systemPackages = [ pkgs.nh ]; - nix = { - registry.home-manager.to = { - type = "path"; - path = ../../..; - }; - settings.extra-experimental-features = [ - "nix-command" - "flakes" - ]; - }; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - inherit home; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + environment.systemPackages = [ pkgs.nh ]; + nix = { + registry.home-manager.to = { + type = "path"; + path = ../../..; }; + settings.extra-experimental-features = [ + "nix-command" + "flakes" + ]; }; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + inherit home; + }; + }; testScript = '' import shlex diff --git a/tests/integration/standalone/restic.nix b/tests/integration/standalone/restic.nix index 2c792efbb..aa45acfc4 100644 --- a/tests/integration/standalone/restic.nix +++ b/tests/integration/standalone/restic.nix @@ -24,21 +24,19 @@ in { name = "restic"; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - }; - - security.polkit.enable = true; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; }; + security.polkit.enable = true; + }; + testScript = '' start_all() machine.wait_for_unit("network.target") diff --git a/tests/integration/standalone/specialisation.nix b/tests/integration/standalone/specialisation.nix index 6f928c993..9c671e099 100644 --- a/tests/integration/standalone/specialisation.nix +++ b/tests/integration/standalone/specialisation.nix @@ -4,18 +4,16 @@ name = "standalone-specialisation"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - }; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; }; + }; testScript = '' start_all() diff --git a/tests/integration/standalone/standard-basics.nix b/tests/integration/standalone/standard-basics.nix index b6fbe9000..ed565e18c 100644 --- a/tests/integration/standalone/standard-basics.nix +++ b/tests/integration/standalone/standard-basics.nix @@ -4,18 +4,16 @@ name = "standalone-standard-basics"; meta.maintainers = [ pkgs.lib.maintainers.rycee ]; - nodes.machine = - { ... }: - { - imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; - users.users.alice = { - isNormalUser = true; - description = "Alice Foobar"; - password = "foobar"; - uid = 1000; - }; + nodes.machine = { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; }; + }; testScript = '' start_all() diff --git a/tests/modules/config/home-cursor/default.nix b/tests/modules/config/home-cursor/default.nix index 2b4e680d7..6fa152f8e 100644 --- a/tests/modules/config/home-cursor/default.nix +++ b/tests/modules/config/home-cursor/default.nix @@ -36,35 +36,33 @@ in }; }; - home-cursor-legacy-disabled = - { ... }: - { - config = { - home.pointerCursor = null; + home-cursor-legacy-disabled = { + config = { + home.pointerCursor = null; - home.stateVersion = "24.11"; + home.stateVersion = "24.11"; - test.asserts.warnings.expected = [ - '' - Setting home.pointerCursor to null is deprecated. - Please update your configuration to explicitly set: + test.asserts.warnings.expected = [ + '' + Setting home.pointerCursor to null is deprecated. + Please update your configuration to explicitly set: - home.pointerCursor.enable = false; - '' - ]; + home.pointerCursor.enable = false; + '' + ]; - nmt.script = '' - assertPathNotExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme + nmt.script = '' + assertPathNotExists home-path/share/icons/catppuccin-macchiato-blue-cursors/index.theme - hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh - assertFileExists $hmEnvFile - assertFileNotRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"' - assertFileNotRegex $hmEnvFile 'XCURSOR_SIZE="32"' - assertFileNotRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"' - assertFileNotRegex $hmEnvFile 'HYPRCURSOR_SIZE="32"' - ''; - }; + hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh + assertFileExists $hmEnvFile + assertFileNotRegex $hmEnvFile 'XCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileNotRegex $hmEnvFile 'XCURSOR_SIZE="32"' + assertFileNotRegex $hmEnvFile 'HYPRCURSOR_THEME="catppuccin-macchiato-blue-standard"' + assertFileNotRegex $hmEnvFile 'HYPRCURSOR_SIZE="32"' + ''; }; + }; home-cursor-legacy-disabled-with-enable = { config, ... }: diff --git a/tests/modules/config/i18n/default.nix b/tests/modules/config/i18n/default.nix index cc82c47d6..69cf5b413 100644 --- a/tests/modules/config/i18n/default.nix +++ b/tests/modules/config/i18n/default.nix @@ -1,21 +1,19 @@ { - i18n = - { ... }: - { - config = { - nmt.script = '' - hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh - assertFileExists $hmEnvFile - assertFileRegex $hmEnvFile \ - '^export LOCALE_ARCHIVE_._..=".*/lib/locale/locale-archive"$' + i18n = { + config = { + nmt.script = '' + hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh + assertFileExists $hmEnvFile + assertFileRegex $hmEnvFile \ + '^export LOCALE_ARCHIVE_._..=".*/lib/locale/locale-archive"$' - envFile=home-files/.config/environment.d/10-home-manager.conf - assertFileExists $envFile - assertFileRegex $envFile \ - '^LOCALE_ARCHIVE_._..=.*/lib/locale/locale-archive$' - ''; - }; + envFile=home-files/.config/environment.d/10-home-manager.conf + assertFileExists $envFile + assertFileRegex $envFile \ + '^LOCALE_ARCHIVE_._..=.*/lib/locale/locale-archive$' + ''; }; + }; i18n-custom-locales = { config, pkgs, ... }: diff --git a/tests/modules/home-environment/session-path.nix b/tests/modules/home-environment/session-path.nix index be5c9e4d6..3ed6de7d9 100644 --- a/tests/modules/home-environment/session-path.nix +++ b/tests/modules/home-environment/session-path.nix @@ -1,22 +1,8 @@ -{ ... }: - { - imports = [ - ( - { ... }: - { - config.home.sessionPath = [ "foo" ]; - } - ) - ( - { ... }: - { - config.home.sessionPath = [ - "bar" - "baz" - ]; - } - ) + home.sessionPath = [ + "bar" + "baz" + "foo" ]; nmt.script = '' diff --git a/tests/modules/home-environment/session-search-variables.nix b/tests/modules/home-environment/session-search-variables.nix index 72f889c61..4947db7cf 100644 --- a/tests/modules/home-environment/session-search-variables.nix +++ b/tests/modules/home-environment/session-search-variables.nix @@ -1,22 +1,8 @@ -{ ... }: - { - imports = [ - ( - { ... }: - { - config.home.sessionSearchVariables.TEST = [ "foo" ]; - } - ) - ( - { ... }: - { - config.home.sessionSearchVariables.TEST = [ - "bar" - "baz" - ]; - } - ) + home.sessionSearchVariables.TEST = [ + "bar" + "baz" + "foo" ]; nmt.script = '' diff --git a/tests/modules/home-environment/session-variables.nix b/tests/modules/home-environment/session-variables.nix index 957fb019e..2cd4d2301 100644 --- a/tests/modules/home-environment/session-variables.nix +++ b/tests/modules/home-environment/session-variables.nix @@ -37,16 +37,14 @@ let in { - config = { - home.sessionVariables = { - V1 = "v1"; - V2 = "v2-${config.home.sessionVariables.V1}"; - }; - - nmt.script = '' - assertFileExists home-path/etc/profile.d/hm-session-vars.sh - assertFileContent home-path/etc/profile.d/hm-session-vars.sh \ - ${expected} - ''; + home.sessionVariables = { + V1 = "v1"; + V2 = "v2-${config.home.sessionVariables.V1}"; }; + + nmt.script = '' + assertFileExists home-path/etc/profile.d/hm-session-vars.sh + assertFileContent home-path/etc/profile.d/hm-session-vars.sh \ + ${expected} + ''; } diff --git a/tests/modules/misc/xdg/mime.nix b/tests/modules/misc/xdg/mime.nix index 41ad3779c..f2a9f4a39 100644 --- a/tests/modules/misc/xdg/mime.nix +++ b/tests/modules/misc/xdg/mime.nix @@ -1,29 +1,26 @@ -{ ... }: { - config = { - xdg.mime.enable = true; - xdg.desktopEntries = { - mime-test = { - # mime info test - name = "mime-test"; - mimeType = [ - "text/html" - "text/xml" - ]; - }; - + xdg.mime.enable = true; + xdg.desktopEntries = { + mime-test = { + # mime info test + name = "mime-test"; + mimeType = [ + "text/html" + "text/xml" + ]; }; - nmt.script = '' - assertFileExists home-path/share/applications/mimeinfo.cache # Check that update-desktop-database created file - # Check that update-desktop-database file matches expected - assertFileContent \ - home-path/share/applications/mimeinfo.cache \ - ${./mime-expected.cache} - - assertDirectoryExists home-path/share/mime # Check that update-mime-database created directory - assertDirectoryNotEmpty home-path/share/mime # Check that update-mime-database created files - - ''; }; + + nmt.script = '' + assertFileExists home-path/share/applications/mimeinfo.cache # Check that update-desktop-database created file + # Check that update-desktop-database file matches expected + assertFileContent \ + home-path/share/applications/mimeinfo.cache \ + ${./mime-expected.cache} + + assertDirectoryExists home-path/share/mime # Check that update-mime-database created directory + assertDirectoryNotEmpty home-path/share/mime # Check that update-mime-database created files + + ''; } diff --git a/tests/modules/programs/ashell/empty-settings.nix b/tests/modules/programs/ashell/empty-settings.nix index 4a2bcbed1..1ddd80d09 100644 --- a/tests/modules/programs/ashell/empty-settings.nix +++ b/tests/modules/programs/ashell/empty-settings.nix @@ -1,5 +1,3 @@ -{ ... }: - { programs.ashell = { enable = true; diff --git a/tests/modules/programs/git-worktree-switcher/bash.nix b/tests/modules/programs/git-worktree-switcher/bash.nix index e3c663201..deb27a403 100644 --- a/tests/modules/programs/git-worktree-switcher/bash.nix +++ b/tests/modules/programs/git-worktree-switcher/bash.nix @@ -1,5 +1,3 @@ -{ ... }: - { programs = { bash.enable = true; diff --git a/tests/modules/programs/keepassxc/default-settings.nix b/tests/modules/programs/keepassxc/default-settings.nix index 744fae3fe..554ff4ec2 100644 --- a/tests/modules/programs/keepassxc/default-settings.nix +++ b/tests/modules/programs/keepassxc/default-settings.nix @@ -1,5 +1,3 @@ -{ ... }: - { programs.keepassxc = { enable = true; diff --git a/tests/modules/programs/keepassxc/example-settings.nix b/tests/modules/programs/keepassxc/example-settings.nix index 359b3f757..09b21f16b 100644 --- a/tests/modules/programs/keepassxc/example-settings.nix +++ b/tests/modules/programs/keepassxc/example-settings.nix @@ -1,5 +1,3 @@ -{ ... }: - { programs.keepassxc = { enable = true; diff --git a/tests/modules/programs/kubeswitch/fish.nix b/tests/modules/programs/kubeswitch/fish.nix index 0fa837472..38b123a1d 100644 --- a/tests/modules/programs/kubeswitch/fish.nix +++ b/tests/modules/programs/kubeswitch/fish.nix @@ -1,5 +1,3 @@ -{ ... }: - { programs = { kubeswitch.enable = true; diff --git a/tests/modules/programs/lazydocker/custom-settings.nix b/tests/modules/programs/lazydocker/custom-settings.nix index bf51a5a8f..8d8096985 100644 --- a/tests/modules/programs/lazydocker/custom-settings.nix +++ b/tests/modules/programs/lazydocker/custom-settings.nix @@ -1,4 +1,3 @@ -{ ... }: { programs.lazydocker = { enable = true; diff --git a/tests/modules/programs/lazydocker/default-settings.nix b/tests/modules/programs/lazydocker/default-settings.nix index e16a75456..b069a8b48 100644 --- a/tests/modules/programs/lazydocker/default-settings.nix +++ b/tests/modules/programs/lazydocker/default-settings.nix @@ -1,4 +1,3 @@ -{ ... }: { programs.lazydocker.enable = true; test.stubs.lazydocker = { }; diff --git a/tests/modules/programs/swaylock/disabled.nix b/tests/modules/programs/swaylock/disabled.nix index f6bdf11cb..760c49471 100644 --- a/tests/modules/programs/swaylock/disabled.nix +++ b/tests/modules/programs/swaylock/disabled.nix @@ -1,4 +1,3 @@ -{ ... }: { programs.swaylock.settings = { }; diff --git a/tests/modules/programs/uv/no-settings.nix b/tests/modules/programs/uv/no-settings.nix index 3539f29db..b1b5352eb 100644 --- a/tests/modules/programs/uv/no-settings.nix +++ b/tests/modules/programs/uv/no-settings.nix @@ -1,4 +1,3 @@ -{ ... }: { programs.uv = { enable = true; diff --git a/tests/modules/programs/zsh/history-ignore-pattern.nix b/tests/modules/programs/zsh/history-ignore-pattern.nix index 7c1ce832b..dec311f3b 100644 --- a/tests/modules/programs/zsh/history-ignore-pattern.nix +++ b/tests/modules/programs/zsh/history-ignore-pattern.nix @@ -1,20 +1,11 @@ { - imports = [ - ( - { ... }: - { - config.programs.zsh.history.ignorePatterns = [ "echo *" ]; - } - ) - ( - { ... }: - { - config.programs.zsh.history.ignorePatterns = [ "rm *" ]; - } - ) - ]; - - programs.zsh.enable = true; + programs.zsh = { + enable = true; + history.ignorePatterns = [ + "echo *" + "rm *" + ]; + }; nmt.script = '' assertFileContains home-files/.zshrc "HISTORY_IGNORE='(echo *|rm *)'" diff --git a/tests/modules/services/clipse/clipse-sway-session-target.nix b/tests/modules/services/clipse/clipse-sway-session-target.nix index d3223cf6f..c63540411 100644 --- a/tests/modules/services/clipse/clipse-sway-session-target.nix +++ b/tests/modules/services/clipse/clipse-sway-session-target.nix @@ -1,5 +1,3 @@ -{ ... }: - { services.clipse = { enable = true; diff --git a/tests/modules/services/easyeffects/example-preset.nix b/tests/modules/services/easyeffects/example-preset.nix index 69e403be0..b435ff2a7 100644 --- a/tests/modules/services/easyeffects/example-preset.nix +++ b/tests/modules/services/easyeffects/example-preset.nix @@ -1,5 +1,3 @@ -{ ... }: - { services.easyeffects = { enable = true; diff --git a/tests/modules/services/easyeffects/service.nix b/tests/modules/services/easyeffects/service.nix index 9111614df..16cb54739 100644 --- a/tests/modules/services/easyeffects/service.nix +++ b/tests/modules/services/easyeffects/service.nix @@ -1,5 +1,3 @@ -{ ... }: - { services.easyeffects = { enable = true; diff --git a/tests/modules/systemd/slices.nix b/tests/modules/systemd/slices.nix index f8fa8f370..6b16e8fa3 100644 --- a/tests/modules/systemd/slices.nix +++ b/tests/modules/systemd/slices.nix @@ -1,5 +1,3 @@ -{ ... }: - { systemd.user.slices.app-test = { Unit = { diff --git a/tests/stubs.nix b/tests/stubs.nix index 344b271a9..00c26644e 100644 --- a/tests/stubs.nix +++ b/tests/stubs.nix @@ -108,8 +108,7 @@ in lib.test.mkStubPackage = mkStubPackage; test.stubOverlays = - [ ] - ++ lib.optional (config.test.stubs != { }) ( + lib.optional (config.test.stubs != { }) ( self: super: lib.mapAttrs ( n: v: