mirror of
https://github.com/RGBCube/agenix
synced 2025-07-29 01:37:44 +00:00
Add darwin tests for home-manager module
This commit is contained in:
parent
19bf5a20d8
commit
50743bd117
2 changed files with 73 additions and 18 deletions
33
test/integration_hm_darwin.nix
Normal file
33
test/integration_hm_darwin.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
options,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [../modules/age-home.nix];
|
||||
|
||||
age = {
|
||||
identityPaths = options.age.identityPaths.default ++ ["/Users/user1/.ssh/this_key_wont_exist"];
|
||||
secrets.user-secret.file = ../example/secret2.age;
|
||||
};
|
||||
|
||||
home = rec {
|
||||
username = "runner";
|
||||
homeDirectory = lib.mkForce "/Users/${username}";
|
||||
stateVersion = lib.trivial.release;
|
||||
};
|
||||
|
||||
home.file = let
|
||||
name = "agenix-home-integration";
|
||||
in {
|
||||
${name}.source = pkgs.writeShellApplication {
|
||||
inherit name;
|
||||
text = let
|
||||
secret = "world!";
|
||||
in ''
|
||||
diff -q "${config.age.secrets.user-secret.path}" <(printf '${secret}\n')
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue