Nixos config for my machines using flakes.
Honest to God I cannot tell you how it works (as per usual with nix or nixos). I coded it while being possessed so here it is. Probably it is usable.
To install this flake from an installation iso, first enter a sudo mode and then create a Nix shell with dependencies:
$ sudo -i
# nix-shell -p git nixVersions.latestThis is required since git isn’t a hard dependency, and flakes only available in latest nix.
Then, partition according to the NixOS manual.
In this nixconfig, there is an option to create and automatically link directories from /storage to /home/user, so it might be usefull to mount / to hdd and home directory to ssd.
After that, mount disks and run the actual installation:
# mount /dev/disk/by-label/nixos /mnt
# mkdir -p /mnt/boot
# mount /dev/disk/by-label/boot /mnt/boot
# nixos-install --root /mnt --flake .#hostname|
Note
|
.#hostname should be a valid host in hosts/.
|
To add a new host, first you need to create a host dir in hosts/, and then generate a hadrware config:
# mkdir hosts/myhost
# nixos-generate-config --root /mnt --show-hardware-config > hosts/myhost/hardware.nixHardware config must be named hardware.nix. Then add or copy a system.nix file and config a new host system.
|
Note
|
Be sure to check out nixos-hardware for more info about specific hardware ! |
Background management is made with background command (which is a shortcut to setroot --store). Why though ? Eh.
To see available options and usage, consult man setroot (but since setroot is not included in environemnt packanges: nix shell nixpkgs#setroot -c "man setroot").
In general, you just want to simply set background pictures:
$ background pictures/wallpapers/left-monitor-picture.png \
pictures/wallpapers/right-monitor-picture.pngEvery run of background command is saved so it would be restored at the next system start (via onStartupScript).