migrated all languages to devshell

This commit is contained in:
Danilo Reyes 2025-04-18 21:29:02 -06:00
parent ecb9f386ce
commit 023744a872
11 changed files with 256 additions and 94 deletions

View File

@ -32,7 +32,7 @@
users.jawz = import ./home-manager.nix;
};
time = {
timeZone = config.my.timezone;
timeZone = config.my.timeZone;
hardwareClockInLocalTime = true;
};
i18n = {

View File

@ -87,7 +87,17 @@
shell = createConfig "shell" inputs.nixpkgs;
};
devShells.${system} = {
python = self.nixosConfigurations.shell.config.devShells.python;
inherit (self.nixosConfigurations.shell.config.devShells)
cc
docker
haskell
javascript
julia
nix
python
rust
sh
;
};
};
}

View File

@ -4,12 +4,8 @@
pkgs,
...
}:
{
options.my.dev.cc.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.dev.cc.enable {
users.users.jawz.packages = builtins.attrValues {
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)
@ -18,5 +14,23 @@
valgrind # Memory leak detector and performance profiler
;
};
in
{
options = {
my.dev.cc.enable = lib.mkEnableOption "Install C/C++ tooling globally";
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.jawz.packages = packages;
};
}

View File

@ -4,13 +4,37 @@
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs) dockfmt; # Format Dockerfiles
inherit (pkgs.nodePackages)
dockerfile-language-server-nodejs # LSP for Dockerfiles
;
};
in
{
options = {
my.dev.docker.enable = lib.mkEnableOption "Install Docker tooling globally";
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.jawz = {
inherit packages;
};
})
{
options.my.dev.docker.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.dev.docker.enable {
environment.variables.DOCKER_CONFIG = "\${XDG_CONFIG_HOME}/docker";
users.users.jawz.packages = builtins.attrValues {
inherit (pkgs) dockfmt;
inherit (pkgs.nodePackages) dockerfile-language-server-nodejs;
};
};
}
];
}

View File

@ -4,10 +4,8 @@
pkgs,
...
}:
{
options.my.dev.haskell.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.dev.haskell.enable {
users.users.jawz.packages = builtins.attrValues {
let
packages = builtins.attrValues {
inherit (pkgs)
haskell-language-server # LSP server for Haskell
cabal-install # Standard Haskell build tool
@ -17,10 +15,34 @@
hoogle # Haskell API search engine
;
};
in
{
options = {
my.dev.haskell.enable = lib.mkEnableOption "Install Haskell tooling globally";
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.jawz = {
inherit packages;
};
})
{
environment.variables = {
CABAL_DIR = "\${XDG_CACHE_HOME}/cabal";
STACK_ROOT = "\${XDG_DATA_HOME}/stack";
GHCUP_USE_XDG_DIRS = "true";
};
};
}
];
}

View File

@ -4,9 +4,32 @@
pkgs,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs) nodejs; # Node.js runtime
inherit (pkgs.nodePackages) pnpm; # Fast package manager alternative to npm
};
in
{
options = {
my.dev.javascript.enable = lib.mkEnableOption "Install JavaScript tooling globally";
devShells.javascript = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "javascript-dev-shell";
shellHook = ''
echo "📦 JavaScript dev environment"
'';
};
description = "JavaScript/Node development shell with npm/pnpm support";
};
};
config = lib.mkMerge [
(lib.mkIf config.my.dev.javascript.enable {
users.users.jawz = { inherit packages; };
})
{
options.my.dev.javascript.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.dev.javascript.enable {
home-manager.users.jawz.xdg.configFile = {
"npm/npmrc".text = ''
user=0
@ -22,10 +45,6 @@
lastUpdateCheck = 1646662583446;
};
};
users.users.jawz.packages = builtins.attrValues {
inherit (pkgs) nodejs;
inherit (pkgs.nodePackages) pnpm;
};
environment.variables = {
NPM_CONFIG_USERCONFIG = "\${XDG_CONFIG_HOME}/npm/npmrc";
PNPM_HOME = "\${XDG_DATA_HOME}/pnpm";
@ -34,5 +53,6 @@
"\${XDG_DATA_HOME}/pnpm"
];
};
};
}
];
}

