Refactor container configuration

This commit is contained in:
SebastianStork 2024-09-02 13:33:44 +02:00
parent 8af96429ff
commit 380d8202ff
15 changed files with 288 additions and 241 deletions

View file

@ -5,15 +5,24 @@
lib,
...
}:
let
cfg = config.myConfig.sops;
in
{
imports = [ inputs.sops-nix.nixosModules.sops ];
options.myConfig.sops.enable = lib.mkEnableOption "";
options.myConfig.sops = {
enable = lib.mkEnableOption "";
defaultSopsFile = lib.mkOption {
type = lib.types.path;
default = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
};
};
config = lib.mkIf config.myConfig.sops.enable {
config = lib.mkIf cfg.enable {
sops = {
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
inherit (cfg) defaultSopsFile;
};
};
}