more cleanup
This commit is contained in:
92
modules/nixos/development/default.nix
Normal file
92
modules/nixos/development/default.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.${namespace}.development;
|
||||
in
|
||||
{
|
||||
options.${namespace}.development = {
|
||||
enable = lib.mkEnableOption "Common development tools and packages";
|
||||
|
||||
includeLanguages = lib.mkOption {
|
||||
type = lib.types.listOf (
|
||||
lib.types.enum [
|
||||
"python"
|
||||
"c"
|
||||
"rust"
|
||||
"nodejs"
|
||||
]
|
||||
);
|
||||
default = [
|
||||
"python"
|
||||
"c"
|
||||
];
|
||||
description = "Programming languages to include tools for";
|
||||
};
|
||||
|
||||
includeContainers = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Include container development tools";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
[
|
||||
# Version control
|
||||
git
|
||||
|
||||
# Build tools
|
||||
cmake
|
||||
ninja
|
||||
binutils
|
||||
|
||||
# System utilities
|
||||
jq
|
||||
|
||||
# Text processing
|
||||
|
||||
]
|
||||
++ lib.optionals (builtins.elem "python" cfg.includeLanguages) [
|
||||
python3
|
||||
python3Packages.pip
|
||||
]
|
||||
++ lib.optionals (builtins.elem "c" cfg.includeLanguages) [
|
||||
gcc
|
||||
gdb
|
||||
]
|
||||
++ lib.optionals (builtins.elem "rust" cfg.includeLanguages) [
|
||||
rustc
|
||||
cargo
|
||||
]
|
||||
++ lib.optionals (builtins.elem "nodejs" cfg.includeLanguages) [
|
||||
nodejs
|
||||
npm
|
||||
]
|
||||
++ lib.optionals cfg.includeContainers [
|
||||
docker-compose
|
||||
podman-compose
|
||||
];
|
||||
|
||||
# Enable container support if requested
|
||||
virtualisation.podman = lib.mkIf cfg.includeContainers {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
autoPrune.enable = true;
|
||||
defaultNetwork.settings = {
|
||||
dns_enabled = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Common development programs
|
||||
programs = {
|
||||
nix-ld.enable = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user