home: add secrets
All checks were successful
ci/woodpecker/push/check Pipeline was successful

Now that my module has been merged upstream!

Not that I have anything to use it with for now...
This commit is contained in:
Bruno BELANYI 2023-05-12 11:03:46 +00:00
parent d60e26c617
commit f3e888dadc
3 changed files with 36 additions and 0 deletions

View file

@ -29,6 +29,7 @@
./packages
./pager
./power-alert
./secrets
./ssh
./terminal
./tmux

25
home/secrets/default.nix Normal file
View file

@ -0,0 +1,25 @@
{ config, inputs, lib, options, ... }:
{
imports = [
inputs.agenix.homeManagerModules.age
];
config.age = {
secrets =
let
toName = lib.removeSuffix ".age";
toSecret = name: { ... }: {
file = ./. + "/${name}";
};
convertSecrets = n: v: lib.nameValuePair (toName n) (toSecret n v);
secrets = import ./secrets.nix;
in
lib.mapAttrs' convertSecrets secrets;
# Add my usual agenix key to the defaults
identityPaths = options.age.identityPaths.default ++ [
"${config.home.homeDirectory}/.ssh/agenix"
];
};
}

10
home/secrets/secrets.nix Normal file
View file

@ -0,0 +1,10 @@
# Common secrets
let
keys = import ../../keys;
# deadnix: skip
all = keys.users;
in
{
# Add secrets here
}