refactor(secrets): replace nixSigningKey with list
check / lint (push) Successful in 16s

This commit is contained in:
hektor committed 2026-11-06 14:35:02 +01:00
1 parent 6fa74fead8
commit c002826bdc
3 files changed
+6 -18

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@ in
sandboxing.enable = true;
secrets = {
enable = true;
nixSigningKey.enable = true;
nix = [ "signing-key" ];
};
ssh.enable = true;
storage.enable = true;
+1 -1
View File
@@ -74,7 +74,7 @@ in
wol.wakes = [ "andromache" ];
zfs.enable = true;
secrets.nixSigningKey.enable = true;
secrets.nix = [ "signing-key" ];
restic-backup.enable = true;
tailscale.enable = true;
desktop.ly.enable = true;
+4 -16
View File
@@ -10,15 +10,14 @@
let
cfg = config.secrets;
inherit (config.host) username;
inherit (cfg) sopsDir;
owner = config.users.users.${username}.name;
sopsDir = "${toString inputs.nix-secrets}/secrets";
owner = username;
system = {
email = [
"personal"
"work"
];
nix = lib.optional cfg.nixSigningKey.enable "signing-key";
}
// lib.filterAttrs (_: lib.isList) cfg;
in
@@ -33,11 +32,6 @@ in
options = {
enable = lib.mkEnableOption "secrets management";
sopsDir = lib.mkOption {
type = lib.types.str;
default = "${toString inputs.nix-secrets}/secrets";
};
user = lib.mkOption {
type = lib.types.attrsOf (lib.types.listOf lib.types.str);
default = { };
@@ -48,10 +42,6 @@ in
default = owner;
};
nixSigningKey = {
enable = lib.mkEnableOption "nix signing key configuration";
};
yubikey = {
enable = lib.mkEnableOption "set up Yubikey";
};
@@ -60,11 +50,9 @@ in
};
config = lib.mkIf cfg.enable {
sops = {
secrets = lib'.mkSopsSecrets sopsDir null system // lib'.mkSopsSecrets sopsDir owner cfg.user;
};
sops.secrets = lib'.mkSopsSecrets sopsDir null system // lib'.mkSopsSecrets sopsDir owner cfg.user;
nix.settings.secret-key-files = lib.mkIf cfg.nixSigningKey.enable [
nix.settings.secret-key-files = lib.mkIf (system ? nix) [
config.sops.secrets."nix/signing-key".path
];