big module system implementation

This commit is contained in:
cnst
2024-08-17 18:28:42 +02:00
parent 505afa84d0
commit 7525ab34c1
155 changed files with 2402 additions and 2029 deletions

View File

@@ -0,0 +1,17 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.userd.copyq;
in {
options = {
modules.userd.copyq.enable = mkEnableOption "Enables copyq";
};
config = mkIf cfg.enable {
services.copyq = {
enable = true;
};
};
}

View File

@@ -0,0 +1,39 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.userd.mako;
in {
options = {
modules.userd.mako.enable = mkEnableOption "Enables mako";
};
config = mkIf cfg.enable {
services.mako = {
enable = true;
iconPath = "$HOME/.nix-profile/share/icons/Gruvbox-Plus-Dark";
font = "FiraCode Nerd Font Medium 12";
padding = "20";
margin = "10";
anchor = "top-right";
width = 400;
height = 150;
borderSize = 2;
defaultTimeout = 12000;
backgroundColor = "#3c3836dd";
borderColor = "#689d6add";
textColor = "#d5c4a1dd";
layer = "overlay";
extraConfig = ''
max-history=50
max-visible=4
outer-margin=25
icon-location=right
max-icon-size=48
[mode=do-not-disturb]
invisible=1
'';
};
};
}

View File

@@ -0,0 +1,74 @@
{
inputs,
self,
lib,
config,
...
}: let
defaultConfig = {
age = {sshKeyPaths = ["/home/cnst/.ssh/id_ed25519"];};
defaultSopsFile = "${self}/secrets/cnst-secrets.yaml";
secrets = {
openai_api_key = {
format = "yaml";
sopsFile = "${self}/secrets/cnst-secrets.yaml";
};
ssh_user = {
format = "yaml";
sopsFile = "${self}/secrets/cnst-secrets.yaml";
};
};
};
userSpecificConfig = lib.mkMerge [
(lib.mkIf (config.home.username == "toothpick") {
age = {sshKeyPaths = ["/home/toothpick/.ssh/id_ed25519"];};
defaultSopsFile = "${self}/secrets/toothpick-secrets.yaml";
secrets = {
openai_api_key = {
format = "yaml";
sopsFile = "${self}/secrets/toothpick-secrets.yaml";
};
ssh_user = {
format = "yaml";
sopsFile = "${self}/secrets/toothpick-secrets.yaml";
};
};
})
(lib.mkIf (config.home.username == "adam") {
age = {sshKeyPaths = ["/home/adam/.ssh/id_ed25519"];};
defaultSopsFile = "${self}/secrets/adam-secrets.yaml";
secrets = {
openai_api_key = {
format = "yaml";
sopsFile = "${self}/secrets/adam-secrets.yaml";
};
ssh_user = {
format = "yaml";
sopsFile = "${self}/secrets/adam-secrets.yaml";
};
};
})
];
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.userd.sops;
in {
imports = [
inputs.sops-nix.homeManagerModules.sops
];
options = {
modules.userd.sops.enable = mkEnableOption "Enables sops home environment";
};
config = mkIf cfg.enable {
sops = lib.mkMerge [
{
gnupg = {
home = "~/.gnupg";
sshKeyPaths = [];
};
}
defaultConfig
userSpecificConfig
];
};
}

View File

@@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.userd.udiskie;
in {
options = {
modules.userd.udiskie.enable = mkEnableOption "Enables udiskie";
};
config = mkIf cfg.enable {
services.udiskie = {
enable = true;
tray = "always";
notify = false;
};
};
}