My NixOS configuration
Find a file
defelo-renovate[bot] 6482119d71
chore(deps): lock file maintenance (#277)
Co-authored-by: defelo-renovate[bot] <186864790+defelo-renovate[bot]@users.noreply.github.com>
2025-05-12 04:35:16 +00:00
.github/workflows chore(deps): update determinatesystems/nix-installer-action action to v17 (#257) 2025-04-24 11:45:39 +00:00
home gammastep: adjust brightness-night 2025-05-08 21:24:58 +02:00
hosts/neon treefmt 2025-02-21 21:52:41 +01:00
scripts treefmt 2025-02-21 21:52:41 +01:00
secrets remove thunderbird 2025-05-07 14:31:29 +02:00
system wayland: fix xdg portal 2025-03-02 03:15:21 +01:00
wallpapers Remove wallpaper symlink 2023-08-16 10:47:47 +02:00
.gitattributes Reorganize zsh config 2023-07-28 16:10:32 +02:00
.sops.yaml treefmt 2025-02-21 21:52:41 +01:00
fetch.sh add fetch.sh 2025-04-19 15:06:34 +02:00
flake.lock chore(deps): lock file maintenance (#277) 2025-05-12 04:35:16 +00:00
flake.nix unpin element 2025-05-07 14:44:01 +02:00
LICENSE Add readme and license 2023-07-28 16:16:54 +02:00
README.md Update readme 2024-10-08 18:27:53 +02:00
renovate.json renovate: update schedule 2024-11-23 06:22:08 +01:00
treefmt.nix use treefmt.withConfig instead of treefmt-nix 2025-04-19 15:53:03 +02:00

nixos

My NixOS configuration

Installation instructions

  1. Boot the minimal NixOS ISO image
  2. Create a GPT partition table with the following partitions:
    • /dev/EFI_PARTITION: EFI system partition (type: EFI System, size: 1G)
    • /dev/LUKS_PARTITION: Encrypted root partition (type: Linux filesystem)
  3. Create and open the LUKS container:
    cryptsetup -yv luksFormat /dev/LUKS_PARTITION
    cryptsetup open /dev/LUKS_PARTITION root
    
  4. Create and mount btrfs subvolumes:
    mkfs.btrfs -f /dev/mapper/root
    
    mount -m -o noatime,compress=zstd /dev/mapper/root /mnt
    btrfs subvolume create /mnt/@data
    btrfs subvolume create /mnt/@data/.snapshots
    btrfs subvolume create /mnt/@cache
    btrfs subvolume create /mnt/@cache/.snapshots
    btrfs subvolume create /mnt/@nix
    btrfs subvolume create /mnt/@swap
    umount /mnt
    
    mount -m -o size=100%,mode=755 -t tmpfs tmpfs /mnt
    mount -m -o noatime,compress=zstd,subvol=@data /dev/mapper/root /mnt/persistent/data
    mount -m -o noatime,compress=zstd,subvol=@cache /dev/mapper/root /mnt/persistent/cache
    mount -m -o noatime,compress=zstd,subvol=@nix /dev/mapper/root /mnt/nix
    mount -m -o noatime,compress=zstd,subvol=@swap /dev/mapper/root /mnt/swap
    
  5. Create and activate swapfile:
    btrfs filesystem mkswapfile -s 16G /mnt/swap/swapfile
    btrfs inspect-internal map-swapfile -r /mnt/swap/swapfile  # resume_offset
    swapon /mnt/swap/swapfile
    
  6. Format and mount EFI system partition:
    mkfs.vfat /dev/EFI_PARTITION
    mount -m -o umask=0077 /dev/EFI_PARTITION /mnt/boot
    
  7. Install git:
    nix-env -iA nixos.git
    
  8. Clone this repository:
    mkdir -p /mnt/persistent/data/home/felix/
    cd /mnt/persistent/data/home/felix/
    git clone https://github.com/Defelo/nixos.git
    cd nixos
    
  9. Create a new or modify an existing host (don't forget to add new files to git).
  10. Install the system and reboot:
    nixos-install --flake .#HOSTNAME --no-channel-copy --no-root-password
    reboot