[Nix-dev] A bunch of patches to nixpkgs and questions

Marc Weber marco-oweber at gmx.de
Tue Jun 26 16:33:54 CEST 2012


> I've made a bunch of changes to nixpkgs that I would like to share.
I've just created two gist repositories (let's see how well it works. I
don't know whether github gives any guarantees - but people have local
copies anyway):

nixpkgs: https://gist.github.com/2995910 (upload still taking place)
nixos:   https://gist.github.com/2995911

Can you log into github, join the nixpkgs gist and push your changes?
Let's see how well this works. Then we can review it easily (or give
this gist idea a try)

Then write again with your branch name or hash.

See other thread.

> Now, the questions:
> * Is there a nice way to download a file, compute a hash, place the hash into the fetchurl nix-expression and to build it without redownloading the file again?

nix-prefetch-url comes closest. Because those files are fixed hash
derivations you can also use a local file file:///tmp/foo.tar.bz and
replace that with http:// without causing rebuilds (if you have a local
copy) - there may be better solutions

> * I saw something like "nix-env -iA haskellPackages.xmonad" somewhere, but it fails for me with
>   error: attribute `haskellPackages' in selection path `haskellPackages' not found

See "how to find the package I'm looking for" on wiki. If you use
channels you may need an attr prefix. Evetually ready a
.nix-profile/default.nix file or so may help (I don't use them currently
so I don't know)

> "nix-build -A haskellPackages.xmonad" works (I have default.nix in
> $HOME symlinked to nixpkgs). Why is that?
NIX_PATH env var or the like could cause that difference, maybe
default.nix is used by default (maybe use strace to find out whether
either one is using systemwide nixpkgs). I don't know exactly.

Marc Weber


More information about the nix-dev mailing list