Skip to content

573/nix-config-1

 
 

Repository files navigation

Nix Configurations

This is my humble flakes-only collection of all and everything needed to set up and maintain all my nixified devices.

Features

Supported configurations

  • NixOS-managed
    • DANIELKNB1 (private laptop, WSL2)
    • twopi (Raspberry Pi)
  • home-manager-managed
    • maiziedemacchiato with Arch Linux (private laptop)
  • nix-on-droid-managed
    • sams9

See flake.nix for more information like system.

First installation

If any of these systems need to be reinstalled, you can run:

$ nix run \
  github:573/nix-config-1/wsl2#setup

Note:

  • NixOS-managed systems should be set up like written in the NixOS manual. nix build ".#installer-image" can be used for latest kernel, helpful default config and some pre-installed utilities.

Manual instructions for some systems

Arch Linux

# install nix setup
sh <(curl -L https://nixos.org/nix/install) --no-channel-add --no-modify-profile
. ~/.nix-profile/etc/profile.d/nix.sh
nix run \
  --extra-experimental-features "nix-command flakes" \
  github:573/nix-config-1/wsl2#setup

Raspberry Pi

  1. Build image
    nix build ".#rpi-image"
  2. Copy (dd) result/sd-image/*.img to sd-card
  3. Inject sd-card in raspberry and boot
  4. When booted in the new NixOS system, login as tobias and run setup script
Update firmware

Firmware of Raspberry Pi needs to be updated manually on a regular basis with the following steps:

  1. Build firmware
    nix build ".#rpi-firmware"
  2. Mount /dev/disk/by-label/FIRMWARE
  3. Create backup of all files
  4. Copy result/* to firmware partition (ensure that old ones are deleted)
  5. Unmount and reboot
Update flake.lock

Go to update-flake-lock. There Use workflow from | Branch: master. When action is finished go to Pull requests, choose the latest Update flake.lock and use the Rebase and merge (The 1 commit from this branch will be rebased and added to the base branch.) approach.

Troubleshoot
emacs (all archs)

When emacs is modified i. e. packages are changed, there may occur discrepancies i. e. packages missing being noticed at runtime which often is related to so first check the flake input emacs-overlay, might refer to a dated version. Also when updating emacs the aarch64-linux variant needs to be remote-built or binfmt-built and pushed to a cache as its build causes an OOM killer on certain devices.

nix-on-droid

Observe the recommendations on n-o-ds page for device settings (or directly here).

NixOS-WSL

Important

Somehow I managed to downgrade WSL while trying to make usbip-win and/or wslg working. Extremely unadvisable, took me one and a half day of unneccessary tweaking on wrong ends to figure the real cause of error: getting attributes of path '/run/binfmt': No such file or directory when trying a nixos-rebuild days or weeks after that mistake. as well as other very weird behaviours (it is still a VM let's not forget about that). tl;dr after upgrading again to v2.2.4 (latest by that time) all issues where set. Baseline info here.

About

A collection of my system configs and dotfiles

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Nix 79.7%
  • Lua 8.2%
  • Emacs Lisp 5.5%
  • Shell 4.8%
  • Ruby 1.8%