109 lines
3.1 KiB
Nix
109 lines
3.1 KiB
Nix
{ lib, config, ... }:
|
|
let
|
|
inherit (lib) mkDefault mkOption types;
|
|
cfg = config.valhalla;
|
|
|
|
mkUsersOption = osConfig: mkOption {
|
|
type = types.attrsOf (types.submodule (
|
|
{ ... }: {
|
|
config = {
|
|
programs = builtins.mapAttrs (
|
|
name: config: {
|
|
enable = mkDefault config.enable;
|
|
}) osConfig.programs;
|
|
};
|
|
}));
|
|
};
|
|
in {
|
|
imports = [
|
|
./programs/git.nix
|
|
./programs/nextcloud.nix
|
|
./programs/oh-my-posh.nix
|
|
./programs/rclone.nix
|
|
];
|
|
|
|
options = {
|
|
valhalla = {
|
|
users = mkUsersOption cfg;
|
|
linux.users = mkUsersOption cfg.linux;
|
|
windows.users = mkUsersOption cfg.windows;
|
|
|
|
software = let
|
|
inherit (cfg.software) coding common desktopExperience school server;
|
|
in {
|
|
essential = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether essentials should be installed.";
|
|
default = true;
|
|
};
|
|
|
|
common = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether common software should be installed.";
|
|
default = true;
|
|
};
|
|
|
|
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 = common && !server;
|
|
};
|
|
|
|
fileSync = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether file syncs should be installed.";
|
|
default = common && !server;
|
|
};
|
|
|
|
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 = common || school;
|
|
};
|
|
|
|
socialMedia = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether social media apps should be installed.";
|
|
default = common && desktopExperience;
|
|
};
|
|
|
|
media = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether media apps should be installed.";
|
|
default = common && desktopExperience;
|
|
};
|
|
|
|
gaming = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether gaming apps should be installed.";
|
|
default = common && desktopExperience;
|
|
};
|
|
|
|
coding = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether development apps should be installed.";
|
|
default = common;
|
|
};
|
|
|
|
python = mkOption {
|
|
type = types.bool;
|
|
description = "A value indicating whether apps for coding python should be installed.";
|
|
default = coding;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|