My NixOS config Part 3: Flake-Parts Crusaders nix.ladas552.me
hjem nix nixos impermanence flake-parts nvfetcher niri noctalia
at master 80 lines 4.8 kB view raw view rendered
1![nix](https://socialify.git.ci/Ladas552/Flake-Ocean/image?font=Rokkitt&language=1&logo=https%3A%2F%2Fraw.githubusercontent.com%2FNixOS%2Fnixos-artwork%2Frefs%2Fheads%2Fmaster%2Flogo%2Fnix-snowflake-rainbow.svg&name=1&owner=1&pattern=Transparent&stargazers=1&theme=Dark) 2 3# What is this? 4This is my multi host, modular Nix config. It declares configs for different programs using Nix language, such as: 5- [Noctalia shell](https://github.com/noctalia-dev/noctalia-shell) - desktop components with generous customizability 6- [Niri](https://github.com/YaLTeR/niri) - Scrollable Tilling Wayland Compositor via Community [Niri-nix](https://codeberg.org/BANanaD3V/niri-nix) module 7- Firefox browser wrapped with [adifox](https://github.com/NotAShelf/adifox) that uses a brand new Nix module system - [adios](https://github.com/adisbladis/adios) 8- And many more with [Home-manager](https://github.com/nix-community/home-manager), that allows to declare configuration of user programs in Nix language 9- Excellent [Hjem](https://github.com/feel-co/hjem) linker with set of modules of [Hjem-rum](https://github.com/snugnug/hjem-rum) 10 11I also declare configuration as packages/wrappers that you can try with `nix run 12github:Ladas552/Flake-Ocean#app`, replace `app` with: 13 14- [nvf](https://github.com/NotAShelf/nvf) - Nix declared Neovim (current daily driver) 15- rofi-powermenu - power menu made of Rofi with a [nice theme](https://github.com/adi1090x/rofi) 16- all the other scripts in [pkgs directory](./pkgs/default.nix) 17- [wrappers directory](./modules/wrappers) for apps 18 19# Overview of things to note 20 21## Hosts 22 23- 2 NixOS hosts with Nvidia and Intel, and AMD APU on laptops. Both on ZFS and NixPort is using [Impermanence](https://github.com/nix-community/impermanence) 24- [NixOS-WSL](https://github.com/nix-community/NixOS-WSL) for Windows partition 25- NixVM for testing, you shouldn't use it unless testing breaking changes 26- NixIso for my portable NixOS image 27- NixWool is my Hetzner cloud that runs [Tangled.sh](https://tangled.org/) knot 28## Modular 29I adopted [Dendritic layout](https://github.com/mightyiam/dendritic) for my config. 30Making all files their own modules that I can import, and if module isn't imported, it doesn't exist. This way most of my config is fairy atomic and you can pop in and out modules as you wish. 31 32Also I made `custom.meta` options on every host, and depending on host, different variables are used. Options defined in `modules/flake-parts/options`. And host variables are defined at `imports.nix` of every host. Even for nvf config. 33 34I also have a lot of unused code that I can import if need be, for example my niri can be managed with hjem and home-manager and result will be identical. 35 36## Docs 37I 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. 38 39Also, I have [Norg document](./nix.norg), containing notes and TODO for the config 40 41I also write some [blog posts about Nix](https://nix.ladas552.me/), feel free to check it out 42 43## Nvfetcher 44 45I 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`. 46 47To use them, use inputs from it: 48 49```nix 50sources = pkgs.callPackage "${self}/_sources/generated.nix" { }; 51``` 52 53Then with `sources.<input-name>.src` you can skip manual fetching for neovim plugins for example. 54 55I also use nvfetcher to fetch nixos modules, the method described in the `flake.nix` file. 56 57[Check out a blog post about it](https://nix.ladas552.me/posts/Nvfetcher/) 58 59## Screenshot if you care 60![desktop](https://blog.ladas552.me/assets/desktop/desktop.png) 61 62## Name 63 64Yes, it is a [JoJo's reference](https://github.com/user-attachments/assets/7c467d52-a430-4bb3-9493-a5ffa0d69dd4) 65## Mirrors 66Code is hosted in two repositories for your and my convenience: 67- Main Tangled: https://tangled.org/ladas552.me/Flake-ocean 68- Read-only GitHub: https://github.com/Ladas552/Flake-Ocean 69- My older archived config: https://github.com/Ladas552/Nix-Is-Unbreakable 70 71# Credits 72I take a lot of things from the internet and different configs too. So I credit people in comments to snippets that I stole. 73 74If you want to check every person that I stole things from, go to my [List of configs](https://github.com/stars/Ladas552/lists/nix-flakes) 75 76Also for that [one guy](https://codeberg.org/Dich0tomy/snowstorm) who switched to codeberg 77 78Also [this post from drupol](https://not-a-number.io/2025/refactoring-my-infrastructure-as-code-configurations/) was huge help in migrating my config to dendritic 79 80Also, thanks to everyone in Nix community for being so awesome, wouldn't be there without ya