Add exception for system rebuild with copied configuration.
This commit is contained in:
parent
db56b42c52
commit
f0802397b9
1 changed files with 5 additions and 7 deletions
|
@ -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 = [
|
||||
|
|
Loading…
Reference in a new issue