Personal Nix flake
nixos home-manager nix
at raspberrypi 87 lines 3.6 kB view raw view rendered
1[dms]: https://github.com/AvengeMedia/DankMaterialShell 2[ez-configs]: https://github.com/ehllie/ez-configs/ 3[flake-parts]: https://github.com/hercules-ci/flake-parts 4[flake-schemas]: https://github.com/DeterminateSystems/flake-schemas 5[rofi]: https://github.com/davatorium/rofi 6[stylix]: https://github.com/danth/stylix 7 8<p align="center"> 9 <i href="https://github.com/lpchaim/nixos/actions/workflows/check.yml"> 10 <img src="https://github.com/lpchaim/nixos/actions/workflows/check.yml/badge.svg" title="Checks flake outputs"/> 11 </i> 12 <i href="https://github.com/lpchaim/nixos/actions/workflows/build.yml"> 13 <img src="https://github.com/lpchaim/nixos/actions/workflows/build.yml/badge.svg" title="Builds flake outputs"/> 14 </i> 15</p> 16 17<p align="center"> 18 <img src="assets/readme/screenshot.png" title="Screenshot of my desktop with fasfetch on top"/> 19</p> 20 21--- 22 23Welcome to my Nix flake, powered by [flake-parts]! 24 25This is mainly for my NixOS configurations, but it also has a couple standalone Home Manager configs, packages, development shells and NixOS/Home Manager modules. 26 27## Design goals 28 29- Simple, easy to parse and short system/home configurations 30 - Minimal boilerplate 31 - Largely orthogonal `profiles` instead of one-off module options, e.g. enable `my.profiles.gaming = true` instead of specifying several options per host 32- Good separation of concerns and modularity, I dislike how monolithic flakes tend to turn out 33 - Huge shoutout to [flake-parts] for helping with this! 34- No libraries with too much magic behind how they work 35 - As little obfuscation as possible on how things work, compose my own tools from more barebones ones as needed 36 37I use [ez-configs] to get some boilerplate out of the way when it comes to setting up systems and home configurations. I usually define home configurations directly on the system configurations themselves since they tend to have similar functionality goals and complimentary options anyway. 38 39I have plenty of custom HM and NixOS modules, so I use `profiles` to group them together and massively simplify my configs. They also have enough smarts to, for instance, enable the `gnome` Home Manager module by default if the host system has the same module enabled. 40 41As an example, this is a working NixOS configuration describing my main rig. 42 43```nix 44{config, ...}: let 45 inherit (config.my.config) name; 46in { 47 imports = [ 48 ./hardware-configuration.nix 49 ./storage.nix 50 ]; 51 52 my = { 53 ci.build = true; 54 gaming.enable = true; 55 networking.tailscale.trusted = true; 56 users.emily.enable = true; 57 profiles = { 58 formfactor.desktop = true; 59 hardware.gpu.nvidia = true; 60 hardware.rgb = true; 61 de.gnome = true; 62 de.hyprland = true; 63 graphical = true; 64 }; 65 }; 66 67 networking.interfaces.enp6s0.wakeOnLan.enable = true; 68 69 age.rekey.hostPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNf+oynlWr+Xq3UYKpCy8ih/w9sT6IuIKAtYjo6sfJr"; 70 system.stateVersion = "23.11"; 71 home-manager.users.${name.user}.home.stateVersion = "24.11"; 72} 73``` 74 75## Look and feel 76 77I daily drive Hyprland with [dms] and [rofi]. 78 79My systems wouldn't look even halfway as good without [stylix] doing all the heavy-lifting in my stead. 80The color scheme used in my screenshots is `stella`. 81 82## File structure 83 84I'm hoping the file structure under `/nix` is mostly self-explanatory. That said, there are a couple that bear explaining: 85- `nix/flakeModules` for flake modules consumed by [flake-parts] 86- `nix/schemas` for my custom [flake-schemas] definitions 87- `nix/shared` for configuration and modules useful to both and NixOS and Home Manager