1
0
Fork 0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-05-10 10:16:09 +02:00
git.oat.zone--dark-firepit-.../modules/agenix.nix

25 lines
654 B
Nix
Raw Normal View History

2022-01-11 18:44:40 +01:00
{ 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"
]);
};
}