From 67b605393c3c773b2ac371854de75610ae141dfd Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 8 Sep 2026 08:23:48 +0000 Subject: [PATCH] install: add nix profile and override input --- install/install.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/install/install.ts b/install/install.ts index dfa757d0a..bc5479d42 100644 --- a/install/install.ts +++ b/install/install.ts @@ -18,9 +18,18 @@ export const link = isSupported ? (text: string, url: string) => [ const freemem = os.freemem(); const smallMemory = (freemem < 1024 * 1024 * 1024); -const nixInstall = (...packages: string[]) => (smallMemory - ? packages.map((t) => `nix-env -iA ${t.includes('.') ? t : `nixpkgs.${t}`}`).join(' && ') - : `nix-env -iA ${packages.map((t) => (t.includes('.') ? t : `nixpkgs.${t}`)).join(' ')}`); +const useNixProfile = process.argv.includes('--use-nix-profile'); + +const nixInstall = (...packages: string[]) => { + if (useNixProfile) { + return packages.map((t) => (t.startsWith('hydro.') + ? `nix profile install github:hydro-dev/nix-channel/master#${t.split('.')[1]} --override-input nixpkgs github:NixOS/nixpkgs/nixos-23.11` + : `nix profile install nixpkgs#${t}`)).join(' && '); + } + return smallMemory + ? packages.map((t) => `nix-env -iA ${t.includes('.') ? t : `nixpkgs.${t}`}`).join(' && ') + : `nix-env -iA ${packages.map((t) => (t.includes('.') ? t : `nixpkgs.${t}`)).join(' ')}`; +}; const warnings: [string, ...any[]][] = [];