zoxide: 0.9.6 -> 0.9.7 (#380745)
[NixPkgs.git] / pkgs / by-name / ar / arch-install-scripts / package.nix
blob18a53354908955f737ba86fda0ea579c88025cfc
2   lib,
3   resholve,
4   fetchFromGitLab,
5   asciidoc,
6   bash,
7   coreutils,
8   gawk,
9   gnugrep,
10   gnum4,
11   gnused,
12   pacman,
13   util-linux,
14   chrootPath ? [
15     "/usr/local/sbin"
16     "/usr/local/bin"
17     "/usr/bin"
18     "/usr/bin/site_perl"
19     "/usr/bin/vendor_perl"
20     "/usr/bin/core_perl"
21   ],
24 resholve.mkDerivation rec {
25   pname = "arch-install-scripts";
26   version = "29";
28   src = fetchFromGitLab {
29     domain = "gitlab.archlinux.org";
30     owner = "archlinux";
31     repo = "arch-install-scripts";
32     rev = "v${version}";
33     hash = "sha256-XWcZZ+ET3J4dB6M9CdXESf0iQh+2vYxlxoJ6TZ3vFUk=";
34   };
36   nativeBuildInputs = [
37     asciidoc
38     gnum4
39   ];
41   postPatch = ''
42     substituteInPlace ./Makefile \
43       --replace "PREFIX = /usr/local" "PREFIX ?= /usr/local"
44     substituteInPlace ./pacstrap.in \
45       --replace "cp -a" "cp -LR --no-preserve=mode" \
46       --replace "unshare pacman" "unshare ${pacman}/bin/pacman" \
47       --replace 'gnupg "$newroot/etc/pacman.d/"' 'gnupg "$newroot/etc/pacman.d/" && chmod 700 "$newroot/etc/pacman.d/gnupg"'
48     echo "export PATH=${lib.strings.makeSearchPath "" chrootPath}:\$PATH" >> ./common
49   '';
51   installFlags = [ "PREFIX=$(out)" ];
53   doCheck = true;
55   solutions = {
56     # Give each solution a short name. This is what you'd use to
57     # override its settings, and it shows in (some) error messages.
58     profile = {
59       # the only *required* arguments are the 3 below
61       # Specify 1 or more $out-relative script paths. Unlike many
62       # builders, resholve.mkDerivation modifies the output files during
63       # fixup (to correctly resolve in-package sourcing).
64       scripts = [
65         "bin/arch-chroot"
66         "bin/genfstab"
67         "bin/pacstrap"
68       ];
70       # "none" for no shebang, "${bash}/bin/bash" for bash, etc.
71       interpreter = "${bash}/bin/bash";
73       # packages resholve should resolve executables from
74       inputs = [
75         coreutils
76         gawk
77         gnugrep
78         gnused
79         pacman
80         util-linux
81       ];
83       execer = [ "cannot:${pacman}/bin/pacman-key" ];
85       # TODO: no good way to resolve mount/umount in Nix builds for now
86       # see https://github.com/abathur/resholve/issues/29
87       fix = {
88         mount = true;
89         umount = true;
90       };
92       keep = [
93         "$setup"
94         "$pid_unshare"
95         "$mount_unshare"
96         "${pacman}/bin/pacman"
97       ];
98     };
99   };
101   meta = with lib; {
102     description = "Useful scripts for installing Arch Linux";
103     longDescription = ''
104       A small suite of scripts aimed at automating some menial tasks when installing Arch Linux.
105     '';
106     homepage = "https://github.com/archlinux/arch-install-scripts";
107     license = licenses.gpl2Only;
108     maintainers = with maintainers; [ samlukeyes123 ];
109     platforms = platforms.linux;
110   };