imported>Raboof
some notes on how I use nix
 
imported>Raboof
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
= whoami =
= whoami =


Hi! I'm [https://arnout.engelen.eu Arnout Engelen] and I've been using NixOS since october 2019. I'm keeping some notes here about how I use NixOS that work for me but about which I'm not completely confident yet that they should go into the upstream docs. If you see anything you'd like to discuss further, feel free to get in touch!
Hi! I'm [https://arnout.engelen.eu Arnout Engelen] and I've been a NixOS contributor since 2019 and committer since 2021. I'm keeping some notes here about how I use NixOS that work for me but about which I'm not completely confident yet that they should go into the upstream docs. If you see anything you'd like to discuss further, feel free to get in touch!


== Why NixOS ==
== Why NixOS ==
Line 24: Line 24:


== Notes ==
== Notes ==
=== flakes ===
I see advantages of flakes: having the split between flake.nix describing 'abstractly' what version you want to run, and the flake.lock describing the *actual* version you're running right now, is helpful. Also the new structure provides some opportunities for caching.
It does introduce some dilemmas: checking in flake.lock seems rather restrictive on downstream users, and will be likely to cause merge conflicts when you collaborate using forks.
Also, I really like working from a local nixpkgs checkout, but that is not very well-supported by flakes yet: it copies it to the nix store each time, which takes a lot of disk space and is slow. Work on this is underway at https://github.com/NixOS/nix/pull/6530 but seems to be stalled.


=== /etc/nixos/configuration.nix vs nix-env ===
=== /etc/nixos/configuration.nix vs nix-env ===
Line 92: Line 100:


If you also want to use a more complicated shell.nix setup, such as for android (https://discourse.nixos.org/t/building-an-android-app/5043), I'm not sure how to achieve this. I cheated and just created a /lib64/ld-linux-x86-64.so.2...
If you also want to use a more complicated shell.nix setup, such as for android (https://discourse.nixos.org/t/building-an-android-app/5043), I'm not sure how to achieve this. I cheated and just created a /lib64/ld-linux-x86-64.so.2...
=== running nixos-unstable ===
I've been running nixos-unstable from the beginning, and this has been a great experience. Being able to roll back and forth in case of trouble has worked out fine, and allowed me to test with newer versions/patches without interfering with regular work.
Overall upgrading is fast because binaries can be loaded from hydra, with the exception of graalvm.
==== building graalvm ====
building graalvm needs some extra swap on my (32g) machine:
    dd if=/dev/zero of=swapfile count=4096 bs=1MiB
    mkswap swapfile
    swapon swapfile
If I understand correctly there is good progress on getting this to compile on hydra again underway in https://github.com/NixOS/nixpkgs/pull/86244 which depends on https://github.com/NixOS/nixpkgs/pull/85902
=== codium ===
Loading extensions as documented at [[VSCodium]] seems to have stopped working recently, now on 467ce5a9f45aaf96110b41eb863a56866e1c2c3c . Time to bisect.
=== sweethome3d ===
* depends on p7zip which has been marked insecure
* https://discourse.nixos.org/t/glx-not-recognised-after-mesa-update/6753/5