Refactored home configurations

Comon config is handled in `modules/home/home/default.nix`.
This commit is contained in:
alejandro-angulo 2024-08-22 16:47:23 -07:00
parent 92aec37282
commit 14620e645f
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
5 changed files with 61 additions and 28 deletions

View file

@ -1,27 +0,0 @@
{...}: {
aa = {
apps = {
bat.enable = true;
btop.enable = true;
tmux.enable = true;
};
programs = {
firefox.enable = true;
fzf.enable = true;
gpg.enable = true;
kitty.enable = true;
zoxide.enable = true;
yazi.enable = true;
};
tools = {
direnv.enable = true;
eza.enable = true;
git.enable = true;
zsh.enable = true;
};
windowManagers.sway.enable = true;
};
}

View file

@ -0,0 +1,3 @@
{...}: {
aa.isHeadless = false;
}

View file

@ -0,0 +1,3 @@
{...}: {
aa.isHeadless = false;
}

View file

@ -0,0 +1,2 @@
{...}: {
}

View file

@ -1,7 +1,59 @@
{
config,
lib,
osConfig ? {},
namespace,
...
}: {
options.${namespace} = {
isHeadless = lib.mkOption {
type = lib.types.bool;
default = true;
description = "If true, graphical applications (e.g. firefox, sway, etc) won't be installed.";
};
installDefaults = lib.mkOption {
type = lib.types.bool;
default = true;
description = "If true, a default set of packages will be installed.";
};
};
config = lib.mkMerge [
(
lib.mkIf (!config.${namespace}.isHeadless) {
${namespace} = {
programs.firefox.enable = true;
windowManagers.sway.enable = true;
};
}
)
(lib.mkIf (config.${namespace}.installDefaults) {
${namespace} = {
apps = {
bat.enable = true;
btop.enable = true;
tmux.enable = true;
};
programs = {
fzf.enable = true;
gpg.enable = true;
kitty.enable = true;
zoxide.enable = true;
yazi.enable = true;
};
tools = {
direnv.enable = true;
eza.enable = true;
git.enable = true;
zsh.enable = true;
};
};
})
{
home.stateVersion = lib.mkDefault (osConfig.system.stateVersion or "24.05");
}
];
}