nix

My NixOS configuration

Stars
2
Committers
1

My personal nix setup

I'm running NixOS.

Most of my installed programs, packages and configuration lives in .nix configuration files. I'm uploading these files here so they're persisted & when I'll need to set up a new machine, I can share configs and rebuild the environment I'm used to.

How to: System Updates

You wish it were easy. Maybe I'm just doing it wrong. Oh well, anyhow here we go:

I have a bunch of nix channels:

$ sudo nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz
nix-ld https://github.com/Mic92/nix-ld/archive/main.tar.gz
nixos https://channels.nixos.org/nixos-23.11
nixos-hardware https://github.com/NixOS/nixos-hardware/archive/master.tar.gz
nixos-unstable https://nixos.org/channels/nixos-unstable

They need to be set to the newest versions:

$ sudo nix-channel --add https://channels.nixos.org/nixos-24.05 nixos
$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager

And we can update them & the rest while we're at it:

$ sudo nix-channel --update
this derivation will be built:
  /nix/store/1zr4pzspghlzlx2d8839g391khy83yv6-home-manager-24.05.tar.gz.drv
building '/nix/store/1zr4pzspghlzlx2d8839g391khy83yv6-home-manager-24.05.tar.gz.drv'...
unpacking channels...

And let's do this for non-sudo as well:

$ nix-channel --list
nixos https://channels.nixos.org/nixos-23.11
$ nix-channel --add https://channels.nixos.org/nixos-24.05 nixos
$ nix-channel --update
unpacking channels...

Sweet. Now I can rebuild my system:

$ sudo nixos-rebuild switch --upgrade # not sure if that upgrade is needed or not

(At some point I also updated the hardware-configuration.nix via nixos-generate-config and playing around with the symlinks so it actually runs through. That may or may not be necessary the next time, too.)

Now pray that it works & reboot 8-)