This commit is contained in:
1 parent
6fa74fead8
commit
c002826bdc
3 files changed
+6
-18
No files matched your search
@@ -72,7 +72,7 @@ in
|
|||||||
sandboxing.enable = true;
|
sandboxing.enable = true;
|
||||||
secrets = {
|
secrets = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nixSigningKey.enable = true;
|
nix = [ "signing-key" ];
|
||||||
};
|
};
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
storage.enable = true;
|
storage.enable = true;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ in
|
|||||||
wol.wakes = [ "andromache" ];
|
wol.wakes = [ "andromache" ];
|
||||||
zfs.enable = true;
|
zfs.enable = true;
|
||||||
|
|
||||||
secrets.nixSigningKey.enable = true;
|
secrets.nix = [ "signing-key" ];
|
||||||
restic-backup.enable = true;
|
restic-backup.enable = true;
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
desktop.ly.enable = true;
|
desktop.ly.enable = true;
|
||||||
|
|||||||
@@ -10,15 +10,14 @@
|
|||||||
let
|
let
|
||||||
cfg = config.secrets;
|
cfg = config.secrets;
|
||||||
inherit (config.host) username;
|
inherit (config.host) username;
|
||||||
inherit (cfg) sopsDir;
|
sopsDir = "${toString inputs.nix-secrets}/secrets";
|
||||||
owner = config.users.users.${username}.name;
|
owner = username;
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
email = [
|
email = [
|
||||||
"personal"
|
"personal"
|
||||||
"work"
|
"work"
|
||||||
];
|
];
|
||||||
nix = lib.optional cfg.nixSigningKey.enable "signing-key";
|
|
||||||
}
|
}
|
||||||
// lib.filterAttrs (_: lib.isList) cfg;
|
// lib.filterAttrs (_: lib.isList) cfg;
|
||||||
in
|
in
|
||||||
@@ -33,11 +32,6 @@ in
|
|||||||
options = {
|
options = {
|
||||||
enable = lib.mkEnableOption "secrets management";
|
enable = lib.mkEnableOption "secrets management";
|
||||||
|
|
||||||
sopsDir = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "${toString inputs.nix-secrets}/secrets";
|
|
||||||
};
|
|
||||||
|
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
type = lib.types.attrsOf (lib.types.listOf lib.types.str);
|
type = lib.types.attrsOf (lib.types.listOf lib.types.str);
|
||||||
default = { };
|
default = { };
|
||||||
@@ -48,10 +42,6 @@ in
|
|||||||
default = owner;
|
default = owner;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixSigningKey = {
|
|
||||||
enable = lib.mkEnableOption "nix signing key configuration";
|
|
||||||
};
|
|
||||||
|
|
||||||
yubikey = {
|
yubikey = {
|
||||||
enable = lib.mkEnableOption "set up Yubikey";
|
enable = lib.mkEnableOption "set up Yubikey";
|
||||||
};
|
};
|
||||||
@@ -60,11 +50,9 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
sops = {
|
sops.secrets = lib'.mkSopsSecrets sopsDir null system // lib'.mkSopsSecrets sopsDir owner cfg.user;
|
||||||
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
|
config.sops.secrets."nix/signing-key".path
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user