From 73532c38559b7bad2f6ff31bdef0d283ec75b543 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 16 Jul 2012 11:27:59 -0400 Subject: [PATCH] Global replace /var/run/current-system -> /run/current-system --- modules/config/shells.nix | 1 + modules/config/system-path.nix | 6 +++--- modules/config/users-groups.nix | 2 +- modules/installer/cd-dvd/iso-image.nix | 2 +- modules/installer/cd-dvd/system-tarball.nix | 4 ++-- modules/misc/crashdump.nix | 6 +++--- modules/programs/bash/profile.sh | 6 +++--- modules/programs/shadow.nix | 2 +- modules/services/misc/disnix.nix | 2 +- modules/services/monitoring/systemhealth.nix | 4 ++-- modules/services/network-filesystems/drbd.nix | 2 +- modules/services/network-filesystems/samba.nix | 2 +- modules/services/networking/ssh/sshd.nix | 2 +- modules/services/scheduling/fcron.nix | 4 ++-- modules/services/ttys/mingetty.nix | 2 +- modules/services/x11/display-managers/kdm.nix | 2 +- modules/services/x11/xfs.conf | 2 +- modules/system/activation/activation-script.nix | 6 +++--- modules/system/activation/switch-to-configuration.sh | 2 +- modules/system/boot/stage-2-init.sh | 2 +- modules/tasks/kbd.nix | 2 +- 21 files changed, 32 insertions(+), 31 deletions(-) diff --git a/modules/config/shells.nix b/modules/config/shells.nix index 6286223752a..b0a946a8e6e 100644 --- a/modules/config/shells.nix +++ b/modules/config/shells.nix @@ -13,6 +13,7 @@ with pkgs.lib; { target = "shells"; source = pkgs.writeText "shells" '' + /run/current-system/sw/bin/bash /var/run/current-system/sw/bin/bash /bin/sh ''; diff --git a/modules/config/system-path.nix b/modules/config/system-path.nix index 9eab8dde473..38e5f076bcf 100644 --- a/modules/config/system-path.nix +++ b/modules/config/system-path.nix @@ -1,5 +1,5 @@ # This module defines the packages that appear in -# /var/run/current-system/sw. +# /run/current-system/sw. { config, pkgs, ... }: @@ -69,7 +69,7 @@ let example = "[ pkgs.icecat3 pkgs.thunderbird ]"; description = '' The set of packages that appear in - /var/run/current-system/sw. These packages are + /run/current-system/sw. These packages are automatically available to all users, and are automatically updated every time you rebuild the system configuration. (The latter is the main difference with @@ -84,7 +84,7 @@ let default = []; example = ["/"]; description = " - Lists directories to be symlinked in `/var/run/current-system/sw'. + Lists directories to be symlinked in `/run/current-system/sw'. "; }; }; diff --git a/modules/config/users-groups.nix b/modules/config/users-groups.nix index beb21734652..598d68eb91d 100644 --- a/modules/config/users-groups.nix +++ b/modules/config/users-groups.nix @@ -48,7 +48,7 @@ let shell = mkOption { type = with types; uniq string; - default = "/var/run/current-system/sw/sbin/nologin"; + default = "/run/current-system/sw/sbin/nologin"; description = "The path to the user's shell."; }; diff --git a/modules/installer/cd-dvd/iso-image.nix b/modules/installer/cd-dvd/iso-image.nix index 99628b33bab..c1094daa49f 100644 --- a/modules/installer/cd-dvd/iso-image.nix +++ b/modules/installer/cd-dvd/iso-image.nix @@ -312,7 +312,7 @@ in # nixos-rebuild also requires a "system" profile and an # /etc/NIXOS tag. touch /etc/NIXOS - ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system + ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system ''; # Add vfat support to the initrd to enable people to copy the diff --git a/modules/installer/cd-dvd/system-tarball.nix b/modules/installer/cd-dvd/system-tarball.nix index daffb94bc53..e0cbfd6e713 100644 --- a/modules/installer/cd-dvd/system-tarball.nix +++ b/modules/installer/cd-dvd/system-tarball.nix @@ -50,7 +50,7 @@ in # script and the top-level system configuration directory. tarball.storeContents = [ { object = config.system.build.toplevel; - symlink = "/var/run/current-system"; + symlink = "/run/current-system"; } ]; @@ -87,6 +87,6 @@ in # nixos-rebuild also requires a "system" profile and an # /etc/NIXOS tag. touch /etc/NIXOS - ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system + ${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system ''; } diff --git a/modules/misc/crashdump.nix b/modules/misc/crashdump.nix index fff459c9ab4..973abfd9327 100644 --- a/modules/misc/crashdump.nix +++ b/modules/misc/crashdump.nix @@ -48,9 +48,9 @@ in config = mkIf crashdump.enable { boot = { postBootCommands = '' - ${pkgs.kexectools}/sbin/kexec -p /var/run/current-system/kernel \ - --initrd=/var/run/current-system/initrd \ - --append="init=$(readlink -f /var/run/current-system/init) system=$(readlink -f /var/run/current-system) irqpoll maxcpus=1 reset_devices ${kernelParams}" --reset-vga --console-vga + ${pkgs.kexectools}/sbin/kexec -p /run/current-system/kernel \ + --initrd=/run/current-system/initrd \ + --append="init=$(readlink -f /run/current-system/init) system=$(readlink -f /run/current-system) irqpoll maxcpus=1 reset_devices ${kernelParams}" --reset-vga --console-vga ''; kernelParams = [ "crashkernel=64M" diff --git a/modules/programs/bash/profile.sh b/modules/programs/bash/profile.sh index 3da860388b1..1eef2a9e84a 100644 --- a/modules/programs/bash/profile.sh +++ b/modules/programs/bash/profile.sh @@ -12,8 +12,8 @@ __ETC_PROFILE_SOURCED=1 export __ETC_PROFILE_DONE=1 # Initialise a bunch of environment variables. -export LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive -export LD_LIBRARY_PATH=/var/run/opengl-driver/lib:/var/run/opengl-driver-32/lib # !!! only set if needed +export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive +export LD_LIBRARY_PATH=/run/opengl-driver/lib:/run/opengl-driver-32/lib # !!! only set if needed export NIXPKGS_CONFIG=/etc/nix/nixpkgs-config.nix export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs:nixos=/etc/nixos/nixos:nixos-config=/etc/nixos/configuration.nix:services=/etc/nixos/services export PAGER="less -R" @@ -22,7 +22,7 @@ export LOCATE_PATH=/var/cache/locatedb # Include the various profiles in the appropriate environment variables. export NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER -export NIX_PROFILES="/var/run/current-system/sw /nix/var/nix/profiles/default $HOME/.nix-profile" +export NIX_PROFILES="/run/current-system/sw /nix/var/nix/profiles/default $HOME/.nix-profile" unset PATH INFOPATH PKG_CONFIG_PATH PERL5LIB ALSA_PLUGIN_DIRS GST_PLUGIN_PATH KDEDIRS unset QT_PLUGIN_PATH QTWEBKIT_PLUGIN_PATH STRIGI_PLUGIN_PATH XDG_CONFIG_DIRS XDG_DATA_DIRS diff --git a/modules/programs/shadow.nix b/modules/programs/shadow.nix index 869f4f85fb4..137064bba85 100644 --- a/modules/programs/shadow.nix +++ b/modules/programs/shadow.nix @@ -38,7 +38,7 @@ in options = { users.defaultUserShell = pkgs.lib.mkOption { - default = "/var/run/current-system/sw/bin/bash"; + default = "/run/current-system/sw/bin/bash"; description = '' This option defines the default shell assigned to user accounts. This must not be a store path, since the path is diff --git a/modules/services/misc/disnix.nix b/modules/services/misc/disnix.nix index 645e92c39df..8d04c81ad68 100644 --- a/modules/services/misc/disnix.nix +++ b/modules/services/misc/disnix.nix @@ -130,7 +130,7 @@ in script = '' - export PATH=/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin + export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin export HOME=/root ${pkgs.disnix}/bin/disnix-service --activation-modules-dir=${disnix_activation_scripts}/libexec/disnix/activation-scripts diff --git a/modules/services/monitoring/systemhealth.nix b/modules/services/monitoring/systemhealth.nix index 71389be5b2f..0a3e666ad4e 100644 --- a/modules/services/monitoring/systemhealth.nix +++ b/modules/services/monitoring/systemhealth.nix @@ -86,8 +86,8 @@ in [paths] rrdtool = ${pkgs.rrdtool}/bin/rrdtool loadavg_rrd = loadavg - ps = /var/run/current-system/sw/bin/ps - df = /var/run/current-system/sw/bin/df + ps = /run/current-system/sw/bin/ps + df = /run/current-system/sw/bin/df meminfo_rrd = meminfo uptime_rrd = uptime rrd_path = ${rrdDir} diff --git a/modules/services/network-filesystems/drbd.nix b/modules/services/network-filesystems/drbd.nix index 1c70d44f6ba..1a00ccab0a6 100644 --- a/modules/services/network-filesystems/drbd.nix +++ b/modules/services/network-filesystems/drbd.nix @@ -44,7 +44,7 @@ let cfg = config.services.drbd; in boot.extraModprobeConfig = '' - options drbd usermode_helper=/var/run/current-system/sw/sbin/drbdadm + options drbd usermode_helper=/run/current-system/sw/sbin/drbdadm ''; environment.etc = singleton diff --git a/modules/services/network-filesystems/samba.nix b/modules/services/network-filesystems/samba.nix index 7461d12d78b..2cf4e8c11ff 100644 --- a/modules/services/network-filesystems/samba.nix +++ b/modules/services/network-filesystems/samba.nix @@ -70,7 +70,7 @@ let environment = { LD_LIBRARY_PATH = nssModulesPath; TZ = config.time.timeZone; - LOCALE_ARCHIVE = "/var/run/current-system/sw/lib/locale/locale-archive"; + LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }; daemonType = "fork"; diff --git a/modules/services/networking/ssh/sshd.nix b/modules/services/networking/ssh/sshd.nix index 6791a6b3ea8..ea60e591c14 100644 --- a/modules/services/networking/ssh/sshd.nix +++ b/modules/services/networking/ssh/sshd.nix @@ -323,7 +323,7 @@ in environment = { LD_LIBRARY_PATH = nssModulesPath; # Duplicated from bashrc. OpenSSH needs a patch for this. - LOCALE_ARCHIVE = "/var/run/current-system/sw/lib/locale/locale-archive"; + LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }; path = [ pkgs.openssh pkgs.gnused ]; diff --git a/modules/services/scheduling/fcron.nix b/modules/services/scheduling/fcron.nix index 6d274bf5973..812af1edfc0 100644 --- a/modules/services/scheduling/fcron.nix +++ b/modules/services/scheduling/fcron.nix @@ -87,7 +87,7 @@ in fcrondeny = /etc/fcron.deny shell = /bin/sh sendmail = /var/setuid-wrappers/sendmail - editor = /var/run/current-system/sw/bin/vi + editor = /run/current-system/sw/bin/vi ''; target = "fcron.conf"; mode = "0600"; # max allowed is 644 @@ -104,7 +104,7 @@ in startOn = "startup and filesystem"; environment = - { PATH = "/var/run/current-system/sw/bin"; + { PATH = "/run/current-system/sw/bin"; }; preStart = diff --git a/modules/services/ttys/mingetty.nix b/modules/services/ttys/mingetty.nix index 85db3f8966e..e5dbc07aeb0 100644 --- a/modules/services/ttys/mingetty.nix +++ b/modules/services/ttys/mingetty.nix @@ -69,7 +69,7 @@ with pkgs.lib; exec = "mingetty --loginprog=${pkgs.shadow}/bin/login --noclear ${tty}"; - environment.LOCALE_ARCHIVE = "/var/run/current-system/sw/lib/locale/locale-archive"; + environment.LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }) config.services.mingetty.ttys); diff --git a/modules/services/x11/display-managers/kdm.nix b/modules/services/x11/display-managers/kdm.nix index fe7802100b2..838a4ed9033 100644 --- a/modules/services/x11/display-managers/kdm.nix +++ b/modules/services/x11/display-managers/kdm.nix @@ -106,7 +106,7 @@ in mkdir -m 0755 -p /var/lib/kdm chown kdm /var/lib/kdm ${(optionalString (config.system.boot.loader.id == "grub") "PATH=${config.system.build.grub}/sbin:$PATH ") + - "KDEDIRS=/var/run/current-system/sw exec ${kdebase_workspace}/bin/kdm -config ${kdmrc} -nodaemon"} + "KDEDIRS=/run/current-system/sw exec ${kdebase_workspace}/bin/kdm -config ${kdmrc} -nodaemon"} ''; logsXsession = true; }; diff --git a/modules/services/x11/xfs.conf b/modules/services/x11/xfs.conf index 5352d74faa0..13dcf803db2 100644 --- a/modules/services/x11/xfs.conf +++ b/modules/services/x11/xfs.conf @@ -12,4 +12,4 @@ default-resolutions = 75,75,100,100 cache-hi-mark = 2048 cache-low-mark = 1433 cache-balance = 70 -catalogue = /var/run/current-system/sw/share/X11-fonts/ +catalogue = /run/current-system/sw/share/X11-fonts/ diff --git a/modules/system/activation/activation-script.nix b/modules/system/activation/activation-script.nix index 083e3767ed8..41c3ced1bc2 100644 --- a/modules/system/activation/activation-script.nix +++ b/modules/system/activation/activation-script.nix @@ -74,12 +74,12 @@ in # Make this configuration the current configuration. # The readlink is there to ensure that when $systemConfig = /system - # (which is a symlink to the store), /var/run/current-system is still + # (which is a symlink to the store), /run/current-system is still # used as a garbage collection root. - ln -sfn "$(readlink -f "$systemConfig")" /var/run/current-system + ln -sfn "$(readlink -f "$systemConfig")" /run/current-system # Prevent the current configuration from being garbage-collected. - ln -sfn /var/run/current-system /nix/var/nix/gcroots/current-system + ln -sfn /run/current-system /nix/var/nix/gcroots/current-system ''; }; diff --git a/modules/system/activation/switch-to-configuration.sh b/modules/system/activation/switch-to-configuration.sh index da1471cf550..62af63ec39f 100644 --- a/modules/system/activation/switch-to-configuration.sh +++ b/modules/system/activation/switch-to-configuration.sh @@ -59,7 +59,7 @@ fi # Activate the new configuration. if [ "$action" != switch -a "$action" != test ]; then exit 0; fi -oldVersion=$(cat /var/run/current-system/upstart-interface-version 2> /dev/null || echo 0) +oldVersion=$(cat /run/current-system/upstart-interface-version 2> /dev/null || echo 0) newVersion=$(cat @out@/upstart-interface-version 2> /dev/null || echo 0) if test "$oldVersion" -ne "$newVersion"; then diff --git a/modules/system/boot/stage-2-init.sh b/modules/system/boot/stage-2-init.sh index c252b221dfb..51f7bbe8f72 100644 --- a/modules/system/boot/stage-2-init.sh +++ b/modules/system/boot/stage-2-init.sh @@ -189,4 +189,4 @@ fi # Start Upstart's init. echo "starting Upstart..." -PATH=/var/run/current-system/upstart/sbin exec init --no-sessions ${debug2:+--verbose} +PATH=/run/current-system/upstart/sbin exec init --no-sessions ${debug2:+--verbose} diff --git a/modules/tasks/kbd.nix b/modules/tasks/kbd.nix index 62c4b92ed09..d9e820ef9e7 100644 --- a/modules/tasks/kbd.nix +++ b/modules/tasks/kbd.nix @@ -65,7 +65,7 @@ in script = '' export LANG=${defaultLocale} - export LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive + export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive export PATH=${pkgs.gzip}/bin:$PATH # Needed by setfont set +e # continue in case of errors