1
0
Fork 0

Add exception for system rebuild with copied configuration.

This commit is contained in:
Kevin Baensch 2019-04-18 09:14:39 +02:00
parent db56b42c52
commit f0802397b9
1 changed files with 5 additions and 7 deletions

View File

@ -4,17 +4,17 @@ with lib;
let
cfg = config.system.copySysConf;
copySysConf = pkgs.stdenv.mkDerivation rec {
srcPath = ../.;
cfgPath = ../.;
copySysConf = if (cfgPath == /etc/nixos) then pkgs.stdenv.mkDerivation rec {
name = "NixOS_Configuration-${version}";
version = commitIdFromGitRepo (srcPath + "/.git");
version = commitIdFromGitRepo (cfgPath + "/.git");
src = cleanSource srcPath;
src = cleanSource cfgPath;
installPhase = ''
cp -R ./. $out
'';
};
} else ../.;
in {
options.system.copySysConf = {
@ -33,8 +33,6 @@ in {
};
config = mkIf cfg.enable {
# probably don't need to add it to systemPackages
environment.systemPackages = [ copySysConf ];
nix = mkIf cfg.addToNixPath {
# Do not use lib.optionals as it would override the default nixPath
nixPath = [