1{ lib
2, resholvePackage
3, fetchFromGitHub
4, asciidoc
5, bash
6, coreutils
7, gawk
8, gnum4
9, testVersion
10, util-linux
11}:
12
13resholvePackage rec {
14 pname = "arch-install-scripts";
15 version = "24";
16
17 src = fetchFromGitHub {
18 owner = "archlinux";
19 repo = "arch-install-scripts";
20 rev = "v${version}";
21 sha256 = "06rydiliis34lbz5fsayhbczs1xqi1a80jnhxafpjf6k3rfji6iq";
22 };
23
24 nativeBuildInputs = [ asciidoc gnum4 ];
25
26 preBuild = ''
27 substituteInPlace ./Makefile \
28 --replace "PREFIX = /usr/local" "PREFIX ?= /usr/local"
29
30 # https://github.com/archlinux/arch-install-scripts/pull/10
31 substituteInPlace ./common \
32 --replace "print '%s' \"\$1\"" "printf '%s' \"\$1\""
33 '';
34
35 installFlags = [ "PREFIX=$(out)" ];
36
37 doCheck = true;
38
39 solutions = {
40 # Give each solution a short name. This is what you'd use to
41 # override its settings, and it shows in (some) error messages.
42 profile = {
43 # the only *required* arguments are the 3 below
44
45 # Specify 1 or more $out-relative script paths. Unlike many
46 # builders, resholvePackage modifies the output files during
47 # fixup (to correctly resolve in-package sourcing).
48 scripts = [ "bin/arch-chroot" "bin/genfstab" "bin/pacstrap" ];
49
50 # "none" for no shebang, "${bash}/bin/bash" for bash, etc.
51 interpreter = "${bash}/bin/bash";
52
53 # packages resholve should resolve executables from
54 inputs = [ coreutils gawk util-linux ];
55
56 # TODO: no good way to resolve mount/umount in Nix builds for now
57 # see https://github.com/abathur/resholve/issues/29
58 fake = {
59 external = [ "mount" "umount" ];
60 };
61
62 # TODO: remove the execer lore override below after
63 # https://github.com/abathur/binlore/issues/1
64 execer = [
65 "cannot:${util-linux}/bin/unshare"
66 ];
67 };
68 };
69
70 meta = with lib; {
71 description = "Useful scripts for installing Arch Linux";
72 longDescription = ''
73 A small suite of scripts aimed at automating some menial tasks when installing Arch Linux.
74 '';
75 homepage = "https://github.com/archlinux/arch-install-scripts";
76 license = licenses.gpl2Only;
77 maintainers = with maintainers; [ yayayayaka ];
78 platforms = platforms.linux;
79 };
80}