[Nix-dev] rm -fr /nix/store/foo ? if foo is a dep its not rebuilt?

Marc Weber marco-oweber at gmx.de
Sat Feb 28 01:32:10 CET 2009


I'v noticed that if you have a dependency chain such as
A -> B -> C and you do rm -fr /nix/store/*-B and nix-store --verify
nix-store notes that the path is missing.

But you nix won't rebuild B when you realise C?
Have I missed something ?

I've used something simple like this in my ~/.nixpkgs/config.nix:

{
  packageOverrides = pkgs : with pkgs;
    let
       foo = name : deps : stdenv.mkDerivation {
          name = "test-${name}";
          phases = "buildPhase";
          buildPhase = ''
            set -x
            ensureDir $out;
            for i in ${builtins.toString deps}; do
              echo $i > $out/foo
            done
          '';
        };
    in rec  {
      A = foo "A" [];
      B = foo "B" [A];
      C = foo "C" [B];
    }
}



More information about the nix-dev mailing list