My NixOS config Part 4: Tack is unbreakable nix.ladas552.me
niri nix noctalia hjem tack nvf nixos impermanence nvfetcher
README.md

nix

What is this? #

This is my multi host, modular Nix config. It declares configs for different programs using Nix language, such as:

  • Noctalia shell - desktop components with generous customizability
  • Niri - Scrollable Tilling Wayland Compositor via Community Niri-nix module
  • Wrapped package configurations via adios-wrappers modules library that uses a truly lazy loaded Nix module system - adios
  • Excellent Hjem linker with set of modules of Hjem-rum

I also declare configuration as packages/wrappers that you can try with nix run github:Ladas552/Nix-Lands#app, replace app with:

  • nvf - Nix declared Neovim (current daily driver)
  • all the other wrappers/scripts/packages in pkgs directory

Overview of things to note #

Hosts #

  • NixPort is my amd laptop
  • NixBox is my minipc with Pentium that I use as a server
  • NixOSu is my gaming pc, mostly for playing osu
  • NixwsL for Windows partition
  • NixIso for my portable NixOS image
  • NixWool is my Hetzner cloud that runs Tangled.sh knot

All the physical hosts run on tmpfs with Impermanence

Modular #

My config modules are imported automatically, but only merges if the host variant is matching to the host I am building. This is accomplished by nosh, a simple lib to make modular configs without mkIf option hell. I forked it to better suit my use case. The repo is also vendored in /lib

Depending on a host, I pass meta special arg that carry specific to this host information

Also I can pass host dependent config to adios-wrappers with some setup. See noct.nix for example

Docs #

I write comments on things, that might explain certain ways of doing things, or leave not working options in comments for people to find. This is to not look up one thing twice, and just look at the nix file itself.

Also, I have Norg document, containing notes and TODO for the config

I also write some blog posts about Nix, feel free to check it out

Nvfetcher #

I also have inputs in ./_sources/, they are generated with nvfetcher after editing the ./nvfetcher.toml file. Instead of nix flake update, I update them with nix run nixpkgs#nvfetcher.

To use them, use inputs from it:

sources = pkgs.callPackage "${self}/_sources/generated.nix" { };

Then with sources.<input-name>.src you can skip manual fetching for neovim plugins for example.

Also nvfetcher can be used to fetch nixos modules. Even if I don't do this currently

Check out a blog post about it

tack #

Instead of using flake.nix to fetch files, I use tack. Basically makes flake inputs lazy without breaking flake interface.

Screenshot if you care #

desktop

Name #

Yes, it is a JoJo's reference

Mirrors #

Code is hosted in two repositories for your and my convenience:

Credits #

I take a lot of things from the internet and different configs too. So I credit people in comments to snippets that I stole.

If you want to check every person that I stole things from, go to my List of configs

Also for that one guy who switched to codeberg

Also, thanks to everyone in Nix community for being so awesome, wouldn't be there without ya