diff --git a/modules/buildtools.nix b/modules/buildtools.nix new file mode 100644 index 0000000..8dce623 --- /dev/null +++ b/modules/buildtools.nix @@ -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 + ]; + }) + ]; +} diff --git a/modules/default.nix b/modules/default.nix index 7adcf2c..b6f047d 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,6 +7,7 @@ modulesCfg: {lib, ...}: { ./server.nix ./sshd.nix ./tailscale.nix + ./buildtools.nix ] ++ (map (path: (import path modulesCfg)) [ ./hardware diff --git a/modules/users/vinzenz-home.nix b/modules/users/vinzenz-home.nix index 27ed3e2..ecbe173 100644 --- a/modules/users/vinzenz-home.nix +++ b/modules/users/vinzenz-home.nix @@ -26,16 +26,7 @@ in screen kdiff3 youtube-music - jetbrains-toolbox - dotnet-sdk_8 - - cargo - rustc - gcc - rustfmt - clippy - cargo-generate ]; programs = { diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index f1f8aa2..27e23af 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -15,6 +15,11 @@ enableGaming = true; enablePrinting = true; }; + buildtools = { + native = true; + dotnet = true; + rust = true; + }; }; users.users.vinzenz.openssh.authorizedKeys.keys = [