[Nix-dev] Re: reason for changing default of system.copySystemConfiguration to false

Yury G. Kudryashov urkud+nix at ya.ru
Fri Apr 30 10:29:31 CEST 2010


Marc Weber wrote:

> 
> Minimal test case illustrating the issue:
> let pkgs = import /etc/nixos/nixpkgs {};
> in
> pkgs.stdenv.mkDerivation {
>   name = "test";
>   unpackPhase = ''for x in config{1,2,3}; do echo $x ''${!x}; done; exit
>   1''; config1 = /etc/.. + (builtins.substring 1 9999 (pkgs.lib.maybeEnv
>   "NIXOS_CONFIG" "/etc/nixos/configuration.nix")); config2 =
>   pkgs.lib.maybeEnv "NIXOS_CONFIG" "/etc/nixos/configuration.nix"; config3
>   = builtins.toPath (pkgs.lib.maybeEnv "NIXOS_CONFIG"
>   "/etc/nixos/configuration.nix");
> }
More minimal example:

with (import /etc/nixos/nixpkgs {});

stdenv.mkDerivation {
  name = "test";
  unpackPhase = ''
    echo ${/etc/nixos/configuration.nix}
    echo ${builtins.toPath "/etc/nixos/configuration.nix"}
  '';
}
results in:
/nix/store/hash-configuration.nix
/etc/nixos/configuration.nix




More information about the nix-dev mailing list