2021-08-05 21:33:18 +00:00
|
|
|
{ lib
|
2022-04-15 01:41:22 +00:00
|
|
|
, resholve
|
2021-08-05 21:33:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, asciidoc
|
|
|
|
, bash
|
|
|
|
, coreutils
|
|
|
|
, gawk
|
2022-09-09 14:08:57 +00:00
|
|
|
, gnugrep
|
2021-08-05 21:33:18 +00:00
|
|
|
, gnum4
|
2022-09-09 14:08:57 +00:00
|
|
|
, pacman
|
2021-08-05 21:33:18 +00:00
|
|
|
, util-linux
|
2022-09-09 14:08:57 +00:00
|
|
|
, chrootPath ? [
|
|
|
|
"/usr/local/sbin"
|
|
|
|
"/usr/local/bin"
|
|
|
|
"/usr/bin"
|
|
|
|
"/usr/bin/site_perl"
|
|
|
|
"/usr/bin/vendor_perl"
|
|
|
|
"/usr/bin/core_perl"
|
|
|
|
]
|
2021-08-05 21:33:18 +00:00
|
|
|
}:
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
resholve.mkDerivation rec {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "arch-install-scripts";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "28";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "archlinux";
|
|
|
|
repo = "arch-install-scripts";
|
|
|
|
rev = "v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-TytCeejhjWYDzWFjGubUl08OrsAQa9fFULoamDfbdDY=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ asciidoc gnum4 ];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
postPatch = ''
|
2021-08-05 21:33:18 +00:00
|
|
|
substituteInPlace ./Makefile \
|
|
|
|
--replace "PREFIX = /usr/local" "PREFIX ?= /usr/local"
|
2022-09-09 14:08:57 +00:00
|
|
|
substituteInPlace ./pacstrap.in \
|
|
|
|
--replace "cp -a" "cp -LR --no-preserve=mode" \
|
|
|
|
--replace "unshare pacman" "unshare ${pacman}/bin/pacman" \
|
|
|
|
--replace 'gnupg "$newroot/etc/pacman.d/"' 'gnupg "$newroot/etc/pacman.d/" && chmod 700 "$newroot/etc/pacman.d/gnupg"'
|
|
|
|
echo "export PATH=${lib.strings.makeSearchPath "" chrootPath}:\$PATH" >> ./common
|
2021-08-05 21:33:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
solutions = {
|
|
|
|
# Give each solution a short name. This is what you'd use to
|
|
|
|
# override its settings, and it shows in (some) error messages.
|
|
|
|
profile = {
|
|
|
|
# the only *required* arguments are the 3 below
|
|
|
|
|
|
|
|
# Specify 1 or more $out-relative script paths. Unlike many
|
2022-04-15 01:41:22 +00:00
|
|
|
# builders, resholve.mkDerivation modifies the output files during
|
2021-08-05 21:33:18 +00:00
|
|
|
# fixup (to correctly resolve in-package sourcing).
|
|
|
|
scripts = [ "bin/arch-chroot" "bin/genfstab" "bin/pacstrap" ];
|
|
|
|
|
|
|
|
# "none" for no shebang, "${bash}/bin/bash" for bash, etc.
|
|
|
|
interpreter = "${bash}/bin/bash";
|
|
|
|
|
|
|
|
# packages resholve should resolve executables from
|
2022-09-09 14:08:57 +00:00
|
|
|
inputs = [ coreutils gawk gnugrep pacman util-linux ];
|
2021-09-26 12:46:18 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
execer = [ "cannot:${pacman}/bin/pacman-key" ];
|
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
# TODO: no good way to resolve mount/umount in Nix builds for now
|
|
|
|
# see https://github.com/abathur/resholve/issues/29
|
2022-12-28 21:21:41 +00:00
|
|
|
fix = {
|
|
|
|
mount = true;
|
|
|
|
umount = true;
|
2021-09-26 12:46:18 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
keep = [ "$setup" "$pid_unshare" "$mount_unshare" "${pacman}/bin/pacman" ];
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Useful scripts for installing Arch Linux";
|
|
|
|
longDescription = ''
|
|
|
|
A small suite of scripts aimed at automating some menial tasks when installing Arch Linux.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/archlinux/arch-install-scripts";
|
|
|
|
license = licenses.gpl2Only;
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ samlukeyes123 ];
|
2021-08-05 21:33:18 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|