View File

@ -1,15 +1,32 @@
{
config,
lib,
pkgs,
config,
...
}:
let
packages = builtins.attrValues {
inherit (pkgs) julia; # High-performance dynamic language for technical computing
};
in
{
options.my.dev.julia.enable = lib.mkEnableOption "enable";
options = {
my.dev.julia.enable = lib.mkEnableOption "Install Julia globally";
devShells.julia = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "julia-dev-shell";
shellHook = ''
echo "🔬 Julia dev environment"
'';
};
description = "Julia development shell";
};
};
config = lib.mkIf config.my.dev.julia.enable {
users.users.jawz.packages = builtins.attrValues {
inherit (pkgs) julia;
users.users.jawz = {
inherit packages;
};
};
}

View File

@ -4,16 +4,34 @@
pkgs,
...
}:
{
options.my.dev.nix.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.dev.nix.enable {
users.users.jawz.packages = builtins.attrValues {
let
packages = builtins.attrValues {
inherit (pkgs)
nixfmt-rfc-style # formating
cachix # why spend time compiling?
nixd # language server
statix # linter
nixfmt-rfc-style # formatting
cachix # binary cache management
nixd # language server for Nix
statix # linter for Nix expressions
;
};
in
{
options = {
my.dev.nix.enable = lib.mkEnableOption "Install Nix tooling globally";
devShells.nix = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "nix-dev-shell";
shellHook = ''
echo " Nix dev environment"
'';
};
description = "Nix/NixOS development shell with formatter, linter, LSP, and Cachix";
};
};
config = lib.mkIf config.my.dev.nix.enable {
users.users.jawz = {
inherit packages;
};
};
}

View File

@ -4,10 +4,8 @@
pkgs,
...
}:
{
options.my.dev.rust.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.dev.rust.enable {
users.users.jawz.packages = builtins.attrValues {
let
packages = builtins.attrValues {
inherit (pkgs)
cargo # Rust package manager
rust-analyzer # Language server for Rust
@ -15,5 +13,25 @@
rustfmt # Formatter for Rust code
;
};
in
{
options = {
my.dev.rust.enable = lib.mkEnableOption "Install Rust tooling globally";
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.mkIf config.my.dev.rust.enable {
users.users.jawz = {
inherit packages;
};
};
}

View File

@ -4,17 +4,35 @@
pkgs,
...
}:
{
options.my.dev.sh.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.dev.sh.enable {
users.users.jawz.packages = builtins.attrValues {
let
packages = builtins.attrValues {
inherit (pkgs)
bashdb # autocomplete
shellcheck # linting
shfmt # a shell parser and formatter
bashdb # Debugger and completion support
shellcheck # Shell script linter
shfmt # Shell parser and formatter
;
#LSP
# LSP for Bash and sh
inherit (pkgs.nodePackages) bash-language-server;
};
in
{
options = {
my.dev.sh.enable = lib.mkEnableOption "Install shell scripting tools globally";
devShells.sh = lib.mkOption {
type = lib.types.package;
default = pkgs.mkShell {
inherit packages;
name = "sh-dev-shell";
shellHook = ''
echo "💻 Shell scripting dev environment"
'';
};
description = "Shell scripting dev shell";
};
};
config = lib.mkIf config.my.dev.sh.enable {
users.users.jawz = {
inherit packages;
};
};
}

View File

@ -74,7 +74,8 @@
gdu # disk-space utility checker, somewhat useful
tldr # man for retards
trash-cli # oop! did not meant to delete that
jq # linting
jq # json parser
yq # yaml parser
smartmontools # check hard drie health
;
inherit (inputs.jawz-scripts.packages.x86_64-linux)