diff --git a/default.nix b/default.nix index 09c9a1569d88..481202b75caf 100644 --- a/default.nix +++ b/default.nix @@ -4,7 +4,8 @@ let let env = builtins.getEnv "NIXOS_CONFIG"; in if env == "" then /etc/nixos/configuration.nix else env; - system = import system/system.nix {configuration = import configFileName;}; + system = import system/system.nix {configuration = import configFileName; + inherit configFileName; }; in diff --git a/system/system.nix b/system/system.nix index 9b655e0a4956..d159458701f1 100644 --- a/system/system.nix +++ b/system/system.nix @@ -1,6 +1,7 @@ { platform ? __currentSystem , stage2Init ? "" , configuration +, configFileName ? "" }: rec { @@ -246,7 +247,10 @@ rec { ++ pkgs.lib.optional (config.networking.defaultMailServer.directDelivery) pkgs.ssmtp ++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs) ++ (config.environment.extraPackages) pkgs - ++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir; + ++ pkgs.lib.optional (config.fonts.enableFontDir) fontDir + ++ pkgs.lib.optional (configFileName != "" ) + (pkgs.runCommand "configuration" {} '' mkdir -p $out/share && cp "${configFileName}" $out/share/configuration.nix '') + ; # We don't want to put all of `startPath' and `path' in $PATH, since