HASH c7ad87d94805
DATE 2026-07-18
SUBJECT nix: builder needs sh on path for npm, extraPackages wires mermaid-ascii
FILES 2 CHANGED
HASH c7ad87d94805
DATE 2026-07-18
SUBJECT nix: builder needs sh on path for npm,
extraPackages wires mermaid-ascii
FILES 2 CHANGED
┌─ nix/default.nix ──────────────────────────────────────────────────────────┐
│ diff --git a/nix/default.nix b/nix/default.nix │
│ index 7c776a8..2bea6b6 100644 │
│ --- a/nix/default.nix │
│ +++ b/nix/default.nix │
│ @@ -1,10 +1,18 @@ │
│ -{ │
│ +{inputs, ...}: { │
│ imports = [ │
│ ./shell.nix │
│ ]; │
│ │
│ - flake.nixosModules = { │
│ - ooknet-site = import ./module.nix; │
│ - default = import ./module.nix; │
│ + flake.nixosModules = rec { │
│ + # the bare module takes no flake dependencies; the default export │
│ + # also wires in mermaid-ascii, which the markdown pipeline execs │
│ + # for diagram fences │
│ + ooknet-site = {pkgs, ...}: { │
│ + imports = [./module.nix]; │
│ + services.ooknet-site.extraPackages = [ │
│ + inputs.mermaid-ascii.packages.${pkgs.stdenv.hostPlatform.system}.default │
│ + ]; │
│ + }; │
│ + default = ooknet-site; │
│ }; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ nix/default.nix ────────────────────┐
│ diff --git a/nix/default.nix b/nix/default.n │
│ ix │
│ index 7c776a8..2bea6b6 100644 │
│ --- a/nix/default.nix │
│ +++ b/nix/default.nix │
│ @@ -1,10 +1,18 @@ │
│ -{ │
│ +{inputs, ...}: { │
│ imports = [ │
│ ./shell.nix │
│ ]; │
│ │
│ - flake.nixosModules = { │
│ - ooknet-site = import ./module.nix; │
│ - default = import ./module.nix; │
│ + flake.nixosModules = rec { │
│ + # the bare module takes no flake depend │
│ encies; the default export │
│ + # also wires in mermaid-ascii, which th │
│ e markdown pipeline execs │
│ + # for diagram fences │
│ + ooknet-site = {pkgs, ...}: { │
│ + imports = [./module.nix]; │
│ + services.ooknet-site.extraPackages = │
│ [ │
│ + inputs.mermaid-ascii.packages.${pkg │
│ s.stdenv.hostPlatform.system}.default │
│ + ]; │
│ + }; │
│ + default = ooknet-site; │
│ }; │
│ } │
└──────────────────────────────────────────────┘
┌─ nix/module.nix ───────────────────────────────────────────────────────────┐
│ diff --git a/nix/module.nix b/nix/module.nix │
│ index 58bec51..c6d4ab4 100644 │
│ --- a/nix/module.nix │
│ +++ b/nix/module.nix │
│ @@ -41,7 +41,8 @@ │
│ │
│ buildScript = pkgs.writeShellApplication { │
│ name = "ooknet-site-build"; │
│ - runtimeInputs = [pkgs.git cfg.nodejs pkgs.coreutils pkgs.findutils]; │
│ + # bash: npm lifecycle scripts spawn `sh` from PATH │
│ + runtimeInputs = [pkgs.git cfg.nodejs pkgs.bash pkgs.coreutils pkgs.findutils] │
│ ++ cfg.extraPackages; │
│ text = '' │
│ state=${escapeShellArg cfg.stateDir} │
│ src="$state/src" │
│ @@ -141,6 +142,12 @@ in { │
│ description = "Repositories rendered by the site's /git pages."; │
│ }; │
│ │
│ + extraPackages = mkOption { │
│ + type = types.listOf types.package; │
│ + default = []; │
│ + description = "Extra tools on the builder path (the flake export adds merma │
│ id-ascii, which the site's diagram fences exec)."; │
│ + }; │
│ + │
│ nodejs = mkOption { │
│ type = types.package; │
│ default = pkgs.nodejs; │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ nix/module.nix ─────────────────────┐
│ diff --git a/nix/module.nix b/nix/module.nix │
│ index 58bec51..c6d4ab4 100644 │
│ --- a/nix/module.nix │
│ +++ b/nix/module.nix │
│ @@ -41,7 +41,8 @@ │
│ │
│ buildScript = pkgs.writeShellApplication │
│ { │
│ name = "ooknet-site-build"; │
│ - runtimeInputs = [pkgs.git cfg.nodejs pk │
│ gs.coreutils pkgs.findutils]; │
│ + # bash: npm lifecycle scripts spawn `sh │
│ ` from PATH │
│ + runtimeInputs = [pkgs.git cfg.nodejs pk │
│ gs.bash pkgs.coreutils pkgs.findutils] ++ cf │
│ g.extraPackages; │
│ text = '' │
│ state=${escapeShellArg cfg.stateDir} │
│ src="$state/src" │
│ @@ -141,6 +142,12 @@ in { │
│ description = "Repositories rendered │
│ by the site's /git pages."; │
│ }; │
│ │
│ + extraPackages = mkOption { │
│ + type = types.listOf types.package; │
│ + default = []; │
│ + description = "Extra tools on the bui │
│ lder path (the flake export adds mermaid-asc │
│ ii, which the site's diagram fences exec)."; │
│ + }; │
│ + │
│ nodejs = mkOption { │
│ type = types.package; │
│ default = pkgs.nodejs; │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET