rest of the split migration

This commit is contained in:
Danilo Reyes
2026-03-16 16:41:10 -06:00
parent 195c55891e
commit 9c6f17f113
44 changed files with 859 additions and 483 deletions

View File

@@ -1,44 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
clang # C/C++ compiler frontend (part of LLVM)
clang-tools # Extra LLVM tools (e.g. clang-tidy, clang-apply-replacements)
gcc # GNU Compiler Collection (C, C++, etc.)
gdb # GNU Debugger
valgrind # Memory leak detector and performance profiler
;
};
in
{
options = {
my.dev.cc = {
enable = lib.mkEnableOption "Install C/C++ tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install C/C++ packages for";
};
};
devShells.cc = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "cc-dev-shell";
shellHook = ''
echo "🔧 C/C++ dev environment"
'';
};
description = "C/C++ development shell";
};
};
config = lib.mkIf config.my.dev.cc.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.cc.users { inherit packages; };
};
}

22
modules/dev/cc/common.nix Normal file
View File

@@ -0,0 +1,22 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs)
clang
clang-tools
gcc
gdb
valgrind
;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "cc-dev-shell";
shellHook = ''
echo "🔧 C/C++ dev environment"
'';
};
}

34
modules/dev/cc/home.nix Normal file
View File

@@ -0,0 +1,34 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"cc"
];
};
cfg = config.my.dev.cc;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.cc.enable = lib.mkEnableOption "Install C/C++ tooling globally";
config = lib.mkMerge [
{
my.dev.cc.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
})
];
}

27
modules/dev/cc/nixos.nix Normal file
View File

@@ -0,0 +1,27 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
my.dev.cc = {
enable = lib.mkEnableOption "Install C/C++ tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install C/C++ packages for";
};
};
devShells.cc = lib.mkOption {
type = lib.types.package;
default = feature.devShell;
description = "C/C++ development shell";
};
};
}

View File

@@ -1,46 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
dockfmt # Format Dockerfiles
dockerfile-language-server # LSP for Dockerfiles
;
};
in
{
options = {
my.dev.docker = {
enable = lib.mkEnableOption "Install Docker tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Docker packages for";
};
};
devShells.docker = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "docker-dev-shell";
shellHook = ''
echo "🐳 Docker dev environment"
'';
};
description = "Docker and Dockerfile tooling shell";
};
};
config = lib.mkMerge [
(lib.mkIf config.my.dev.docker.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.docker.users { inherit packages; };
})
{
environment.variables.DOCKER_CONFIG = "\${XDG_CONFIG_HOME}/docker";
}
];
}

View File

@@ -0,0 +1,19 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs)
dockfmt
dockerfile-language-server
;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "docker-dev-shell";
shellHook = ''
echo "🐳 Docker dev environment"
'';
};
}

View File

@@ -0,0 +1,35 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"docker"
];
};
cfg = config.my.dev.docker;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.docker.enable = lib.mkEnableOption "Install Docker tooling globally";
config = lib.mkMerge [
{
my.dev.docker.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
home.sessionVariables.DOCKER_CONFIG = "${config.xdg.configHome}/docker";
})
];
}

View File

@@ -0,0 +1,27 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
my.dev.docker = {
enable = lib.mkEnableOption "Install Docker tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Docker packages for";
};
};
devShells.docker = lib.mkOption {
type = lib.types.package;
default = feature.devShell;
description = "Docker and Dockerfile tooling shell";
};
};
}

View File

@@ -1,52 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
go # Go compiler and core toolchain
gocode-gomod # Code completion for Go (modern fork of gocode)
gotools # Contains godoc, gorename, goimports, etc.
gore # Go REPL
gotests # Generate Go tests from function signatures
gomodifytags # Struct tag manipulation
golangci-lint # Linter aggregation
;
};
GOPATH = "\${XDG_DATA_HOME}/go";
in
{
options = {
my.dev.go = {
enable = lib.mkEnableOption "Install Go tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Go packages for";
};
};
devShells.go = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages GOPATH;
name = "go-dev-shell";
shellHook = ''
echo "🐹 Go dev environment"
'';
};
description = "Go development shell with Emacs tooling, REPL, formatter, and linter";
};
};
config = lib.mkMerge [
{
environment.variables = { inherit GOPATH; };
}
(lib.mkIf config.my.dev.go.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.go.users { inherit packages; };
})
];
}

25
modules/dev/go/common.nix Normal file
View File

@@ -0,0 +1,25 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs)
go
gocode-gomod
gotools
gore
gotests
gomodifytags
golangci-lint
;
};
GOPATH = "\${XDG_DATA_HOME:-\$HOME/.local/share}/go";
in
{
inherit packages GOPATH;
devShell = pkgs.mkShell {
inherit packages GOPATH;
name = "go-dev-shell";
shellHook = ''
echo "🐹 Go dev environment"
'';
};
}

35
modules/dev/go/home.nix Normal file
View File

@@ -0,0 +1,35 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"go"
];
};
cfg = config.my.dev.go;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.go.enable = lib.mkEnableOption "Install Go tooling globally";
config = lib.mkMerge [
{
my.dev.go.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
home.sessionVariables.GOPATH = "${config.xdg.dataHome}/go";
})
];
}

