Enhanced the configuration files to support multi-user management by introducing user options for multiple applications, including art, gaming, multimedia, and development tools. Updated existing modules to utilize these new user options, improving flexibility and maintainability in user package installations.
42 lines
994 B
Nix
42 lines
994 B
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
packages = builtins.attrValues {
|
|
inherit (pkgs)
|
|
zig # Zig compiler and stdlib
|
|
zls # Language server for Zig
|
|
;
|
|
};
|
|
in
|
|
{
|
|
options = {
|
|
my.dev.zig = {
|
|
enable = lib.mkEnableOption "Install Zig tooling globally";
|
|
users = lib.mkOption {
|
|
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
|
|
default = config.my.toggleUsers.dev;
|
|
description = "Users to install Zig packages for";
|
|
};
|
|
};
|
|
devShells.zig = lib.mkOption {
|
|
type = lib.types.package;
|
|
default = pkgs.mkShell {
|
|
inherit packages;
|
|
name = "zig-dev-shell";
|
|
shellHook = ''
|
|
echo "🦎 Zig dev environment"
|
|
'';
|
|
};
|
|
description = "Zig development shell with compiler and LSP";
|
|
};
|
|
};
|
|
config = lib.mkIf config.my.dev.zig.enable {
|
|
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.zig.users { inherit packages; };
|
|
};
|
|
}
|