···
echo -n ${config.system.nixos.versionSuffix} > $out/nixos/.version-suffix
echo ${config.system.nixos.versionSuffix} | sed -e s/pre// > $out/nixos/svn-revision
38
-
# Pin the nixpkgs flake in the installer to our cleaned up nixpkgs source.
39
-
# FIXME: this might be surprising and is really only needed for offline installations,
40
-
# see discussion in https://github.com/NixOS/nixpkgs/pull/204178#issuecomment-1336289021
41
-
nix.registry.nixpkgs.to = {
43
-
path = "${channelSources}/nixos";
37
+
options.system.installer.channel.enable = (lib.mkEnableOption "bundling NixOS/Nixpkgs channel in the installer") // { default = true; };
38
+
config = lib.mkIf config.system.installer.channel.enable {
39
+
# Pin the nixpkgs flake in the installer to our cleaned up nixpkgs source.
40
+
# FIXME: this might be surprising and is really only needed for offline installations,
41
+
# see discussion in https://github.com/NixOS/nixpkgs/pull/204178#issuecomment-1336289021
42
+
nix.registry.nixpkgs.to = {
44
+
path = "${channelSources}/nixos";
46
-
# Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required
47
-
# for nixos-install.
48
-
boot.postBootCommands = lib.mkAfter
50
-
if ! [ -e /var/lib/nixos/did-channel-init ]; then
51
-
echo "unpacking the NixOS/Nixpkgs sources..."
52
-
mkdir -p /nix/var/nix/profiles/per-user/root
53
-
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels \
54
-
-i ${channelSources} --quiet --option build-use-substitutes false \
55
-
${lib.optionalString config.boot.initrd.systemd.enable "--option sandbox false"} # There's an issue with pivot_root
56
-
mkdir -m 0700 -p /root/.nix-defexpr
57
-
ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels
58
-
mkdir -m 0755 -p /var/lib/nixos
59
-
touch /var/lib/nixos/did-channel-init
47
+
# Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required
48
+
# for nixos-install.
49
+
boot.postBootCommands = lib.mkAfter
51
+
if ! [ -e /var/lib/nixos/did-channel-init ]; then
52
+
echo "unpacking the NixOS/Nixpkgs sources..."
53
+
mkdir -p /nix/var/nix/profiles/per-user/root
54
+
${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels \
55
+
-i ${channelSources} --quiet --option build-use-substitutes false \
56
+
${lib.optionalString config.boot.initrd.systemd.enable "--option sandbox false"} # There's an issue with pivot_root
57
+
mkdir -m 0700 -p /root/.nix-defexpr
58
+
ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels
59
+
mkdir -m 0755 -p /var/lib/nixos
60
+
touch /var/lib/nixos/did-channel-init