PortValhalla/lib/modules/software.nix
2024-11-29 01:13:58 +01:00

156 lines
4.7 KiB
Nix

{ lib, ... }:
let inherit (lib) mkOption types;
in {
imports = [
./programs.nix
];
options = {
valhalla = mkOption {
type = types.submodule (
{ config, ... }:
let
optionalAttrs = lib.attrsets.optionalAttrs;
cfg = config;
inherit (cfg.software) coding desktopExperience essential gaming server socialMedia;
mkPrograms = programs: builtins.foldl'
(
programs: name: programs // {
${name}.enable = true;
}
)
{ }
programs;
in
{
options = {
software = {
essential = mkOption {
type = types.bool;
description = "A value indicating whether essentials should be installed.";
default = false;
};
server = mkOption {
type = types.bool;
description = "A value indicating whether server applications should be installed.";
default = false;
};
desktopExperience = mkOption {
type = types.bool;
description = "A value indicating whether GUI apps should be installed.";
default = false;
};
school = mkOption {
type = types.bool;
description = "A value indicating whether software for studies should be installed.";
default = false;
};
productivity = mkOption {
type = types.bool;
description = "A value indicating whether productivity apps should be installed.";
default = false;
};
socialMedia = mkOption {
type = types.bool;
description = "A value indicating whether social media apps should be installed.";
default = false;
};
media = mkOption {
type = types.bool;
description = "A value indicating whether media apps should be installed.";
default = false;
};
gaming = mkOption {
type = types.bool;
description = "A value indicating whether gaming apps should be installed.";
default = false;
};
coding = mkOption {
type = types.bool;
description = "A value indicating whether development apps should be installed.";
default = false;
};
};
};
config = {
programs = (optionalAttrs essential (mkPrograms [
"aliae"
"git"
"oh-my-posh"
"openssh"
"powershell"
"zoxide"
])) // (optionalAttrs desktopExperience (mkPrograms [
"brave"
"firefox"
"pennywise"
"thunderbird"
])) // (optionalAttrs socialMedia (mkPrograms [
"discord"
])) // (optionalAttrs coding (mkPrograms [
"docker"
"vscode"
])) // (optionalAttrs gaming (mkPrograms [
"osu!lazer"
"retroarch"
"steam"
]));
linux.programs = (optionalAttrs essential (mkPrograms [
"bash"
"logo-ls"
"minegrub-theme"
"nuke-usb"
"vim"
])) // (optionalAttrs desktopExperience (mkPrograms [
"icedtea"
"plasma"
"sddm"
"waydroid"
"virt-manager"
])) // (optionalAttrs coding (mkPrograms [
"nodejs-n"
"pyenv"
])) // (optionalAttrs gaming (mkPrograms [
"lutris"
])) // (optionalAttrs server (mkPrograms [
"nginx"
]));
# Essentials
windows.programs = (optionalAttrs essential (mkPrograms [
"posh-git"
"terminal-icons"
# Desktop Experience
])) // (optionalAttrs desktopExperience (mkPrograms [
"msedge-redirect"
"putty"
"winscp"
# Development
])) // (optionalAttrs coding (mkPrograms [
"nvs"
"visualstudio"
# Gaming
])) // (optionalAttrs gaming (mkPrograms [
"maniaplanet"
"osu!"
"rewasd"
"tm-nations-forever"
"tm-united-forever"
]));
};
}
);
};
};
}