diff options
author | Franck Cuny <franck@fcuny.net> | 2023-12-09 09:15:23 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2023-12-09 09:15:23 -0800 |
commit | 543fcc38c9c48349d6988b1ace119f0cef2d6efa (patch) | |
tree | ae8174b09797fd19e365f60bf25a9d20b222c855 /modules/secrets | |
parent | install kind / configure the dock (diff) | |
download | world-543fcc38c9c48349d6988b1ace119f0cef2d6efa.tar.gz |
delete even more unused configurations
Diffstat (limited to 'modules/secrets')
-rw-r--r-- | modules/secrets/default.nix | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix deleted file mode 100644 index f0befea..0000000 --- a/modules/secrets/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, inputs, lib, options, ... }: -with builtins; -with lib; -let - secretsDir = "${toString ../../hosts}/${config.networking.hostName}/secrets"; - secretsFile = "${secretsDir}/secrets.nix"; -in -{ - imports = [ inputs.agenix.nixosModules.age ]; - - config.age = { - secrets = - let - toName = lib.removeSuffix ".age"; - userExists = u: builtins.hasAttr u config.users.users; - groupExists = g: builtins.hasAttr g config.users.groups; - - # Only set the user and/or group if they exist, to avoid - # warnings. If they don't exist, we default to root. - userIfExists = u: if userExists u then u else "root"; - groupIfExists = g: if groupExists g then g else "root"; - - toSecret = name: attrs: - { - file = "${secretsDir}/${name}"; - } // lib.optionalAttrs (attrs ? owner) { - owner = lib.mkDefault (userIfExists attrs.owner); - } // lib.optionalAttrs (attrs ? group) { - group = lib.mkDefault (groupIfExists attrs.group); - } // lib.optionalAttrs (attrs ? mode) { - inherit (attrs) mode; - } // lib.optionalAttrs (attrs ? path) { - inherit (attrs) path; - }; - in - if pathExists secretsFile then - mapAttrs' (n: v: nameValuePair (toName n) (toSecret n v)) - (import secretsFile) - else - { }; - - identityPaths = [ - "/root/.age/key.txt" - "${config.users.users.fcuny.home}/.age/key.txt" - ]; - }; -} |