diff --git a/options/copySysConf.nix b/options/copySysConf.nix index f6db2b1..4deda0e 100644 --- a/options/copySysConf.nix +++ b/options/copySysConf.nix @@ -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 = [