My all-inclusive nix flake to solve all my problems.
Warning
Do not just use this repo out of the box since it will not work for your setup (or at least it probably wont work) Feel free to copy any parts you find interesting or useful, but I would recommend building your flake up from scratch as it will allow for easier bughunting.
Starting your nix journey can be daunting and understanding how the whole ecosystem works takes some time. For me starting with snowfall-lib was both a blessing and a curse, it took away so many problempoints by being easy, but it also hampered my learning because I never had to do things from scratch and sometimes translating a "normal" flake to a snowfall-lib setup was not trivial. Luckily for me Jake (the creator of snowfall-lib) was so kind and helped me bugfix and learn how to solve my own Problems.
The homes folder is home to all your homemanager configuration that is specific to that system (and user) and that system only. If you want generic home manager configuration then look into modules/home.
- home/system/user@hostname syntax
I dont really use this besides for testing out some apps, most of the things get turned into generic modules so I can eventually reuse them later.
For more extensive explainations checkout snowfall-lib/homes!
- extending lib
- any things defined here can be accessed vial
inherit (lib.${namespace})
Mine is straight ripped from here, as I have not found much use for this outside of these options, maybe at some point.
For more extensive explainations checkout snowfall-lib/lib!
This is the most interesting section of the flake, here I (and other users of snowfall-lib) define the packages that are available to your configuration. there are 3 main categories
- nixos
general system packages
- home
general homemanager packages
- darwin
general mac packages (tho at this point in time I do not have a mac)
Most of my configuration happens in this section and this is also where the different snowfall-lib repos diverge, some aspects are still fairly close to Jakes as that is what I started with, but some areas are more mature and now more my own style. For more concrete information abotu my system specific setup read here.
For more extensive explainations checkout snowfall-lib/modules!
- overlays provided by this flake
For more extensive explainations checkout snowfall-lib/overlays!
- secrets used currently only one file
Important
This uses sops-nix to encrypt sensitive information you need in your flake, never have secrets or password unencrypted in your repo, not even if it is private
This is also fairly interesting and a section I have not delved in too much, currently I only have a rust flake for screeps-rust in here. I think thi sis great to have quick access to a out of the box dev shell, but generally you probably want a project specific flake.
You can access these flakes either using self#rust
or in my case github:Daholli/nixos-config#rust
.
For more extensive explainations checkout snowfall-lib/shells!
- all the systems that can be built with the flake
- systems/system/hostname syntax
This is the heart piece of the flake, this is what is being targeted if you call nixos-rebuild switch --flake .#<hostname>
I try to only have very system specific config in here and try to cover all the other things in the generic part of the flake.
If you want to start piecing together how my config works this is where you would start.
For more extensive explainations checkout snowfall-lib/systems!
Most of this config draws inspiration from this config: https://github.com/jakehamilton/config