some more housecleaning and changing swap on cnixpad

This commit is contained in:
cnst
2024-09-06 21:21:00 +02:00
parent 865c8c4ba9
commit 5d5b6fe8c8
29 changed files with 285 additions and 198 deletions

View File

@@ -0,0 +1,63 @@
{
config,
lib,
inputs,
pkgs,
self,
...
}: let
inherit (lib) mkIf mkEnableOption mkOption mkMerge;
cfg = config.modules.sysd.security.agenix;
in {
options = {
modules.sysd.security.agenix = {
enable = mkEnableOption "Enables agenix system environment";
cnix.enable = mkOption {
type = lib.types.bool;
default = false;
description = "Apply cnix agenix settings";
};
toothpc.enable = mkOption {
type = lib.types.bool;
default = false;
description = "Apply toothpc agenix settings";
};
cnixpad.enable = mkOption {
type = lib.types.bool;
default = false;
description = "Apply cnixpad agenix settings";
};
};
};
config = mkIf cfg.enable {
age = mkMerge [
(mkIf cfg.cnix.enable {
secrets = {
cnstssh.file = "${self}/secrets/cnstssh.age";
cnixssh.file = "${self}/secrets/cnixssh.age";
helix-gpt = {
file = "${self}/secrets/helix-gpt.age";
owner = "cnst";
group = "users";
};
};
})
(mkIf cfg.toothpc.enable {
secrets = {
# Add toothpc specific secrets here
};
})
(mkIf cfg.cnixpad.enable {
secrets = {
# Add adampad specific secrets here
};
})
];
environment.systemPackages = [
inputs.agenix.packages.x86_64-linux.default
pkgs.age
];
};
}

View File

@@ -0,0 +1,15 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.sysd.security.gnome-keyring;
in {
options = {
modules.sysd.security.gnome-keyring.enable = mkEnableOption "Enables gnome-keyring";
};
config = mkIf cfg.enable {
services.gnome.gnome-keyring.enable = true;
};
}