[Nix-dev] Ad hoc vs. declarative package management

Spencer Whitt sw at swhitt.me
Sun May 17 22:33:13 CEST 2015


You want kde4.konsole, instead of simply konsole. configuration.nix
installs via attribute name rather than package name. In other words, it's
equivalent to using nix-env -iA, and not the same as using nix-env -i.

In general, nix-env -iA is preferred over nix-env -i anyway. It's faster
and less ambiguous. The nix-env -i feature mainly exists for historical
reasons.

To find package's attribute names, you can use nix-env -qaP. the -P
argument tells nix-env to print the attribute names.

On Sun, May 17, 2015 at 4:20 PM, Amy de Buitléir <amy at nualeargais.ie> wrote:

> I'm curious to understand why this works just fine (as a user)...
>
>     nix-env -i xev
>     nix-env -i konsole
>
> ...but if I put those packages in /etc/nixos/configuration.nix...
>
>   environment.systemPackages = with pkgs; [
>     cabal2nix
>     dmenu2
>     dzen2
>     gnumake
>     haskellngPackages.xmonad
>     haskellngPackages.xmonad-contrib
>     haskellngPackages.xmonad-extras
>     haskellngPackages.ghc
>     haskellngPackages.cabal-install
>     konsole # causes an error
>     gitAndTools.gitFull
>     meld
>     unison
>     unzip
>     wget
>     xev # causes an error
>     xsel
>   ];
>
> ... I get errors (see below). Is this a bug, or are there some limitations
> on which packages I can install declaratively?
>
> [amy at wombat9000:~/Downloads]$ sudo nixos-rebuild switch
> building Nix...
> building the system configuration...
> error: undefined variable ‘konsole’ at "/etc/nixos/configuration.nix":47:5
> (use ‘--show-trace’ to show detailed location information)
>
>
> [amy at wombat9000:~/Downloads]$ sudo nixos-rebuild switch
> building Nix...
> building the system configuration...
> error: undefined variable ‘xev’ at "/etc/nixos/configuration.nix":53:5
> (use ‘--show-trace’ to show detailed location information)
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150517/dccb20f3/attachment.html 


More information about the nix-dev mailing list