summary refs log tree commit diff
path: root/modules/system/activation/top-level.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-02 15:11:29 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-02 15:11:29 -0400
commit0fc68a3d1d2a03da543209f922e75d2fa0a55e28 (patch)
tree4ae923248a266914ea56d291eb5ebe6fd0f9d754 /modules/system/activation/top-level.nix
parentd4fec178fdddc8749c6b105a16f5fb9a6d9bfe89 (diff)
downloadnixpkgs-0fc68a3d1d2a03da543209f922e75d2fa0a55e28.tar
nixpkgs-0fc68a3d1d2a03da543209f922e75d2fa0a55e28.tar.gz
nixpkgs-0fc68a3d1d2a03da543209f922e75d2fa0a55e28.tar.bz2
nixpkgs-0fc68a3d1d2a03da543209f922e75d2fa0a55e28.tar.lz
nixpkgs-0fc68a3d1d2a03da543209f922e75d2fa0a55e28.tar.xz
nixpkgs-0fc68a3d1d2a03da543209f922e75d2fa0a55e28.tar.zst
nixpkgs-0fc68a3d1d2a03da543209f922e75d2fa0a55e28.zip
Rewrite switch-to-configuration in Perl
This will make it more efficient to do systemd dependency graph
processing (if necessary).
Diffstat (limited to 'modules/system/activation/top-level.nix')
-rw-r--r--modules/system/activation/top-level.nix20
1 files changed, 8 insertions, 12 deletions
diff --git a/modules/system/activation/top-level.nix b/modules/system/activation/top-level.nix
index 923b91ad269..d092fa1d086 100644
--- a/modules/system/activation/top-level.nix
+++ b/modules/system/activation/top-level.nix
@@ -114,7 +114,7 @@ let
 
       ln -s ${config.system.build.etc}/etc $out/etc
       ln -s ${config.system.path} $out/sw
-      ln -s ${pkgs.systemd} $out/systemd
+      ln -s "$systemd" $out/systemd
       ln -s ${config.hardware.firmware} $out/firmware
 
       echo -n "$kernelParams" > $out/kernel-params
@@ -130,7 +130,7 @@ let
       done
 
       mkdir $out/bin
-      substituteAll ${./switch-to-configuration.sh} $out/bin/switch-to-configuration
+      substituteAll ${./switch-to-configuration.pl} $out/bin/switch-to-configuration
       chmod +x $out/bin/switch-to-configuration
 
       ${config.system.extraSystemBuilderCmds}
@@ -146,6 +146,9 @@ let
     name = "nixos-${config.system.nixosVersion}";
     preferLocalBuild = true;
     buildCommand = systemBuilder;
+
+    inherit (pkgs) systemd;
+
     inherit children;
     kernelParams =
       config.boot.kernelParams ++ config.boot.extraKernelParams;
@@ -164,17 +167,10 @@ let
     # to the activation script.
     noRestartIfChanged = attrValues (mapAttrs (n: v: if v.restartIfChanged then [] else ["[${v.name}]=1"]) config.jobs);
 
-    # Most of these are needed by grub-install.
-    path =
-      [ pkgs.coreutils
-        pkgs.gnused
-        pkgs.gnugrep
-        pkgs.findutils
-        pkgs.diffutils
-        pkgs.systemd
-      ];
-
     configurationName = config.boot.loader.grub.configurationName;
+
+    # Needed by switch-to-configuration.
+    perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl";
   };