PortValhalla/lib/modules/software.nix

157 lines
4.7 KiB
Nix
Raw Normal View History

2024-10-13 23:55:19 +00:00
{ lib, ... }:
2024-11-29 00:13:58 +00:00
let inherit (lib) mkOption types;
in {
imports = [
./programs.nix
];
2024-10-13 18:15:40 +00:00
2024-11-29 00:13:58 +00:00
options = {
valhalla = mkOption {
type = types.submodule (
{ config, ... }:
let
optionalAttrs = lib.attrsets.optionalAttrs;
cfg = config;
inherit (cfg.software) coding desktopExperience essential gaming server socialMedia;
2024-11-29 00:13:58 +00:00
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;
};
2024-11-29 00:13:58 +00:00
server = mkOption {
type = types.bool;
description = "A value indicating whether server applications should be installed.";
default = false;
};
2024-11-29 00:13:58 +00:00
desktopExperience = mkOption {
type = types.bool;
description = "A value indicating whether GUI apps should be installed.";
default = false;
};
2024-11-29 00:13:58 +00:00
school = mkOption {
type = types.bool;
description = "A value indicating whether software for studies should be installed.";
default = false;
};
2024-11-29 00:13:58 +00:00
productivity = mkOption {
type = types.bool;
description = "A value indicating whether productivity apps should be installed.";
default = false;
};
2024-11-29 00:13:58 +00:00
socialMedia = mkOption {
type = types.bool;
description = "A value indicating whether social media apps should be installed.";
default = false;
};
2024-11-29 00:13:58 +00:00
media = mkOption {
type = types.bool;
description = "A value indicating whether media apps should be installed.";
default = false;
};
2024-11-29 00:13:58 +00:00
gaming = mkOption {
type = types.bool;
description = "A value indicating whether gaming apps should be installed.";
default = false;
};
2024-11-29 00:13:58 +00:00
coding = mkOption {
type = types.bool;
description = "A value indicating whether development apps should be installed.";
default = false;
2024-10-13 23:55:19 +00:00
};
2024-11-29 00:13:58 +00:00
};
};
2024-11-29 00:13:58 +00:00
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"
]));
2024-10-13 23:55:19 +00:00
2024-11-29 00:13:58 +00:00
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"
]));
2024-10-13 23:55:19 +00:00
2024-11-29 00:13:58 +00:00
# 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"
]));
};
}
);
};
2024-11-29 00:13:58 +00:00
};
}