1
0
Fork 0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-04-27 14:25:05 +02:00
git.oat.zone--dark-firepit-.../modules/agenix.nix
System administrator ec00c09f2e Dotfiles
2022-01-11 17:44:40 +00:00

25 lines
654 B
Nix

{ options, lib, inputs, pkgs, config, ... }:
with builtins;
with lib;
with lib._;
let
inherit (inputs) agenix;
secretsDir = "${toString ../hosts}/${config.networking.hostName}/secrets";
secretsFile = "${secretsDir}/secrets.nix";
in {
imports = [ agenix.nixosModules.age ];
environment.systemPackages = [ agenix.defaultPackage.x86_64-linux ];
age = {
secrets = mkIf (pathExists secretsFile) (mapAttrs (n: o: {
file = "${secretsDir}/" + n;
owner = o.owner;
}) (import secretsFile));
identityPaths = options.age.identityPaths.default ++ (filter pathExists [
# ".ssh/id_ed25519"
# ".ssh/id_rsa"
]);
};
}