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:
@@ -30,10 +30,8 @@ in
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.my.dev.docker.enable {
|
||||
users.users = let
|
||||
users = if lib.isString config.my.toggleUsers.dev then [ config.my.toggleUsers.dev ] else config.my.toggleUsers.dev;
|
||||
in lib.mkMerge (map (user: {
|
||||
${user} = { inherit packages; };
|
||||
}) users);
|
||||
userLib = import ../lib.nix { inherit lib; };
|
||||
in userLib.mkUserAttrs config.my.toggleUsers.dev { inherit packages; };
|
||||
})
|
||||
{
|
||||
environment.variables.DOCKER_CONFIG = "\${XDG_CONFIG_HOME}/docker";
|
||||
|
||||
Reference in New Issue
Block a user