diff options
Diffstat (limited to 'bootstrap')
-rw-r--r-- | bootstrap/default.nix | 20 | ||||
-rwxr-xr-x | bootstrap/install | 6 |
2 files changed, 21 insertions, 5 deletions
diff --git a/bootstrap/default.nix b/bootstrap/default.nix index 29dda5c0..eeadb837 100644 --- a/bootstrap/default.nix +++ b/bootstrap/default.nix @@ -1,2 +1,18 @@ -{pkgs, ...}: -pkgs.writeShellScriptBin "install" (builtins.readFile ./install) +{ + pkgs, + shell-library, + ... +}: +#pkgs.writeShellScriptBin "install" (builtins.readFile ./install) +let + dependencies = with pkgs; [jq dash]; + name = "install"; +in + pkgs.runCommandLocal name { + nativeBuildInputs = [pkgs.makeWrapper] ++ dependencies; + } '' + install -m755 ${./install} -D "$out/bin/${name}" + sed -i 's|%SHELL_LIBRARY_PATH|${shell-library}|' "$out/bin/${name}" + #patchShebangs "$out/bin/${name}" + wrapProgram "$out/bin/${name}" --prefix PATH : ${pkgs.lib.makeBinPath dependencies} + '' diff --git a/bootstrap/install b/bootstrap/install index f281e1dc..d267de7e 100755 --- a/bootstrap/install +++ b/bootstrap/install @@ -1,7 +1,7 @@ -#!/bin/sh +#! /usr/bin/env dash # shellcheck disable=SC2086 # shellcheck source=/dev/null -. ~/.local/lib/shell/lib +. %SHELL_LIBRARY_PATH export LIB_TEMP_DIR_FOR_SCRIPT="$(mktemp -d)" bsc() { msg2 "$(btrfs subvolume create "$1" || dien "Creating of subvol $1")"; @@ -117,7 +117,7 @@ case $result in warning "No disk selected. Select a disk to continue.\n" fi done - nixos-install --flake https://git.sils.li/ene/nixos-config#${host} --no-root-passwd + nixos-install --flake git+https://git.sils.li/ene/nixos-config#${host} --no-root-passwd ;; *) msg "Sure, do it yourself" |