feat: rework to modular

This commit is contained in:
eric
2026-04-10 17:25:08 +02:00
parent 28dad81816
commit 99658b27dc
39 changed files with 738 additions and 211 deletions

20
shells/default.nix Normal file
View File

@@ -0,0 +1,20 @@
{
pkgs,
extraPackages ? [ ],
inputsFrom ? [ ],
shellHook ? "",
}:
pkgs.mkShell {
inherit inputsFrom shellHook;
packages =
(with pkgs; [
git
jq
just
nil
nixd
nixfmt
])
++ extraPackages;
}

16
shells/go.nix Normal file
View File

@@ -0,0 +1,16 @@
{
pkgs,
extraPackages ? [ ],
inputsFrom ? [ ],
shellHook ? "",
}:
pkgs.mkShell {
inherit inputsFrom shellHook;
packages =
(with pkgs; [
go
gopls
])
++ extraPackages;
}

19
shells/node.nix Normal file
View File

@@ -0,0 +1,19 @@
{
lib,
pkgs,
extraPackages ? [ ],
inputsFrom ? [ ],
shellHook ? "",
}:
let
nodejs = lib.attrByPath [ "nodejs_20" ] pkgs.nodejs pkgs;
in
pkgs.mkShell {
inherit inputsFrom shellHook;
packages = [
nodejs
pkgs.pnpm
]
++ extraPackages;
}

24
shells/rust.nix Normal file
View File

@@ -0,0 +1,24 @@
{
lib,
pkgs,
extraPackages ? [ ],
inputsFrom ? [ ],
shellHook ? "",
}:
let
optionalPackage = path: lib.attrByPath path null pkgs;
in
pkgs.mkShell {
inherit inputsFrom shellHook;
packages = builtins.filter (pkg: pkg != null) (
[
pkgs.cargo
pkgs.rustc
(optionalPackage [ "rust-analyzer" ])
(optionalPackage [ "rustfmt" ])
(optionalPackage [ "clippy" ])
]
++ extraPackages
);
}