init by ai
This commit is contained in:
50
nixos/modules/development.nix
Normal file
50
nixos/modules/development.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{ config, lib, pkgs, pkgs-unstable, ... }:
|
||||
|
||||
{
|
||||
options.custom.development = {
|
||||
enable = lib.mkEnableOption "Development tools";
|
||||
languages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = "Programming languages to install (rust, python, nodejs, go, etc)";
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
cfg = config.custom.development;
|
||||
|
||||
languagePackages = {
|
||||
rust = with pkgs; [ rustup cargo-deny cargo-edit ];
|
||||
python = with pkgs; [ python3 python3Packages.pip python3Packages.virtualenv ];
|
||||
nodejs = with pkgs; [ nodejs npm pnpm ];
|
||||
go = with pkgs; [ go golangci-lint ];
|
||||
ruby = with pkgs; [ ruby bundler ];
|
||||
};
|
||||
|
||||
selectedPackages =
|
||||
lib.concatMap (lang: languagePackages.${lang} or []) cfg.languages;
|
||||
|
||||
in lib.mkIf cfg.enable {
|
||||
|
||||
# Core development tools
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
git-lfs
|
||||
gnumake
|
||||
pkg-config
|
||||
gcc
|
||||
clang
|
||||
cmake
|
||||
gdb
|
||||
ripgrep
|
||||
fd
|
||||
jq
|
||||
yq-go
|
||||
] ++ selectedPackages;
|
||||
|
||||
# Enable container support (optional)
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.enableOnBoot = false;
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user