Nix flake repository for personal hosts using literate config
Find a file
2024-12-21 03:01:00 +01:00
.github docs: improve README 2024-12-19 14:31:01 +01:00
checks feat: add pre-commit-hooks 2024-12-10 22:41:40 +01:00
hosts feat: provide installation from local ISO 2024-12-21 03:00:59 +01:00
modules feat: isPublic flag 2024-12-18 12:25:04 +01:00
overlays feat: add eontimer, pokefinder, retroarch 2024-12-21 03:01:00 +01:00
pkgs feat: add eontimer, pokefinder, retroarch 2024-12-21 03:01:00 +01:00
profiles feat: add eontimer, pokefinder, retroarch 2024-12-21 03:01:00 +01:00
programs feat: freshrss and minor adjustments 2024-12-16 18:10:16 +01:00
scripts feat: provide installation from local ISO 2024-12-21 03:00:59 +01:00
secrets feat: improve yubikey related setting 2024-12-19 00:29:49 +01:00
templates chore: code cleanup (nixpkgs-fmt style) 2024-07-20 00:21:55 +02:00
wallpaper feat: init immich on winters 2024-10-04 17:03:09 +02:00
.gitignore feat: add checks to devShell 2024-12-11 01:22:51 +01:00
.sops.yaml feat: deployed toto 2024-12-18 01:17:27 +01:00
flake.lock chore: update flake 2024-12-10 22:50:56 +01:00
flake.nix feat: provide installation from local ISO 2024-12-21 03:00:59 +01:00
index.html docs: improve README 2024-12-19 14:31:01 +01:00
justfile feat: add justfile options for nixos-generate 2024-12-18 01:46:08 +01:00
LICENSE Create LICENSE 2024-05-05 02:29:22 +02:00
statix.toml feat: Setup Workflows 2024-07-18 23:36:47 +02:00
SwarselSystems.org feat: add eontimer, pokefinder, retroarch 2024-12-21 03:01:00 +01:00

nixos-unstable Build Status

Disclaimer

You probably do not want to use this setup verbatim. This is made to fit my specific use cases, and I do not guarantee best practises everywhere. Changes are made on a daily basis.

That being said, there is a lot of general configuration that you probably can use without changes; if you only want to use this repository as a starting point for your own configuration, you should be fine. See below for more information. Also, if you see something that can be done more efficiently or better in general, please let me know! :)

~SwarselSystems~

Shell: zsh
DM: greetd
WM: SwayFX
Bar: Waybar
Editor: Emacs
Terminal: kitty
Launcher: fuzzel
Alerts: mako
Browser: firefox
Theme: city-lights (managed by stylix)

Overview

  • Literate configuration for Nix and Emacs (SwarselSystems.org)
  • Configuration based on flakes for personal hosts as well as servers on:
  • Streamlined configuration and deployment pipeline:
    • Framework for packages, overlays, and modules
    • Dynamically generated host configurations
    • Limited local installer (no secrets handling) with a supported demo build
    • Fully autonomous remote deployment using nixos-anywhere and disko (with secrets handling)
    • Improved nix tooling
  • Support for advanced features:
    • Secrets handling using sops-nix (pls don't pwn ❤️)
    • Management of non-file-based secrets using private repo
    • Full Yubikey support
    • LUKS-encryption
    • Secure boot using lanzaboote
    • BTRFS-based Impermanence

Documentation

If you are mainly interested in how I configured this system, check out this page:

SwarselSystems literate configuration

This file will take you through my design process, in varying amounts of detail.

Otherwise, the files that are possibly of biggest interest are found here:

Getting started

Demo configuration

If you just want to see if this configuration is for you, run this command on any system that has nix installed:

nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#install -- -u <YOUR_USERNAME>

This will install the chaostheatre configuration on your system, which is a de-facto mirror of my main configuration with secret-based settings removed. Please keep in mind that this limited installer will make local changes to the cloned repository in order to be able to install it (otherwise the builder would fail at fetching my private secrets repository). As such, this should only be used to evaluate the system - if you want to use it longterm, you will need to create a fork and make some changes.

Deployment

The deployment process for this configuration is mostly automated, there are only a few steps that are needed to be done manually:

  1. Fork this repo, and write your own host config at hosts/nixos/<YOUR_CONFIG_NAME>/default.nix (you can use one of the other configurations as a template. Also see https://github.com/Swarsel/.dotfiles/tree/main/modules for a list of all additional options). At the very least, you should replace the secrets/ directory with your own secrets and replace the SSH public keys with your own ones. I personally recommend to use the literate configuration and org-babel-tangle-file in Emacs, but you can also simply edit the separate .nix files.
  2. Have a system with nix available booted (this does not need to be installed, i.e. you can use a NixOS installer image; a custom minimal installer ISO can be built by running just iso in the root of this repo)
  3. Make sure that your Yubikey is plugged in or that you have your SSH key available (and configured)
  4. Run
nix run --experimental-features 'nix-command flakes' github:Swarsel/.dotfiles#install -- -n <CONFIGURATION_NAME> -d <TARGET_IP>

Alternatively (if you already have this configuration installed), you can also run bootstrap -n <CONFIGURATION_NAME> -d <TARGET_IP> (this runs the same program as the command above). 4) Follow the installers instructions:

  • you will have to choose a disk encryption password (if you want that feature)
  • you will have to confirm once that the target system has rebooted
  • you will have to enter the root password once during the final system install
  1. That should be it! The installer will take care of setting up disks, secrets, and the rest of the hardware configuration! You will still have to sign in manually to some webservices etc.

Below is a small list of tips that should be helpful no matter if you are new to the nix ecosystem:

Attributions, Acknowledgements, Inspirations, etc.

These are in random order (also known as 'the order in which I discovered them'). I would like to express my gratitude to:

If you feel that I forgot to pay you tribute for code that I used in this repository, please shoot me a message and I will fix it :)