27
modules/dev/go/nixos.nix Normal file
View File

@@ -0,0 +1,27 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
my.dev.go = {
enable = lib.mkEnableOption "Install Go tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Go packages for";
};
};
devShells.go = lib.mkOption {
type = lib.types.package;
default = feature.devShell;
description = "Go development shell with Emacs tooling, REPL, formatter, and linter";
};
};
}

View File

@@ -1,54 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
haskell-language-server # LSP server for Haskell
cabal-install # Standard Haskell build tool
hlint # Linter for Haskell source code
;
inherit (pkgs.haskellPackages)
hoogle # Haskell API search engine
;
};
in
{
options = {
my.dev.haskell = {
enable = lib.mkEnableOption "Install Haskell tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Haskell packages for";
};
};
devShells.haskell = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "haskell-dev-shell";
shellHook = ''
echo "λ Haskell dev environment"
'';
};
description = "Haskell development shell";
};
};
config = lib.mkMerge [
(lib.mkIf config.my.dev.haskell.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.haskell.users { inherit packages; };
})
{
environment.variables = {
CABAL_DIR = "\${XDG_CACHE_HOME}/cabal";
STACK_ROOT = "\${XDG_DATA_HOME}/stack";
GHCUP_USE_XDG_DIRS = "true";
};
}
];
}

View File

@@ -0,0 +1,23 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs)
haskell-language-server
cabal-install
hlint
;
inherit (pkgs.haskellPackages)
hoogle
;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "haskell-dev-shell";
shellHook = ''
echo "λ Haskell dev environment"
'';
};
}

View File

@@ -0,0 +1,39 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"haskell"
];
};
cfg = config.my.dev.haskell;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.haskell.enable = lib.mkEnableOption "Install Haskell tooling globally";
config = lib.mkMerge [
{
my.dev.haskell.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
home.sessionVariables = {
CABAL_DIR = "${config.xdg.cacheHome}/cabal";
STACK_ROOT = "${config.xdg.dataHome}/stack";
GHCUP_USE_XDG_DIRS = "true";
};
})
];
}

View File

@@ -0,0 +1,27 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
my.dev.haskell = {
enable = lib.mkEnableOption "Install Haskell tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Haskell packages for";
};
};
devShells.haskell = lib.mkOption {
type = lib.types.package;
default = feature.devShell;
description = "Haskell development shell";
};
};
}

View File

@@ -0,0 +1,16 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs) julia;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "julia-dev-shell";
shellHook = ''
echo "🔬 Julia dev environment"
'';
};
}

View File

@@ -0,0 +1,34 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"julia"
];
};
cfg = config.my.dev.julia;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.julia.enable = lib.mkEnableOption "Install Julia globally";
config = lib.mkMerge [
{
my.dev.julia.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
})
];
}

View File

@@ -6,9 +6,7 @@
...
}:
let
packages = builtins.attrValues {
inherit (pkgs) julia; # High-performance dynamic language for technical computing
};
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
@@ -22,17 +20,8 @@ in
};
devShells.julia = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "julia-dev-shell";
shellHook = ''
echo "🔬 Julia dev environment"
'';
};
default = feature.devShell;
description = "Julia development shell";
};
};
config = lib.mkIf config.my.dev.julia.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.julia.users { inherit packages; };
};
}

View File

@@ -0,0 +1,18 @@
{ pkgs, inputs }:
let
packages = [
pkgs.codex
inputs.self.packages.${pkgs.system}.nixos-mcp
];
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "mcp-dev-shell";
shellHook = ''
export CODEX_HOME=$PWD/.codex
echo "MCP shell ready: codex + nixos-mcp"
'';
};
}

34
modules/dev/mcp/home.nix Normal file
View File

@@ -0,0 +1,34 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"mcp"
];
};
cfg = config.my.dev.mcp;
feature = import ./common.nix { inherit pkgs inputs; };
in
{
options.my.dev.mcp.enable = lib.mkEnableOption "Install MCP tooling globally";
config = lib.mkMerge [
{
my.dev.mcp.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
})
];
}

View File

@@ -6,10 +6,7 @@
...
}:
let
packages = [
pkgs.codex
inputs.self.packages.${pkgs.system}.nixos-mcp
];
feature = import ./common.nix { inherit pkgs inputs; };
in
{
options = {
@@ -23,18 +20,8 @@ in
};
devShells.mcp = lib.mkOption {
type = lib.types.package;
default = feature.devShell;
description = "MCP dev shell for this repo";
default = pkgs.mkShell {
inherit packages;
name = "mcp-dev-shell";
shellHook = ''
export CODEX_HOME=$PWD/.codex
echo "MCP shell ready: codex + nixos-mcp"
'';
};
};
};
config = lib.mkIf config.my.dev.mcp.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.mcp.users { inherit packages; };
};
}

View File

