Files
NixOS/modules/dev/cc.nix
Danilo Reyes f1e6015d39 Add multi-user support for package installations across various modules
Updated multiple configuration files to include a `merge` option for user management, enhancing the ability to handle multi-user setups for applications and services. This change improves flexibility in managing user-specific package installations, ensuring a more streamlined configuration process.
2026-01-16 13:38:49 -06:00

46 lines
1.2 KiB
Nix

{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
clang # C/C++ compiler frontend (part of LLVM)
clang-tools # Extra LLVM tools (e.g. clang-tidy, clang-apply-replacements)
gcc # GNU Compiler Collection (C, C++, etc.)
gdb # GNU Debugger
valgrind # Memory leak detector and performance profiler
;
};
in
{
options = {
my.dev.cc = {
enable = lib.mkEnableOption "Install C/C++ tooling globally";
users = lib.mkOption {
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
default = config.my.toggleUsers.dev;
merge = inputs.self.lib.mergeUsersOption lib;
description = "Users to install C/C++ packages for";
};
};
devShells.cc = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "cc-dev-shell";
shellHook = ''
echo "🔧 C/C++ dev environment"
'';
};
description = "C/C++ development shell";
};
};
config = lib.mkIf config.my.dev.cc.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.cc.users { inherit packages; };
};
}