NixOS Niri flake setup
  • Nix 99.6%
  • Just 0.4%
Find a file
2026-08-16 13:45:31 +02:00
home/louis home/stylix: use bibata cursors instead of numix to avoid recompiling inkscape 2026-08-15 08:37:47 +02:00
hosts hosts/hermaeus: add forgejo server + action runner 2026-08-16 13:45:31 +02:00
modules/nixos Revert "nixos/matrix: add stickerpicker config" 2026-03-07 09:56:54 +01:00
overlays home/gui: add claude-desktop 2026-08-15 08:24:42 +02:00
pkgs Revert "nixos/matrix: add stickerpicker config" 2026-03-07 09:56:54 +01:00
.envrc fix: add dev shell in main flake 2024-06-04 08:53:25 +02:00
.gitignore chore: gitignore result/ 2026-01-01 17:41:46 +01:00
.sops.yaml hosts: migrate glance and matrix to hermaeus 2026-07-15 21:18:09 +02:00
flake.lock home/gui: add claude-desktop 2026-08-15 08:24:42 +02:00
flake.nix home/gui: add claude-desktop 2026-08-15 08:24:42 +02:00
justfile build: add nom for justfile rules 2026-07-18 13:04:50 +02:00
LICENSE chore: What ? I didn't have a license here ? 2025-05-17 16:31:14 +02:00
README.md docs: update readme 2025-06-29 13:50:30 +02:00

NixOS Niri flake setup

image

image

Features

  • Hyprland (Hypridle, Hyprlock, Hyprpaper, Mako, Albert, Swaync, Waybar)
  • Niri (with mostly the same wayland DE)
  • Nix Flakes
  • Theme handled by Stylix
  • Automatic light and dark themes
  • Multiple hosts
  • Home config as a Nix Module
  • Home Impermanence (on Akatosh)
  • Secrets Management

NixOS Config

 hosts
├──  akatosh
   ├──  default.nix
   ├──  hardware-configuration.nix
   └──  sops.nix
├──  arkay
   ├──  default.nix
   ├──  hardware-configuration.nix
   └──  sops.nix
├──  common
   ├──  global
   ├──  optional
   ├──  secrets.yaml
   └──  users
├──  dagon
   ├──  adguardhome.nix
   ├──  anubis.nix
   ├──  default.nix
   ├──  glance.nix
   ├──  hardware-configuration.nix
   ├──  hugo.nix
   ├──  jellyfin.nix
   ├──  karakeep.nix
   ├──  nextcloud.nix
   ├──  nginx.nix
   ├──  restic.nix
   ├──  secrets.yaml
   └──  sops.nix
└──  magnus
	├──  default.nix
	├──  hardware-configuration.nix
	└──  sops.nix
  • magnus: Main System
  • akatosh: Laptop (disk managed with disko with impermanence for NixOS)
  • dagon: Home Server hosted on a Raspberry Pi running NextCloud, Jellyfin, Karakeep, etc
  • arkay: Work laptop

Most of the system configuration is shared between hosts.

HomeManager Config

.
└── louis
    ├── akatosh.nix
    ├── features
    │   ├── cli
    │   ├── default.nix
    │   ├── desktop
    │   ├── dev
    │   ├── gaming
    │   ├── gui
    │   ├── impermanence.nix
    │   ├── misc
    │   └── virtualization
    ├── global
    │   ├── default.nix
    │   ├── home-manager.nix
    │   ├── options
    │   └── tools
    └── magnus.nix

There are some tools enabled by default (home/louis/global/tools.nix, helix) but most features are optional.

Features are enabled using options defined in (home/louis/global/options). See magnus.nix:

home-config = {
  cli.commonTools.enable = true;   # eza, bat, wget, ...
   gui = {
      kitty.enable = true;         # terminal
      firefox = {
        enable = true;
        searxngInstance = { # privacy-focused search engine
          local = true; # self-hosted
          url = "http://127.0.0.1";
          port = 30070;
        };
        homepageUrl = "localhost:30069"; # glance homepage
      };
      glance = {
        enable = true;
        host = "localhost";
        port = 30069;
      };
      social.enable = true; # discord, beeper, ...
      utils.enable = true;# spotify, file manager, calibre, ...
      ai.lmstudio.enable = true;
    };
    dev = {
      vscode.enable = true;
      devTools.enable = true; # tokei, tmux, ...
    };
    desktop.wayland = {
      enable = true; # contains most of my wayland "DE" (waybar, albert, swaync, ...)
      # hyprland = {
      #   enable = true;
      #   nvidia = true;
      # };
      niri.enable = true;
    };
  virtualization.enable = true;   # qemu, ...
  # other options exists (gaming, ...)
};

A big refactor is needed here to move these options to the NixOS config as when using home-manager as a NixOS module, it's better to write all options in the NixOS config.

Theming

Style is handled by Stylix:

Theme and wallpaper auto switch from light to dark on sunset using darkman and nix specialisations.

What you would change to use this config

Delete what you wouldn't use

Here are some (random) examples:

  • Nextcloud
  • Helix/NixVim
  • Some VSCode extensions
  • LMStudio
  • Git signing keys

What you need to do

NixOS

  • Have experimental features (nix-commands and flakes) enabled in your initial configuration
  • Clone the repo
  • Replace all occurences of louis by your username
  • Replace all occurences of magnus or hircine by your hostname (only hircine uses impermanence)
  • Either remove secrets management through sops or replace them with your own secrets. A hashed password could be considered as being enough so don't bother with secrets if you don't have any. (that's in ./hosts/common/users/USERNAME/default.nix)
  • Replace hardware-config.nix with your own file produced by nixos-generate-config.

Home Manager

  • You should already have changed magnus's config to be yours
  • You should probably follow this steps:
    • Comment out all features in ./home/USERNAME/HOSTNAME.nix
    • For each feature, see what it enables, remove what you don't want, then enable it or not
    • You should be good to rebuild : sudo nixos-rebuild --flake .#HOSTNAME boot then reboot now.