diff --git a/tests/modules/misc/nix/empty-settings.nix b/tests/modules/misc/nix/empty-settings.nix index 7e5844742..4ca5e4b0b 100644 --- a/tests/modules/misc/nix/empty-settings.nix +++ b/tests/modules/misc/nix/empty-settings.nix @@ -1,14 +1,10 @@ -{ config, lib, pkgs, ... }: - -with lib; +{ config, ... }: { - config = { - nix = { package = config.lib.test.mkStubPackage { }; }; + nix = { package = config.lib.test.mkStubPackage { }; }; - nmt.script = '' - assertPathNotExists home-files/.config/nix - assertPathNotExists home-files/.nix-defexpr/50-home-manager - ''; - }; + nmt.script = '' + assertPathNotExists home-files/.config/nix + assertPathNotExists home-files/.nix-defexpr/50-home-manager + ''; } diff --git a/tests/modules/misc/nix/example-channels-xdg.nix b/tests/modules/misc/nix/example-channels-xdg.nix index 8ca1569f3..f50d0b461 100644 --- a/tests/modules/misc/nix/example-channels-xdg.nix +++ b/tests/modules/misc/nix/example-channels-xdg.nix @@ -9,21 +9,19 @@ let } ''; in { - config = { - nix = { - package = config.lib.test.mkStubPackage { - version = lib.getVersion pkgs.nixVersions.stable; - }; - channels.example = exampleChannel; - settings.use-xdg-base-directories = true; + nix = { + package = config.lib.test.mkStubPackage { + version = lib.getVersion pkgs.nixVersions.stable; }; - - nmt.script = '' - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/home/hm-user/.local/state/nix/defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' - assertFileContent \ - home-files/.local/state/nix/defexpr/50-home-manager/example/default.nix \ - ${exampleChannel}/default.nix - ''; + channels.example = exampleChannel; + settings.use-xdg-base-directories = true; }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/home/hm-user/.local/state/nix/defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' + assertFileContent \ + home-files/.local/state/nix/defexpr/50-home-manager/example/default.nix \ + ${exampleChannel}/default.nix + ''; } diff --git a/tests/modules/misc/nix/example-channels.nix b/tests/modules/misc/nix/example-channels.nix index 4b98c55d4..189d07094 100644 --- a/tests/modules/misc/nix/example-channels.nix +++ b/tests/modules/misc/nix/example-channels.nix @@ -9,18 +9,16 @@ let } ''; in { - config = { - nix = { - package = config.lib.test.mkStubPackage { }; - channels.example = exampleChannel; - }; - - nmt.script = '' - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/home/hm-user/.nix-defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' - assertFileContent \ - home-files/.nix-defexpr/50-home-manager/example/default.nix \ - ${exampleChannel}/default.nix - ''; + nix = { + package = config.lib.test.mkStubPackage { }; + channels.example = exampleChannel; }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/home/hm-user/.nix-defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' + assertFileContent \ + home-files/.nix-defexpr/50-home-manager/example/default.nix \ + ${exampleChannel}/default.nix + ''; } diff --git a/tests/modules/misc/nix/example-registry.nix b/tests/modules/misc/nix/example-registry.nix index 1875b34d3..99da470ef 100644 --- a/tests/modules/misc/nix/example-registry.nix +++ b/tests/modules/misc/nix/example-registry.nix @@ -1,25 +1,21 @@ -{ config, lib, pkgs, ... }: - -with lib; +{ ... }: { - config = { - nix = { - registry = { - nixpkgs = { - to = { - type = "github"; - owner = "my-org"; - repo = "my-nixpkgs"; - }; + nix = { + registry = { + nixpkgs = { + to = { + type = "github"; + owner = "my-org"; + repo = "my-nixpkgs"; }; }; }; - - nmt.script = '' - assertFileContent \ - home-files/.config/nix/registry.json \ - ${./example-registry-expected.json} - ''; }; + + nmt.script = '' + assertFileContent \ + home-files/.config/nix/registry.json \ + ${./example-registry-expected.json} + ''; } diff --git a/tests/modules/misc/nix/example-settings.nix b/tests/modules/misc/nix/example-settings.nix index df62fe8d1..c0684fe4a 100644 --- a/tests/modules/misc/nix/example-settings.nix +++ b/tests/modules/misc/nix/example-settings.nix @@ -1,38 +1,34 @@ { config, lib, pkgs, ... }: -with lib; - { - config = { - nix = { - package = config.lib.test.mkStubPackage { - version = lib.getVersion pkgs.nixVersions.stable; - buildScript = '' - target=$out/bin/nix - mkdir -p "$(dirname "$target")" + nix = { + package = config.lib.test.mkStubPackage { + version = lib.getVersion pkgs.nixVersions.stable; + buildScript = '' + target=$out/bin/nix + mkdir -p "$(dirname "$target")" - echo -n "true" > "$target" + echo -n "true" > "$target" - chmod +x "$target" - ''; - }; - - nixPath = [ "/a" "/b/c" ]; - - settings = { - use-sandbox = true; - show-trace = true; - system-features = [ "big-parallel" "kvm" "recursive-nix" ]; - }; + chmod +x "$target" + ''; }; - nmt.script = '' - assertFileContent \ - home-files/.config/nix/nix.conf \ - ${./example-settings-expected.conf} + nixPath = [ "/a" "/b/c" ]; - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/a:/b/c''${NIX_PATH:+:$NIX_PATH}"' - ''; + settings = { + use-sandbox = true; + show-trace = true; + system-features = [ "big-parallel" "kvm" "recursive-nix" ]; + }; }; + + nmt.script = '' + assertFileContent \ + home-files/.config/nix/nix.conf \ + ${./example-settings-expected.conf} + + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/a:/b/c''${NIX_PATH:+:$NIX_PATH}"' + ''; } diff --git a/tests/modules/misc/nix/keep-old-nix-path.nix b/tests/modules/misc/nix/keep-old-nix-path.nix index 72bd9f164..b7dc63a0c 100644 --- a/tests/modules/misc/nix/keep-old-nix-path.nix +++ b/tests/modules/misc/nix/keep-old-nix-path.nix @@ -1,16 +1,14 @@ { config, ... }: { - config = { - nix = { - package = config.lib.test.mkStubPackage { }; - nixPath = [ "/a" "/b/c" ]; - keepOldNixPath = false; - }; - - nmt.script = '' - assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - 'export NIX_PATH="/a:/b/c"' - ''; + nix = { + package = config.lib.test.mkStubPackage { }; + nixPath = [ "/a" "/b/c" ]; + keepOldNixPath = false; }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/a:/b/c"' + ''; }