1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-25 11:19:47 +01:00

nix: simplify tests

This commit is contained in:
Robert Helgesson 2024-12-06 12:24:37 +01:00
parent 63eb786e04
commit d00c6f6d0a
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
6 changed files with 77 additions and 95 deletions

View file

@ -1,14 +1,10 @@
{ config, lib, pkgs, ... }: { config, ... }:
with lib;
{ {
config = {
nix = { package = config.lib.test.mkStubPackage { }; }; nix = { package = config.lib.test.mkStubPackage { }; };
nmt.script = '' nmt.script = ''
assertPathNotExists home-files/.config/nix assertPathNotExists home-files/.config/nix
assertPathNotExists home-files/.nix-defexpr/50-home-manager assertPathNotExists home-files/.nix-defexpr/50-home-manager
''; '';
};
} }

View file

@ -9,7 +9,6 @@ let
} }
''; '';
in { in {
config = {
nix = { nix = {
package = config.lib.test.mkStubPackage { package = config.lib.test.mkStubPackage {
version = lib.getVersion pkgs.nixVersions.stable; version = lib.getVersion pkgs.nixVersions.stable;
@ -25,5 +24,4 @@ in {
home-files/.local/state/nix/defexpr/50-home-manager/example/default.nix \ home-files/.local/state/nix/defexpr/50-home-manager/example/default.nix \
${exampleChannel}/default.nix ${exampleChannel}/default.nix
''; '';
};
} }

View file

@ -9,7 +9,6 @@ let
} }
''; '';
in { in {
config = {
nix = { nix = {
package = config.lib.test.mkStubPackage { }; package = config.lib.test.mkStubPackage { };
channels.example = exampleChannel; channels.example = exampleChannel;
@ -22,5 +21,4 @@ in {
home-files/.nix-defexpr/50-home-manager/example/default.nix \ home-files/.nix-defexpr/50-home-manager/example/default.nix \
${exampleChannel}/default.nix ${exampleChannel}/default.nix
''; '';
};
} }

View file

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }: { ... }:
with lib;
{ {
config = {
nix = { nix = {
registry = { registry = {
nixpkgs = { nixpkgs = {
@ -21,5 +18,4 @@ with lib;
home-files/.config/nix/registry.json \ home-files/.config/nix/registry.json \
${./example-registry-expected.json} ${./example-registry-expected.json}
''; '';
};
} }

View file

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
{ {
config = {
nix = { nix = {
package = config.lib.test.mkStubPackage { package = config.lib.test.mkStubPackage {
version = lib.getVersion pkgs.nixVersions.stable; version = lib.getVersion pkgs.nixVersions.stable;
@ -34,5 +31,4 @@ with lib;
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export NIX_PATH="/a:/b/c''${NIX_PATH:+:$NIX_PATH}"' 'export NIX_PATH="/a:/b/c''${NIX_PATH:+:$NIX_PATH}"'
''; '';
};
} }

View file

@ -1,7 +1,6 @@
{ config, ... }: { config, ... }:
{ {
config = {
nix = { nix = {
package = config.lib.test.mkStubPackage { }; package = config.lib.test.mkStubPackage { };
nixPath = [ "/a" "/b/c" ]; nixPath = [ "/a" "/b/c" ];
@ -12,5 +11,4 @@
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export NIX_PATH="/a:/b/c"' 'export NIX_PATH="/a:/b/c"'
''; '';
};
} }