[Nix-dev] Rebuild a derivation

laverne lists-laverne at schrock.email
Thu Dec 22 00:26:29 CET 2016


Suppose that I have a clone of https://github.com/NixOS/nixpkgs in /alt/nixpkgs. Also suppose that package foo is installed via /etc/nixos/configuration.nix 

I make a change to package foo, commit it, and then run `sudo nixos-rebuild switch -I nixpkgs=/alt/nixpkgs`. Then I realize that I wanted to make sure that foo builds properly when nix.useSandbox=true, so I add it to configuration.nix and re-run `sudo nixos-rebuild switch -I nixpkgs=/alt/nixpkgs`. Of course, since foo is already built, this has no effect. 

Is there any way to "force a rebuild" of the derivation/package without deleting all the profiles that reference it, running garbage collection, and then re-installing the package?

Thanks,
Laverne




More information about the nix-dev mailing list