sops changes, and things I cannot remember
This commit is contained in:
66
system/opt/sops/default.nix
Normal file
66
system/opt/sops/default.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
defaultConfig = {
|
||||
defaultSopsFile = "${self}/secrets/cnix-secrets.yaml";
|
||||
secrets = {
|
||||
openai_api_key = {
|
||||
format = "yaml";
|
||||
sopsFile = "${self}/secrets/cnix-secrets.yaml";
|
||||
};
|
||||
ssh_host = {
|
||||
format = "yaml";
|
||||
sopsFile = "${self}/secrets/cnix-secrets.yaml";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hostSpecificConfig = lib.mkMerge [
|
||||
(lib.mkIf (config.networking.hostName == "toothpc") {
|
||||
defaultSopsFile = "${self}/secrets/toothpc-secrets.yaml";
|
||||
secrets = {
|
||||
openai_api_key = {
|
||||
format = "yaml";
|
||||
sopsFile = "${self}/secrets/toothpc-secrets.yaml";
|
||||
};
|
||||
ssh_host = {
|
||||
format = "yaml";
|
||||
sopsFile = "${self}/secrets/toothpc-secrets.yaml";
|
||||
};
|
||||
};
|
||||
})
|
||||
(lib.mkIf (config.networking.hostName == "adampad") {
|
||||
defaultSopsFile = "${self}/secrets/adampad-secrets.yaml";
|
||||
secrets = {
|
||||
openai_api_key = {
|
||||
format = "yaml";
|
||||
sopsFile = "${self}/secrets/adampad-secrets.yaml";
|
||||
};
|
||||
ssh_host = {
|
||||
format = "yaml";
|
||||
sopsFile = "${self}/secrets/adampad-secrets.yaml";
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
in {
|
||||
sops = lib.mkMerge [
|
||||
{
|
||||
age = {sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];};
|
||||
gnupg = {
|
||||
home = "~/.gnupg";
|
||||
sshKeyPaths = [];
|
||||
};
|
||||
}
|
||||
defaultConfig
|
||||
hostSpecificConfig
|
||||
];
|
||||
environment.systemPackages = [
|
||||
pkgs.sops
|
||||
pkgs.age
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user