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.
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
packages = builtins.attrValues {
|
|
inherit (pkgs)
|
|
dockfmt # Format Dockerfiles
|
|
dockerfile-language-server # LSP for Dockerfiles
|
|
;
|
|
};
|
|
in
|
|
{
|
|
options = {
|
|
my.dev.docker = {
|
|
enable = lib.mkEnableOption "Install Docker 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 Docker packages for";
|
|
};
|
|
};
|
|
devShells.docker = lib.mkOption {
|
|
type = lib.types.package;
|
|
default = pkgs.mkShell {
|
|
inherit packages;
|
|
name = "docker-dev-shell";
|
|
shellHook = ''
|
|
echo "🐳 Docker dev environment"
|
|
'';
|
|
};
|
|
description = "Docker and Dockerfile tooling shell";
|
|
};
|
|
};
|
|
config = lib.mkMerge [
|
|
(lib.mkIf config.my.dev.docker.enable {
|
|
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.docker.users { inherit packages; };
|
|
})
|
|
{
|
|
environment.variables.DOCKER_CONFIG = "\${XDG_CONFIG_HOME}/docker";
|
|
}
|
|
];
|
|
}
|