mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-09 20:16:16 +03:00
Reverting revisions 30103-30106: "always set nixpkgs.config.{state,store}Dir", etc.
After the change from revision 30103, nixos-rebuild suddenly consumed freaky amounts of memory. I had to abort the process after it had allocated well in excess of 30GB(!) of RAM. I'm not sure what is causing this behavior, but undoing that assignment fixes the problem. The other two commits needed to be revoked, too, because they depend on 30103. svn path=/nixos/trunk/; revision=30127
This commit is contained in:
parent
fe045dc949
commit
20b364f4de
25 changed files with 77 additions and 80 deletions
|
@ -50,8 +50,8 @@ let
|
||||||
"~/.nix-profile/lib/X11/fonts"
|
"~/.nix-profile/lib/X11/fonts"
|
||||||
"~/.nix-profile/share/fonts"
|
"~/.nix-profile/share/fonts"
|
||||||
# - the default profile
|
# - the default profile
|
||||||
"${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/lib/X11/fonts"
|
"/nix/var/nix/profiles/default/lib/X11/fonts"
|
||||||
"${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/share/fonts"
|
"/nix/var/nix/profiles/default/share/fonts"
|
||||||
];
|
];
|
||||||
description = "
|
description = "
|
||||||
List of primary font paths.
|
List of primary font paths.
|
||||||
|
|
|
@ -69,7 +69,7 @@ let
|
||||||
automatically updated every time you rebuild the system
|
automatically updated every time you rebuild the system
|
||||||
configuration. (The latter is the main difference with
|
configuration. (The latter is the main difference with
|
||||||
installing them in the default profile,
|
installing them in the default profile,
|
||||||
<filename>${config.nixpkgs.config.nix.stateDir}/nix/profiles/default</filename>.
|
<filename>/nix/var/nix/profiles/default</filename>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ in
|
||||||
[ { mountPoint = "/";
|
[ { mountPoint = "/";
|
||||||
device = "/dev/root";
|
device = "/dev/root";
|
||||||
}
|
}
|
||||||
{ mountPoint = "${config.nixpkgs.config.nix.storeDir}";
|
{ mountPoint = "/nix/store";
|
||||||
fsType = "squashfs";
|
fsType = "squashfs";
|
||||||
device = "/nix-store.squashfs";
|
device = "/nix-store.squashfs";
|
||||||
options = "loop";
|
options = "loop";
|
||||||
|
@ -169,7 +169,7 @@ in
|
||||||
boot.initrd.kernelModules = [ "loop" ];
|
boot.initrd.kernelModules = [ "loop" ];
|
||||||
|
|
||||||
# In stage 1, mount a tmpfs on top of / (the ISO image) and
|
# In stage 1, mount a tmpfs on top of / (the ISO image) and
|
||||||
# ${config.nixpkgs.config.nix.storeDir} (the squashfs image) to make this a live CD.
|
# /nix/store (the squashfs image) to make this a live CD.
|
||||||
boot.initrd.postMountCommands =
|
boot.initrd.postMountCommands =
|
||||||
''
|
''
|
||||||
mkdir /mnt-root-tmpfs
|
mkdir /mnt-root-tmpfs
|
||||||
|
@ -180,8 +180,8 @@ in
|
||||||
|
|
||||||
mkdir /mnt-store-tmpfs
|
mkdir /mnt-store-tmpfs
|
||||||
mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs
|
mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs
|
||||||
mkdir -p $targetRoot${config.nixpkgs.config.nix.storeDir}
|
mkdir -p $targetRoot/nix/store
|
||||||
mount -t aufs -o dirs=/mnt-store-tmpfs=rw:/mnt-root${config.nixpkgs.config.nix.storeDir}=ro none /mnt-root-union${config.nixpkgs.config.nix.storeDir}
|
mount -t aufs -o dirs=/mnt-store-tmpfs=rw:/mnt-root/nix/store=ro none /mnt-root-union/nix/store
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Closures to be copied to the Nix store on the CD, namely the init
|
# Closures to be copied to the Nix store on the CD, namely the init
|
||||||
|
@ -223,7 +223,7 @@ in
|
||||||
}
|
}
|
||||||
{ # Quick hack: need a mount point for the store.
|
{ # Quick hack: need a mount point for the store.
|
||||||
source = pkgs.runCommand "empty" {} "ensureDir $out";
|
source = pkgs.runCommand "empty" {} "ensureDir $out";
|
||||||
target = "${config.nixpkgs.config.nix.storeDir}";
|
target = "/nix/store";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -257,11 +257,11 @@ in
|
||||||
''
|
''
|
||||||
# After booting, register the contents of the Nix store on the
|
# After booting, register the contents of the Nix store on the
|
||||||
# CD in the Nix database in the tmpfs.
|
# CD in the Nix database in the tmpfs.
|
||||||
${config.environment.nix}/bin/nix-store --load-db < ${config.nixpkgs.config.nix.storeDir}/nix-path-registration
|
${config.environment.nix}/bin/nix-store --load-db < /nix/store/nix-path-registration
|
||||||
|
|
||||||
# nixos-rebuild also requires a "system" profile and an
|
# nixos-rebuild also requires a "system" profile and an
|
||||||
# /etc/NIXOS tag.
|
# /etc/NIXOS tag.
|
||||||
touch /etc/NIXOS
|
touch /etc/NIXOS
|
||||||
${config.environment.nix}/bin/nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set /var/run/current-system
|
${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,6 @@ in
|
||||||
# nixos-rebuild also requires a "system" profile and an
|
# nixos-rebuild also requires a "system" profile and an
|
||||||
# /etc/NIXOS tag.
|
# /etc/NIXOS tag.
|
||||||
touch /etc/NIXOS
|
touch /etc/NIXOS
|
||||||
${config.environment.nix}/bin/nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set /var/run/current-system
|
${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ let
|
||||||
default = false;
|
default = false;
|
||||||
description = "
|
description = "
|
||||||
Whether copy the necessary boot files into /boot, so
|
Whether copy the necessary boot files into /boot, so
|
||||||
${config.nixpkgs.config.nix.storeDir} is not needed by the boot loadear.
|
/nix/store is not needed by the boot loadear.
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,8 +22,8 @@ let
|
||||||
''
|
''
|
||||||
if [ "$rollback" != "$succeeded" ]
|
if [ "$rollback" != "$succeeded" ]
|
||||||
then
|
then
|
||||||
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --rollback
|
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback
|
||||||
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system/bin/switch-to-configuration switch
|
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch
|
||||||
|
|
||||||
rollback=$((rollback + 1))
|
rollback=$((rollback + 1))
|
||||||
fi
|
fi
|
||||||
|
@ -50,12 +50,12 @@ let
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
echo "=== activating system configuration on ${getAttr targetProperty (config.deployment)} ==="
|
echo "=== activating system configuration on ${getAttr targetProperty (config.deployment)} ==="
|
||||||
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set ${config.system.build.toplevel} ||
|
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --set ${config.system.build.toplevel} ||
|
||||||
(ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --rollback; rollbackSucceeded)
|
(ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback; rollbackSucceeded)
|
||||||
|
|
||||||
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system/bin/switch-to-configuration switch ||
|
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch ||
|
||||||
( ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --rollback
|
( ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} nix-env -p /nix/var/nix/profiles/system --rollback
|
||||||
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system/bin/switch-to-configuration switch
|
ssh $NIX_SSHOPTS ${getAttr targetProperty (config.deployment)} /nix/var/nix/profiles/system/bin/switch-to-configuration switch
|
||||||
rollbackSucceeded
|
rollbackSucceeded
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# - register validity
|
# - register validity
|
||||||
# - with a chroot to the target device:
|
# - with a chroot to the target device:
|
||||||
# * do a nix-pull
|
# * do a nix-pull
|
||||||
# * nix-env -p @stateDir@/nix/profiles/system -i <nix-expr for the configuration>
|
# * nix-env -p /nix/var/nix/profiles/system -i <nix-expr for the configuration>
|
||||||
# * run the activation script of the configuration (also installs Grub)
|
# * run the activation script of the configuration (also installs Grub)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -92,16 +92,16 @@ mkdir -m 0755 -p $mountPoint/var
|
||||||
# Create the necessary Nix directories on the target device, if they
|
# Create the necessary Nix directories on the target device, if they
|
||||||
# don't already exist.
|
# don't already exist.
|
||||||
mkdir -m 0755 -p \
|
mkdir -m 0755 -p \
|
||||||
$mountPoint@stateDir@/nix/gcroots \
|
$mountPoint/nix/var/nix/gcroots \
|
||||||
$mountPoint@stateDir@/nix/temproots \
|
$mountPoint/nix/var/nix/temproots \
|
||||||
$mountPoint@stateDir@/nix/manifests \
|
$mountPoint/nix/var/nix/manifests \
|
||||||
$mountPoint@stateDir@/nix/userpool \
|
$mountPoint/nix/var/nix/userpool \
|
||||||
$mountPoint@stateDir@/nix/profiles \
|
$mountPoint/nix/var/nix/profiles \
|
||||||
$mountPoint@stateDir@/nix/db \
|
$mountPoint/nix/var/nix/db \
|
||||||
$mountPoint@stateDir@/log/nix/drvs
|
$mountPoint/nix/var/log/nix/drvs
|
||||||
|
|
||||||
mkdir -m 1777 -p \
|
mkdir -m 1777 -p \
|
||||||
$mountPoint@storeDir@ \
|
$mountPoint/nix/store \
|
||||||
|
|
||||||
|
|
||||||
# Get the store paths to copy from the references graph.
|
# Get the store paths to copy from the references graph.
|
||||||
|
@ -112,7 +112,7 @@ storePaths=$(@perl@/bin/perl @pathsFromGraph@ @nixClosure@)
|
||||||
echo "copying Nix to $mountPoint...."
|
echo "copying Nix to $mountPoint...."
|
||||||
for i in $storePaths; do
|
for i in $storePaths; do
|
||||||
echo " $i"
|
echo " $i"
|
||||||
rsync -a $i $mountPoint@storeDir@/
|
rsync -a $i $mountPoint/nix/store/
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ fi
|
||||||
# it into the system configuration profile.
|
# it into the system configuration profile.
|
||||||
echo "building the system configuration..."
|
echo "building the system configuration..."
|
||||||
NIXPKGS=/mnt/etc/nixos/nixpkgs chroot $mountPoint @nix@/bin/nix-env \
|
NIXPKGS=/mnt/etc/nixos/nixpkgs chroot $mountPoint @nix@/bin/nix-env \
|
||||||
-p @stateDir@/nix/profiles/system \
|
-p /nix/var/nix/profiles/system \
|
||||||
-f "/mnt$NIXOS" \
|
-f "/mnt$NIXOS" \
|
||||||
--set -A system
|
--set -A system
|
||||||
|
|
||||||
|
@ -196,4 +196,4 @@ touch $mountPoint/etc/NIXOS
|
||||||
# configuration.
|
# configuration.
|
||||||
echo "finalising the installation..."
|
echo "finalising the installation..."
|
||||||
NIXOS_INSTALL_GRUB=1 chroot $mountPoint \
|
NIXOS_INSTALL_GRUB=1 chroot $mountPoint \
|
||||||
@stateDir@/nix/profiles/system/bin/switch-to-configuration boot
|
/nix/var/nix/profiles/system/bin/switch-to-configuration boot
|
||||||
|
|
|
@ -133,9 +133,9 @@ if test -n "$pullManifest"; then
|
||||||
manifests=$(nix-instantiate --eval-only --xml --strict $NIXOS -A manifests \
|
manifests=$(nix-instantiate --eval-only --xml --strict $NIXOS -A manifests \
|
||||||
| grep '<string' | sed 's^.*"\(.*\)".*^\1^g')
|
| grep '<string' | sed 's^.*"\(.*\)".*^\1^g')
|
||||||
|
|
||||||
mkdir -p @stateDir@/nix/channel-cache
|
mkdir -p /nix/var/nix/channel-cache
|
||||||
for i in $manifests; do
|
for i in $manifests; do
|
||||||
NIX_DOWNLOAD_CACHE=@stateDir@/nix/channel-cache nix-pull $i || true
|
NIX_DOWNLOAD_CACHE=/nix/var/nix/channel-cache nix-pull $i || true
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -162,8 +162,8 @@ fi
|
||||||
if test -z "$rollback"; then
|
if test -z "$rollback"; then
|
||||||
echo "building the system configuration..." >&2
|
echo "building the system configuration..." >&2
|
||||||
if test "$action" = switch -o "$action" = boot; then
|
if test "$action" = switch -o "$action" = boot; then
|
||||||
nix-env -p @stateDir@/nix/profiles/system -f $NIXOS --set -A system $extraBuildFlags
|
nix-env -p /nix/var/nix/profiles/system -f $NIXOS --set -A system $extraBuildFlags
|
||||||
pathToConfig=@stateDir@/nix/profiles/system
|
pathToConfig=/nix/var/nix/profiles/system
|
||||||
elif test "$action" = test -o "$action" = build -o "$action" = dry-run; then
|
elif test "$action" = test -o "$action" = build -o "$action" = dry-run; then
|
||||||
nix-build $NIXOS -A system -K -k $extraBuildFlags > /dev/null
|
nix-build $NIXOS -A system -K -k $extraBuildFlags > /dev/null
|
||||||
pathToConfig=./result
|
pathToConfig=./result
|
||||||
|
@ -178,14 +178,14 @@ if test -z "$rollback"; then
|
||||||
fi
|
fi
|
||||||
else # test -n "$rollback"
|
else # test -n "$rollback"
|
||||||
if test "$action" = switch -o "$action" = boot; then
|
if test "$action" = switch -o "$action" = boot; then
|
||||||
nix-env --rollback -p @stateDir@/nix/profiles/system
|
nix-env --rollback -p /nix/var/nix/profiles/system
|
||||||
pathToConfig=@stateDir@/nix/profiles/system
|
pathToConfig=/nix/var/nix/profiles/system
|
||||||
elif test "$action" = test -o "$action" = build; then
|
elif test "$action" = test -o "$action" = build; then
|
||||||
systemNumber=$(
|
systemNumber=$(
|
||||||
nix-env -p @stateDir@/nix/profiles/system --list-generations |
|
nix-env -p /nix/var/nix/profiles/system --list-generations |
|
||||||
sed -n '/current/ {g; p;}; s/ *\([0-9]*\).*/\1/; h'
|
sed -n '/current/ {g; p;}; s/ *\([0-9]*\).*/\1/; h'
|
||||||
)
|
)
|
||||||
ln -sT @stateDir@/nix/profiles/system-${systemNumber}-link ./result
|
ln -sT /nix/var/nix/profiles/system-${systemNumber}-link ./result
|
||||||
pathToConfig=./result
|
pathToConfig=./result
|
||||||
else
|
else
|
||||||
showSyntax
|
showSyntax
|
||||||
|
|
|
@ -10,7 +10,6 @@ let
|
||||||
makeProg = args: pkgs.substituteAll (args // {
|
makeProg = args: pkgs.substituteAll (args // {
|
||||||
dir = "bin";
|
dir = "bin";
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit (config.nixpkgs.config.nix) storeDir stateDir;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
nixosBuildVMS = makeProg {
|
nixosBuildVMS = makeProg {
|
||||||
|
|
|
@ -70,6 +70,4 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config.nixpkgs.config.nix = { storeDir = /nix/store; stateDir = /nix/var; };
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ in
|
||||||
if test -z "$source"; then
|
if test -z "$source"; then
|
||||||
# If we can't find the program, fall back to the
|
# If we can't find the program, fall back to the
|
||||||
# system profile.
|
# system profile.
|
||||||
source=${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/bin/${program}
|
source=/nix/var/nix/profiles/default/bin/${program}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp ${setuidWrapper}/bin/setuid-wrapper ${wrapperDir}/${program}
|
cp ${setuidWrapper}/bin/setuid-wrapper ${wrapperDir}/${program}
|
||||||
|
|
|
@ -308,26 +308,26 @@ in
|
||||||
# Set up Nix.
|
# Set up Nix.
|
||||||
mkdir -p /nix/etc/nix
|
mkdir -p /nix/etc/nix
|
||||||
ln -sfn /etc/nix.conf /nix/etc/nix/nix.conf
|
ln -sfn /etc/nix.conf /nix/etc/nix/nix.conf
|
||||||
chown root.nixbld ${config.nixpkgs.config.nix.storeDir}
|
chown root.nixbld /nix/store
|
||||||
chmod 1775 ${config.nixpkgs.config.nix.storeDir}
|
chmod 1775 /nix/store
|
||||||
|
|
||||||
# Nix initialisation.
|
# Nix initialisation.
|
||||||
mkdir -m 0755 -p \
|
mkdir -m 0755 -p \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/gcroots \
|
/nix/var/nix/gcroots \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/temproots \
|
/nix/var/nix/temproots \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/manifests \
|
/nix/var/nix/manifests \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/userpool \
|
/nix/var/nix/userpool \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/profiles \
|
/nix/var/nix/profiles \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/db \
|
/nix/var/nix/db \
|
||||||
${config.nixpkgs.config.nix.stateDir}/log/nix/drvs \
|
/nix/var/log/nix/drvs \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/channel-cache \
|
/nix/var/nix/channel-cache \
|
||||||
${config.nixpkgs.config.nix.stateDir}/nix/chroots
|
/nix/var/nix/chroots
|
||||||
mkdir -m 1777 -p ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/per-user
|
mkdir -m 1777 -p /nix/var/nix/gcroots/per-user
|
||||||
mkdir -m 1777 -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/per-user
|
mkdir -m 1777 -p /nix/var/nix/profiles/per-user
|
||||||
mkdir -m 1777 -p ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/tmp
|
mkdir -m 1777 -p /nix/var/nix/gcroots/tmp
|
||||||
|
|
||||||
ln -sf ${config.nixpkgs.config.nix.stateDir}/nix/profiles ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/
|
ln -sf /nix/var/nix/profiles /nix/var/nix/gcroots/
|
||||||
ln -sf ${config.nixpkgs.config.nix.stateDir}/nix/manifests ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/
|
ln -sf /nix/var/nix/manifests /nix/var/nix/gcroots/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ let
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
# This can be infered from the UPS model by looking at
|
# This can be infered from the UPS model by looking at
|
||||||
# ${config.nixpkgs.config.nix.storeDir}/nut/share/driver.list
|
# /nix/store/nut/share/driver.list
|
||||||
driver = mkOption {
|
driver = mkOption {
|
||||||
type = types.uniq types.string;
|
type = types.uniq types.string;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
@ -133,7 +133,7 @@ in
|
||||||
|
|
||||||
Additionally you can specify the up/ down scripts by setting
|
Additionally you can specify the up/ down scripts by setting
|
||||||
the up down properties.
|
the up down properties.
|
||||||
Config lines up=${config.nixpkgs.config.nix.storeDir}/xxx-up-script down=...
|
Config lines up=/nix/store/xxx-up-script down=...
|
||||||
will be appended to your configuration file automatically
|
will be appended to your configuration file automatically
|
||||||
|
|
||||||
If you define at least one of up/down "script-security 2" will be
|
If you define at least one of up/down "script-security 2" will be
|
||||||
|
|
|
@ -78,7 +78,7 @@ in
|
||||||
If non-null, override the default login shell with the
|
If non-null, override the default login shell with the
|
||||||
specified value.
|
specified value.
|
||||||
'';
|
'';
|
||||||
example = "${config.nixpkgs.config.nix.storeDir}/xyz-bash-10.0/bin/bash10";
|
example = "/nix/store/xyz-bash-10.0/bin/bash10";
|
||||||
};
|
};
|
||||||
|
|
||||||
srpKeyExchange = mkOption {
|
srpKeyExchange = mkOption {
|
||||||
|
|
|
@ -155,7 +155,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
services.dbus.packages =
|
services.dbus.packages =
|
||||||
[ "${config.nixpkgs.config.nix.stateDir}/nix/profiles/default"
|
[ "/nix/var/nix/profiles/default"
|
||||||
config.system.path
|
config.system.path
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ let
|
||||||
# But do allow access to files in the store so that we don't have
|
# But do allow access to files in the store so that we don't have
|
||||||
# to generate <Directory> clauses for every generated file that we
|
# to generate <Directory> clauses for every generated file that we
|
||||||
# want to serve.
|
# want to serve.
|
||||||
<Directory ${config.nixpkgs.config.nix.storeDir}>
|
<Directory /nix/store>
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
Allow from all
|
Allow from all
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
|
@ -45,11 +45,11 @@ in
|
||||||
|
|
||||||
deployDir = mkOption {
|
deployDir = mkOption {
|
||||||
description = "Location of the deployment files";
|
description = "Location of the deployment files";
|
||||||
default = "${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/server/default/deploy/";
|
default = "/nix/var/nix/profiles/default/server/default/deploy/";
|
||||||
};
|
};
|
||||||
|
|
||||||
libUrl = mkOption {
|
libUrl = mkOption {
|
||||||
default = "file://${config.nixpkgs.config.nix.stateDir}/nix/profiles/default/server/default/lib";
|
default = "file:///nix/var/nix/profiles/default/server/default/lib";
|
||||||
description = "Location where the shared library JARs are stored";
|
description = "Location where the shared library JARs are stored";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ in
|
||||||
ln -sfn "$(readlink -f "$systemConfig")" /var/run/current-system
|
ln -sfn "$(readlink -f "$systemConfig")" /var/run/current-system
|
||||||
|
|
||||||
# Prevent the current configuration from being garbage-collected.
|
# Prevent the current configuration from being garbage-collected.
|
||||||
ln -sfn /var/run/current-system ${config.nixpkgs.config.nix.stateDir}/nix/gcroots/current-system
|
ln -sfn /var/run/current-system /nix/var/nix/gcroots/current-system
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,7 @@ let
|
||||||
|
|
||||||
|
|
||||||
# The initrd only has to mount / or any FS marked as necessary for
|
# The initrd only has to mount / or any FS marked as necessary for
|
||||||
# booting (such as the FS containing ${config.nixpkgs.config.nix.storeDir}, or an FS needed for
|
# booting (such as the FS containing /nix/store, or an FS needed for
|
||||||
# mounting /, like / on a loopback).
|
# mounting /, like / on a loopback).
|
||||||
fileSystems = filter
|
fileSystems = filter
|
||||||
(fs: fs.mountPoint == "/" || fs.neededForBoot)
|
(fs: fs.mountPoint == "/" || fs.neededForBoot)
|
||||||
|
|
|
@ -10,7 +10,7 @@ let
|
||||||
environment.etc = mkOption {
|
environment.etc = mkOption {
|
||||||
default = [];
|
default = [];
|
||||||
example = [
|
example = [
|
||||||
{ source = "${config.nixpkgs.config.nix.storeDir}/.../etc/dir/file.conf.example";
|
{ source = "/nix/store/.../etc/dir/file.conf.example";
|
||||||
target = "dir/file.conf";
|
target = "dir/file.conf";
|
||||||
mode = "0440";
|
mode = "0440";
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ with pkgs.lib;
|
||||||
# (For instance, when applied to a bind-mount it
|
# (For instance, when applied to a bind-mount it
|
||||||
# unmounts the target of the bind-mount.) !!! But
|
# unmounts the target of the bind-mount.) !!! But
|
||||||
# we should use `-f' for NFS.
|
# we should use `-f' for NFS.
|
||||||
if [ "$mp" != / -a "$mp" != /nix -a "$mp" != ${config.nixpkgs.config.nix.storeDir} ]; then
|
if [ "$mp" != / -a "$mp" != /nix -a "$mp" != /nix/store ]; then
|
||||||
if umount -n "$mp"; then success=1; tryAgain=1; fi
|
if umount -n "$mp"; then success=1; tryAgain=1; fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,9 @@ with pkgs.lib;
|
||||||
# Copy all paths in the closure to the filesystem.
|
# Copy all paths in the closure to the filesystem.
|
||||||
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
|
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
|
||||||
|
|
||||||
mkdir -p /mnt${config.nixpkgs.config.nix.storeDir}
|
mkdir -p /mnt/nix/store
|
||||||
echo "copying everything (will take a while)..."
|
echo "copying everything (will take a while)..."
|
||||||
cp -prd $storePaths /mnt${config.nixpkgs.config.nix.storeDir}/
|
cp -prd $storePaths /mnt/nix/store/
|
||||||
|
|
||||||
# Register the paths in the Nix database.
|
# Register the paths in the Nix database.
|
||||||
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
|
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
|
||||||
|
@ -44,7 +44,7 @@ with pkgs.lib;
|
||||||
|
|
||||||
# Create the system profile to allow nixos-rebuild to work.
|
# Create the system profile to allow nixos-rebuild to work.
|
||||||
chroot /mnt ${config.environment.nix}/bin/nix-env \
|
chroot /mnt ${config.environment.nix}/bin/nix-env \
|
||||||
-p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set ${config.system.build.toplevel}
|
-p /nix/var/nix/profiles/system --set ${config.system.build.toplevel}
|
||||||
|
|
||||||
# `nixos-rebuild' requires an /etc/NIXOS.
|
# `nixos-rebuild' requires an /etc/NIXOS.
|
||||||
mkdir -p /mnt/etc
|
mkdir -p /mnt/etc
|
||||||
|
|
|
@ -41,8 +41,8 @@ with pkgs.lib;
|
||||||
# Copy all paths in the closure to the filesystem.
|
# Copy all paths in the closure to the filesystem.
|
||||||
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
|
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
|
||||||
|
|
||||||
mkdir -p /mnt${config.nixpkgs.config.nix.storeDir}
|
mkdir -p /mnt/nix/store
|
||||||
${pkgs.rsync}/bin/rsync -av $storePaths /mnt${config.nixpkgs.config.nix.storeDir}/
|
${pkgs.rsync}/bin/rsync -av $storePaths /mnt/nix/store/
|
||||||
|
|
||||||
# Register the paths in the Nix database.
|
# Register the paths in the Nix database.
|
||||||
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
|
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
|
||||||
|
@ -50,7 +50,7 @@ with pkgs.lib;
|
||||||
|
|
||||||
# Create the system profile to allow nixos-rebuild to work.
|
# Create the system profile to allow nixos-rebuild to work.
|
||||||
chroot /mnt ${config.environment.nix}/bin/nix-env \
|
chroot /mnt ${config.environment.nix}/bin/nix-env \
|
||||||
-p ${config.nixpkgs.config.nix.stateDir}/nix/profiles/system --set ${config.system.build.toplevel}
|
-p /nix/var/nix/profiles/system --set ${config.system.build.toplevel}
|
||||||
|
|
||||||
# `nixos-rebuild' requires an /etc/NIXOS.
|
# `nixos-rebuild' requires an /etc/NIXOS.
|
||||||
mkdir -p /mnt/etc
|
mkdir -p /mnt/etc
|
||||||
|
|
|
@ -222,7 +222,7 @@ let
|
||||||
|
|
||||||
# Install GRUB and generate the GRUB boot menu.
|
# Install GRUB and generate the GRUB boot menu.
|
||||||
touch /etc/NIXOS
|
touch /etc/NIXOS
|
||||||
mkdir -p ${config.nixpkgs.config.nix.stateDir}/nix/profiles
|
mkdir -p /nix/var/nix/profiles
|
||||||
${config.system.build.toplevel}/bin/switch-to-configuration boot
|
${config.system.build.toplevel}/bin/switch-to-configuration boot
|
||||||
|
|
||||||
umount /boot
|
umount /boot
|
||||||
|
@ -276,11 +276,11 @@ in
|
||||||
chmod 1777 $targetRoot/tmp
|
chmod 1777 $targetRoot/tmp
|
||||||
|
|
||||||
mkdir -p $targetRoot/boot
|
mkdir -p $targetRoot/boot
|
||||||
mount -o remount,ro $targetRoot${config.nixpkgs.config.nix.storeDir}
|
mount -o remount,ro $targetRoot/nix/store
|
||||||
${optionalString cfg.writableStore ''
|
${optionalString cfg.writableStore ''
|
||||||
mkdir /mnt-store-tmpfs
|
mkdir /mnt-store-tmpfs
|
||||||
mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs
|
mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs
|
||||||
mount -t aufs -o dirs=/mnt-store-tmpfs=rw:$targetRoot${config.nixpkgs.config.nix.storeDir}=rr none $targetRoot${config.nixpkgs.config.nix.storeDir}
|
mount -t aufs -o dirs=/mnt-store-tmpfs=rw:$targetRoot/nix/store=rr none $targetRoot/nix/store
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ in
|
||||||
[ { mountPoint = "/";
|
[ { mountPoint = "/";
|
||||||
device = "/dev/vda";
|
device = "/dev/vda";
|
||||||
}
|
}
|
||||||
{ mountPoint = "${config.nixpkgs.config.nix.storeDir}";
|
{ mountPoint = "/nix/store";
|
||||||
device = "//10.0.2.4/store";
|
device = "//10.0.2.4/store";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = "guest,sec=none,noperm,noacl";
|
options = "guest,sec=none,noperm,noacl";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue