mirror of
https://github.com/ryantm/agenix.git
synced 2024-11-01 16:49:55 +03:00
34 lines
694 B
Nix
34 lines
694 B
Nix
|
{
|
||
|
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')
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
}
|