add builttools as an option

This commit is contained in:
Vinzenz Schroeter 2023-12-16 11:28:44 +01:00
parent 04ccf5cdd4
commit 026f592b17
4 changed files with 46 additions and 9 deletions

40
modules/buildtools.nix Normal file
View file

@ -0,0 +1,40 @@
{
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
];
})
(lib.mkIf cfg.dotnet {
environment.systemPackages = with pkgs; [
dotnet-sdk_8
];
})
(lib.mkIf cfg.rust {
environment.systemPackages = with pkgs; [
cargo
rustc
rustfmt
clippy
cargo-generate
];
})
];
}