Inherit user app enablement from OS

This commit is contained in:
Manuel Thalmann 2024-10-13 20:15:40 +02:00
parent bd7d8f8080
commit fe37ad29e0
2 changed files with 24 additions and 5 deletions

View file

@ -1,10 +1,33 @@
{ lib, config, ... }:
let
inherit (lib) mkOption types;
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 {

View file

@ -5,10 +5,6 @@ in {
./hardware.nix
./i18n.nix
./os.nix
./programs/git.nix
./programs/nextcloud.nix
./programs/oh-my-posh.nix
./programs/rclone.nix
./partition.nix
./software.nix
./users.nix