2023-12-16 11:28:44 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.my.buildtools;
|
2024-05-25 11:23:22 +02:00
|
|
|
isDesktop = config.my.desktop.enable;
|
|
|
|
dotnetPackage = with pkgs.unstable; (dotnetCorePackages.combinePackages [
|
2024-03-09 17:56:02 +01:00
|
|
|
dotnet-sdk_8
|
|
|
|
]);
|
2023-12-16 11:28:44 +01:00
|
|
|
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";
|
2023-12-25 12:06:50 +01:00
|
|
|
jetbrains-remote-server = lib.mkEnableOption "setup jetbrais IDE installs so -remote-dev-server can be started";
|
2024-02-23 22:27:52 +01:00
|
|
|
objective-c = lib.mkEnableOption "Objective-C with GNUStep";
|
2024-03-09 17:56:02 +01:00
|
|
|
js = lib.mkEnableOption "node stuff";
|
2024-05-25 11:23:22 +02:00
|
|
|
android = lib.mkEnableOption "android development";
|
|
|
|
python = lib.mkEnableOption "generic python 3";
|
2023-12-16 11:28:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkMerge [
|
2024-05-25 11:23:22 +02:00
|
|
|
(lib.mkIf cfg.native {
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
cmake
|
|
|
|
gnumake
|
|
|
|
gcc
|
|
|
|
gdb
|
|
|
|
];
|
|
|
|
})
|
|
|
|
|
2023-12-16 11:28:44 +01:00
|
|
|
(lib.mkIf cfg.dotnet {
|
2023-12-16 13:07:12 +01:00
|
|
|
environment = {
|
|
|
|
systemPackages = with pkgs; [
|
2024-03-09 17:56:02 +01:00
|
|
|
dotnetPackage
|
2023-12-16 15:33:20 +01:00
|
|
|
|
2024-02-23 22:27:52 +01:00
|
|
|
zlib
|
|
|
|
zlib.dev
|
2023-12-16 15:33:20 +01:00
|
|
|
openssl
|
|
|
|
icu
|
2024-03-09 17:56:02 +01:00
|
|
|
icu.dev
|
|
|
|
|
|
|
|
# native aot
|
|
|
|
gcc
|
|
|
|
libunwind
|
2023-12-16 13:07:12 +01:00
|
|
|
];
|
|
|
|
variables = {
|
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT = "1";
|
|
|
|
};
|
|
|
|
};
|
2024-03-09 17:56:02 +01:00
|
|
|
programs.nix-ld.libraries = with pkgs; [
|
|
|
|
# native aot
|
|
|
|
libunwind
|
|
|
|
icu
|
|
|
|
zlib
|
|
|
|
zlib.dev
|
|
|
|
openssl
|
|
|
|
icu
|
|
|
|
icu.dev
|
|
|
|
dotnetPackage
|
|
|
|
];
|
2023-12-16 11:28:44 +01:00
|
|
|
})
|
2024-05-25 11:23:22 +02:00
|
|
|
|
|
|
|
(lib.mkIf cfg.js {
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
nodejs
|
|
|
|
];
|
2024-03-09 18:11:59 +01:00
|
|
|
})
|
2024-05-25 11:23:22 +02:00
|
|
|
|
2023-12-16 11:28:44 +01:00
|
|
|
(lib.mkIf cfg.rust {
|
|
|
|
environment.systemPackages = with pkgs; [
|
2024-05-25 11:23:22 +02:00
|
|
|
rustup
|
|
|
|
musl
|
2023-12-16 11:28:44 +01:00
|
|
|
];
|
|
|
|
})
|
2024-05-25 11:23:22 +02:00
|
|
|
|
2023-12-25 12:06:50 +01:00
|
|
|
(lib.mkIf cfg.jetbrains-remote-server {
|
2024-05-25 11:23:22 +02:00
|
|
|
my.buildtools.dotnet = true;
|
|
|
|
my.buildtools.native = true;
|
|
|
|
my.buildtools.python = true;
|
2024-02-23 22:27:52 +01:00
|
|
|
})
|
2024-05-25 11:23:22 +02:00
|
|
|
|
2024-02-23 22:27:52 +01:00
|
|
|
(lib.mkIf cfg.objective-c {
|
2024-05-25 11:23:22 +02:00
|
|
|
my.buildtools.native = true;
|
2024-02-23 22:27:52 +01:00
|
|
|
environment.systemPackages =
|
|
|
|
(with pkgs.gnustep; [
|
|
|
|
gui
|
|
|
|
make
|
|
|
|
gorm
|
|
|
|
base
|
|
|
|
back
|
|
|
|
system_preferences
|
|
|
|
projectcenter
|
|
|
|
libobjc
|
|
|
|
gworkspace
|
|
|
|
])
|
|
|
|
++ (with pkgs; [
|
|
|
|
clang-tools
|
|
|
|
clang
|
|
|
|
]);
|
2023-12-25 12:06:50 +01:00
|
|
|
})
|
2024-05-25 11:23:22 +02:00
|
|
|
|
|
|
|
(lib.mkIf cfg.android {
|
2024-03-09 17:56:02 +01:00
|
|
|
environment.systemPackages = with pkgs; [
|
2024-05-25 11:23:22 +02:00
|
|
|
android-tools
|
|
|
|
android-udev-rules
|
2024-03-09 17:56:02 +01:00
|
|
|
];
|
|
|
|
})
|
2024-05-25 11:23:22 +02:00
|
|
|
|
|
|
|
(lib.mkIf cfg.python {
|
|
|
|
environment.systemPackages = with pkgs; [python3 python3Packages.pip];
|
|
|
|
})
|
2023-12-16 11:28:44 +01:00
|
|
|
];
|
|
|
|
}
|