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
];
})
];
}

View file

@ -7,6 +7,7 @@ modulesCfg: {lib, ...}: {
./server.nix ./server.nix
./sshd.nix ./sshd.nix
./tailscale.nix ./tailscale.nix
./buildtools.nix
] ]
++ (map (path: (import path modulesCfg)) [ ++ (map (path: (import path modulesCfg)) [
./hardware ./hardware

View file

@ -26,16 +26,7 @@ in
screen screen
kdiff3 kdiff3
youtube-music youtube-music
jetbrains-toolbox jetbrains-toolbox
dotnet-sdk_8
cargo
rustc
gcc
rustfmt
clippy
cargo-generate
]; ];
programs = { programs = {

View file

@ -15,6 +15,11 @@
enableGaming = true; enableGaming = true;
enablePrinting = true; enablePrinting = true;
}; };
buildtools = {
native = true;
dotnet = true;
rust = true;
};
}; };
users.users.vinzenz.openssh.authorizedKeys.keys = [ users.users.vinzenz.openssh.authorizedKeys.keys = [