nixos-configuration/modules/buildtools.nix
2023-12-16 15:33:20 +01:00

52 lines
1,002 B
Nix

{
pkgs,
lib,
config,
...
}: let
cfg = config.my.buildtools;
in {
options.my.buildtools = {
native = lib.mkEnableOption "include native build tools";
dotnet = lib.mkEnableOption "include dotnet build tools";
rust = lib.mkEnableOption "include rust build tools";
};
config = lib.mkMerge [
(lib.mkIf cfg.native
{
environment.systemPackages = with pkgs; [
cmake
gnumake
gcc
gdb
llvmPackages_latest.llvm
llvmPackages.clangUseLLVM
];
})
(lib.mkIf cfg.dotnet {
environment = {
systemPackages = with pkgs; [
dotnet-sdk_8
zlib zlib.dev
openssl
icu
];
variables = {
DOTNET_CLI_TELEMETRY_OPTOUT = "1";
};
};
})
(lib.mkIf cfg.rust {
environment.systemPackages = with pkgs; [
cargo
rustc
rustfmt
clippy
cargo-generate
];
})
];
}