[Nix-dev] Some NixOS beginner questions...

Ben Franksen ben.franksen at online.de
Mon Mar 31 00:22:19 CEST 2014


Kirill Elagin wrote:
> On Mon, Mar 31, 2014 at 1:01 AM, Ben Franksen
> <ben.franksen at online.de>wrote:
> 
>> (2) It seems impossible to install NixOS w/o installing the boot loader.
> 
> Hm,
> 
> boot.loader.grub.enable = false;

Nope, that's what I tried first, of course, nixos-install complains that you 
must enable it.

>> (3) I love the declarative approach to system configuration. However, for
>> a newcomer it is hard to find out how to configure his favorite packages.
>> What
>> options are there and how can I set them? Is looking at the 'sources'
>> (for the package's nix expressions) the only way?
> 
> Yes, I guess, looking at the expressions is the only option right now.
> You set them in `~/.nixpkgs/config.nix`. That's the file where your
> configuration options for
> packages and all your package overrides go.

OK, I'll bite this bullet then.

>> Related question: I tried to
>> put pkgs.kdepim into environment.systemPackages, which failed for no
>> apparent reason. Then I stumbled (really, by accident) over a nix snippet
>> where it said pkgs.kde4.<some-kde-subpackage> and indeed adding the .kde4
>> worked. How can I find out how packages are organised in the pkgs nix
>> expression?
> 
> You'll have to look it up in `pkgs/top-level/all-packages.nix`.
> Either clone the nixpkgs repository or you can find a copy at
> `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`.

Ok, thanks.

>> (4) How do I fix something if it is broken? Note I don't want to upgrade
>> my whole NixOS configuration to the unstable branch (as all the
>> documentation suggests), just make one or two fixes in certain packages
>> (e.g. the nedit package is currently broken, when starting the binary it
>> crashes with some X11 bad opcode error). I expected the nixpkgs
>> repository to have a 'stable' branch so I could check that out and work
>> from there but such a branch seems
>> not to exist. How else can I replace/fix/change the nix expression for a
>> single package, leaving the rest of the system as is?
>>
> 
> Actually, right now, using stable instead of unstable doesn't make any
> sense.

Why?

I gave NixOS a try in the past, and that (i.e. when I upgraded the nixpkgs 
to the current head of the repository) was always the point at which 
everything broke.

> That's how I modify packages:
> I have a clone of the nixpkgs repository and I modify expressions there.

Ok. But I /can/ use the stable branch, and make my changes there, right? I 
guess it makes sense to have the master branch lying around somewhere, too, 
for reference at least, so I can check if some fix has already been made 
there.

> Then I
> do `nix-env -i` (or whatever I need) with `-f
> <path_to_my_copy_of_nixpkgs>`. That tells Nix to use _my_ expressions. In
> case of `nixos-rebuild` there is `-I` flag.

As I said, I really like the declarative system configuration and therefore 
want to avoid ad-hoc installation using nix-env if possible. However, I 
guess I can adapt that approach to changing my configuration.nix and then 
doing a nixos-rebuild.

Cheers (& many thanks for answering my questions)
Ben
-- 
"Make it so they have to reboot after every typo." -- Scott Adams




More information about the nix-dev mailing list