1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00: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, ... }:
with lib;
{ config, ... }:
{
config = {
nix = { package = config.lib.test.mkStubPackage { }; };
nmt.script = ''
assertPathNotExists home-files/.config/nix
assertPathNotExists home-files/.nix-defexpr/50-home-manager
'';
};
}

View file

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

View file

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

View file

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

View file

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

View file

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