Personal Nix setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move JS/Node config exclusively to home-manager

+23 -36
+23 -2
home/development/js.nix
··· 1 - { lib, config, ... }: 1 + { lib, config, pkgs, ... }: 2 2 3 3 with lib; 4 4 let ··· 10 10 default = cfg.enable; 11 11 example = true; 12 12 description = "Whether to enable JS configuration."; 13 + type = types.bool; 14 + }; 15 + 16 + bun = mkOption { 17 + default = cfg.js.enable; 13 18 type = types.bool; 14 19 }; 15 20 }; ··· 21 26 file = ./encrypt/npmrc.age; 22 27 }; 23 28 29 + home.sessionPath = [ 30 + "./node_modules/.bin" 31 + "$HOME/.local/share/pnpm" 32 + ]; 33 + 34 + home.sessionVariables = { 35 + PNPM_HOME = "$HOME/.local/share/pnpm"; 36 + BUN_RUNTIME_TRANSPILER_CACHE_PATH = mkIf cfg.js.bun "$HOME/.cache/bun/install/cache/@t@"; 37 + COREPACK_ENABLE_AUTO_PIN = "0"; 38 + }; 39 + 24 40 home.file.".yarnrc".text = '' 25 41 disable-self-update-check true 26 42 ''; 27 43 28 - home.file.".bunfig.toml".text = '' 44 + home.file.".bunfig.toml".text = mkIf cfg.js.bun '' 29 45 telemetry = false 30 46 31 47 [install] ··· 36 52 [install.cache] 37 53 dir = "~/.cache/bun/install/cache" 38 54 ''; 55 + 56 + home.packages = with pkgs; [ 57 + corepack_22 58 + nodejs_22 59 + ] ++ optionals cfg.js.bun [ pkgs.bun ]; 39 60 }; 40 61 }
-1
modules/development/default.nix
··· 11 11 }; 12 12 13 13 imports = [ 14 - ./js.nix 15 14 ./cocoapods.nix 16 15 ]; 17 16 }
-33
modules/development/js.nix
··· 1 - { lib, config, pkgs, ... }: 2 - 3 - with lib; 4 - let 5 - cfg = config.modules.development; 6 - in { 7 - options.modules.development.js = { 8 - enable = mkOption { 9 - default = cfg.enable; 10 - example = true; 11 - description = "Whether to enable JS tools."; 12 - type = types.bool; 13 - }; 14 - }; 15 - 16 - config = mkIf cfg.js.enable { 17 - environment.variables = { 18 - PNPM_HOME = "$HOME/.local/share/pnpm"; 19 - BUN_RUNTIME_TRANSPILER_CACHE_PATH = "$HOME/.cache/bun/install/cache/@t@"; 20 - COREPACK_ENABLE_AUTO_PIN = "0"; 21 - }; 22 - 23 - environment.systemPackages = (with pkgs; [ 24 - bun 25 - corepack_22 26 - nodejs_22 27 - ]); 28 - 29 - environment.interactiveShellInit = '' 30 - export PATH=./node_modules/.bin:$HOME/.local/share/pnpm:$PATH 31 - ''; 32 - }; 33 - }