installation-cd-base.nix: Use boot.kernel.sysctl
This commit is contained in:
parent
7f7e18cfce
commit
d99fce2631
@ -42,26 +42,24 @@ in
|
|||||||
|
|
||||||
isoImage.volumeID = "NIXOS_${config.system.nixosVersion}";
|
isoImage.volumeID = "NIXOS_${config.system.nixosVersion}";
|
||||||
|
|
||||||
boot.postBootCommands =
|
# Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required
|
||||||
|
# for nixos-install.
|
||||||
|
boot.postBootCommands = optionalString includeSources
|
||||||
''
|
''
|
||||||
# Provide the NixOS/Nixpkgs sources in /etc/nixos. This is required
|
echo "unpacking the NixOS/Nixpkgs sources..."
|
||||||
# for nixos-install.
|
mkdir -p /nix/var/nix/profiles/per-user/root
|
||||||
${optionalString includeSources ''
|
${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels -i ${channelSources} --quiet
|
||||||
echo "unpacking the NixOS/Nixpkgs sources..."
|
mkdir -m 0700 -p /root/.nix-defexpr
|
||||||
mkdir -p /nix/var/nix/profiles/per-user/root
|
ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels
|
||||||
${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels -i ${channelSources} --quiet
|
|
||||||
mkdir -m 0700 -p /root/.nix-defexpr
|
|
||||||
ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels
|
|
||||||
''}
|
|
||||||
|
|
||||||
# Make the installer more likely to succeed in low memory
|
|
||||||
# environments. The kernel's overcommit heustistics bite us
|
|
||||||
# fairly often, preventing processes such as nix-worker or
|
|
||||||
# download-using-manifests.pl from forking even if there is
|
|
||||||
# plenty of free memory.
|
|
||||||
echo 1 > /proc/sys/vm/overcommit_memory
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Make the installer more likely to succeed in low memory
|
||||||
|
# environments. The kernel's overcommit heustistics bite us
|
||||||
|
# fairly often, preventing processes such as nix-worker or
|
||||||
|
# download-using-manifests.pl from forking even if there is
|
||||||
|
# plenty of free memory.
|
||||||
|
boot.kernel.sysctl."vm.overcommit_memory" = "1";
|
||||||
|
|
||||||
# To speed up installation a little bit, include the complete stdenv
|
# To speed up installation a little bit, include the complete stdenv
|
||||||
# in the Nix store on the CD.
|
# in the Nix store on the CD.
|
||||||
isoImage.storeContents = [ pkgs.stdenv pkgs.busybox ];
|
isoImage.storeContents = [ pkgs.stdenv pkgs.busybox ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user