Add helper functions for multi-user toggle support
Introduced a new file `lib.nix` containing helper functions to streamline user package management and attributes for multi-user configurations. Updated various modules to utilize these functions, enhancing code maintainability and readability.
This commit is contained in:
@@ -51,7 +51,7 @@ in
|
||||
# };
|
||||
};
|
||||
users.users = let
|
||||
users = if lib.isString config.my.toggleUsers.apps then [ config.my.toggleUsers.apps ] else config.my.toggleUsers.apps;
|
||||
userLib = import ../lib.nix { inherit lib; };
|
||||
packages = builtins.attrValues {
|
||||
inherit retroarchWithCores;
|
||||
inherit (pkgs)
|
||||
@@ -70,8 +70,6 @@ in
|
||||
prismlauncher # minecraft launcher with jdk overlays
|
||||
;
|
||||
};
|
||||
in lib.mkMerge (map (user: {
|
||||
${user}.packages = packages;
|
||||
}) users);
|
||||
in userLib.mkUserPackages config.my.toggleUsers.apps packages;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user