adding specific dev language tooling shell config

This commit is contained in:
Rasyidan Akbar F. 2025-09-30 16:36:28 +07:00
commit 797c5769b2
5 changed files with 320 additions and 33 deletions

View file

@ -8,6 +8,7 @@
./shell/nushell.nix
./shell/tmux.nix
./devtools/ai-tools.nix
./devtools/languages.nix
./devtools/default.nix
];
@ -21,6 +22,27 @@
rsydn.devTools = {
enable = lib.mkDefault true;
packages = with pkgs; [ bun cloudflared ];
packages = with pkgs; [
ast-grep
cloudflared
ffmpeg
fzf
htop
jetbrains-mono
jq
lazydocker
lazygit
lorri
neovim
pandoc
ripgrep
tmux
tree
vim
wget
yq
];
};
rsydn.languages.enable = lib.mkDefault true;
}

View file

@ -0,0 +1,103 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkEnableOption mkOption mkIf types warn unique;
cfg = config.rsydn.languages;
hasPkg = name: builtins.hasAttr name pkgs;
getPkg = name: if hasPkg name then pkgs.${name} else null;
mkToolOption = { name, defaultPackage, description }:
mkOption {
type = types.submodule {
options = {
enable = mkOption {
type = types.bool;
default = defaultPackage != null;
description = "Enable ${name} tooling globally.";
};
package = mkOption {
type = types.nullOr types.package;
default = defaultPackage;
description =
"Package derivation to install for ${name}. Set to null to skip.";
};
};
};
default = {
enable = defaultPackage != null;
package = defaultPackage;
};
description = description;
};
mkToolPackages = specs:
builtins.concatMap (tool:
let toolCfg = tool.cfg;
in if toolCfg.enable then
if toolCfg.package != null then
[ toolCfg.package ]
else
warn "rsydn.languages.${tool.name}: package is null, skipping" [ ]
else
[ ]) specs;
uvPackage = getPkg "uv";
goPackage = getPkg "go";
nodePackage = if builtins.hasAttr "nodejs_20" pkgs then
pkgs.nodejs_20
else
getPkg "nodejs";
toolSpecs = [
{
name = "uv";
cfg = cfg.uv;
defaultPackage = uvPackage;
}
{
name = "go";
cfg = cfg.go;
defaultPackage = goPackage;
}
{
name = "node";
cfg = cfg.node;
defaultPackage = nodePackage;
}
];
languagePackages = mkToolPackages toolSpecs;
in {
options.rsydn.languages = {
enable = mkEnableOption "Language tooling packages for everyday workflows";
uv = mkToolOption {
name = "uv";
defaultPackage = uvPackage;
description = "Python package installer and virtualenv manager.";
};
go = mkToolOption {
name = "Go";
defaultPackage = goPackage;
description = "Go compiler and GOPATH toolchain.";
};
node = mkToolOption {
name = "Node.js";
defaultPackage = nodePackage;
description = "Node.js runtime for CLI tooling.";
};
extraPackages = mkOption {
type = types.listOf types.package;
default = [ ];
description = "Additional language tooling packages to install globally.";
};
};
config = mkIf cfg.enable {
home.packages = unique (languagePackages ++ cfg.extraPackages);
};
}