@@ -1,48 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs) ruby; # Ruby interpreter
inherit (pkgs.rubyPackages) solargraph; # LSP for Ruby
};
in
{
options = {
my.dev.ruby = {
enable = lib.mkEnableOption "Install Ruby tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Ruby packages for";
};
};
devShells.ruby = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "ruby-dev-shell";
shellHook = ''
echo "💎 Ruby dev environment"
'';
};
description = "Ruby development shell with interpreter and Solargraph LSP";
};
};
config = lib.mkMerge [
(lib.mkIf config.my.dev.ruby.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.ruby.users { inherit packages; };
})
{
environment.variables = {
GEM_HOME = "\${XDG_DATA_HOME}/ruby/gems";
GEM_PATH = "\${XDG_DATA_HOME}/ruby/gems";
GEM_SPEC_CACHE = "\${XDG_DATA_HOME}/ruby/specs";
};
}
];
}

View File

@@ -0,0 +1,17 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs) ruby;
inherit (pkgs.rubyPackages) solargraph;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "ruby-dev-shell";
shellHook = ''
echo "💎 Ruby dev environment"
'';
};
}

39
modules/dev/ruby/home.nix Normal file
View File

@@ -0,0 +1,39 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"ruby"
];
};
cfg = config.my.dev.ruby;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.ruby.enable = lib.mkEnableOption "Install Ruby tooling globally";
config = lib.mkMerge [
{
my.dev.ruby.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
home.sessionVariables = {
GEM_HOME = "${config.xdg.dataHome}/ruby/gems";
GEM_PATH = "${config.xdg.dataHome}/ruby/gems";
GEM_SPEC_CACHE = "${config.xdg.dataHome}/ruby/specs";
};
})
];
}

View File

@@ -0,0 +1,27 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
my.dev.ruby = {
enable = lib.mkEnableOption "Install Ruby tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Ruby packages for";
};
};
devShells.ruby = lib.mkOption {
type = lib.types.package;
default = feature.devShell;
description = "Ruby development shell with interpreter and Solargraph LSP";
};
};
}

View File

@@ -1,49 +0,0 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
rustc # Rust compiler
cargo # Rust package manager
rust-analyzer # Language server for Rust
clippy # Linter for Rust
rustfmt # Formatter for Rust code
;
};
in
{
options = {
my.dev.rust = {
enable = lib.mkEnableOption "Install Rust tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Rust packages for";
};
};
devShells.rust = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "rust-dev-shell";
shellHook = ''
echo "🦀 Rust dev environment"
'';
};
description = "Rust development shell with cargo and rust-analyzer";
};
};
config = lib.mkMerge [
(lib.mkIf config.my.dev.rust.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.rust.users { inherit packages; };
})
{
environment.variables.CARGO_HOME = "\${XDG_DATA_HOME}/cargo";
}
];
}

View File

@@ -0,0 +1,22 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs)
rustc
cargo
rust-analyzer
clippy
rustfmt
;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "rust-dev-shell";
shellHook = ''
echo "🦀 Rust dev environment"
'';
};
}

35
modules/dev/rust/home.nix Normal file
View File

@@ -0,0 +1,35 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"rust"
];
};
cfg = config.my.dev.rust;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.rust.enable = lib.mkEnableOption "Install Rust tooling globally";
config = lib.mkMerge [
{
my.dev.rust.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo";
})
];
}

View File

@@ -0,0 +1,27 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
my.dev.rust = {
enable = lib.mkEnableOption "Install Rust tooling globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Rust packages for";
};
};
devShells.rust = lib.mkOption {
type = lib.types.package;
default = feature.devShell;
description = "Rust development shell with cargo and rust-analyzer";
};
};
}

View File

@@ -0,0 +1,19 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs)
zig
zls
;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "zig-dev-shell";
shellHook = ''
echo "🦎 Zig dev environment"
'';
};
}

34
modules/dev/zig/home.nix Normal file
View File

@@ -0,0 +1,34 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"zig"
];
};
cfg = config.my.dev.zig;
feature = import ./common.nix { inherit pkgs; };
in
{
options.my.dev.zig.enable = lib.mkEnableOption "Install Zig tooling globally";
config = lib.mkMerge [
{
my.dev.zig.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = feature.packages;
})
];
}

View File

@@ -6,12 +6,7 @@
...
}:
let
packages = builtins.attrValues {
inherit (pkgs)
zig # Zig compiler and stdlib
zls # Language server for Zig
;
};
feature = import ./common.nix { inherit pkgs; };
in
{
options = {
@@ -25,17 +20,8 @@ in
};
devShells.zig = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "zig-dev-shell";
shellHook = ''
echo "🦎 Zig dev environment"
'';
};
default = feature.devShell;
description = "Zig development shell with compiler and LSP";
};
};
config = lib.mkIf config.my.dev.zig.enable {
users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.zig.users { inherit packages; };
};
}

View File

@@ -0,0 +1,20 @@
{
inputs,
lib,
osConfig ? null,
...
}:
let
shellType = inputs.self.lib.hmShellType osConfig "bash";
in
{
options.my.shell.type = lib.mkOption {
type = lib.types.enum [
"bash"
"zsh"
];
default = "bash";
description = "The shell to use in Home Manager";
};
config.my.shell.type = lib.mkDefault shellType;
}