feat: introduced nix packaging and path-based binary resolution

- Add comprehensive Nix flake definitions, derivations, modules, and CI workflows.
- Update tests and executables to resolve binaries from PATH rather than absolute paths.
- Ensure byte reproducibility and zeroed timestamps in embedded dashboard archives.
- Add handling for Nix-managed installations in CLI update checks.
This commit is contained in:
can1357
2026-08-13 03:52:47 +02:00
parent 2e492a3076
commit b60bef961c
33 changed files with 3515 additions and 89 deletions
@@ -5,7 +5,7 @@ import { spawn } from "node:child_process";
import * as fs from "node:fs/promises";
import * as os from "node:os";
import * as path from "node:path";
import { $env, Snowflake } from "@oh-my-pi/pi-utils";
import { $env, $which, Snowflake } from "@oh-my-pi/pi-utils";
/**
* Returns the user's preferred editor command, or a platform default.
@@ -56,7 +56,7 @@ export async function openInEditor(
const child =
process.platform === "win32"
? spawn(editor, [...editorArgs, tmpFile], { stdio, shell: true })
: spawn("/bin/sh", ["-c", `${editorCmd} "$1"`, "sh", tmpFile], { stdio });
: spawn($which("sh") ?? "sh", ["-c", `${editorCmd} "$1"`, "sh", tmpFile], { stdio });
const { promise, reject, resolve } = Promise.withResolvers<number>();
child.once("exit", (code, signal) => resolve(code ?? (signal ? -1 : 0)));
child.once("error", error => reject(error));
+2 -1
View File
@@ -10,6 +10,7 @@ import {
parseNumstat,
} from "../commit/git/diff";
import type { FileDiff, FileHunks, NumstatEntry } from "../commit/types";
import { REJECT_PROMPT_COMMAND } from "../exec/non-interactive-env";
import { ToolAbortError, ToolError, throwIfAborted } from "../tools/tool-errors";
// ════════════════════════════════════════════════════════════════════════════
@@ -199,7 +200,7 @@ const GIT_NON_INTERACTIVE_ENV = {
GIT_TERMINAL_PROMPT: "0",
LC_ALL: undefined,
LC_MESSAGES: "C",
SSH_ASKPASS: "/usr/bin/false",
SSH_ASKPASS: REJECT_PROMPT_COMMAND,
} satisfies Record<string, string | undefined>;
const GH_NON_INTERACTIVE_ENV = {
...GIT_NON_INTERACTIVE_ENV,