{
local.flags = {
onlyCached = true; # bool; dictate if you are to compile pkgs or use cache
};
local.fragment."<name>".enable = true; # bool; dictate whether to enable a fragment
}
apps
: Scripts serving dotfiles purposesassets
: Media or files that don't fit in Nix fileshome-manager
: Home Manager specificfragments
: Home Manager configuration fragmentsoptions
: Home Manager configuration flagsprofiles
: Base Home Manager configurations to build upon (e.g.desktop
,minimal
)
lib
: Additional custom lib and flake helpersmodules
: modules that fill a missing feature of NixOS or Home Managernixos
: NixOS related confighardware/<hostname>.nix
: Device-specific settings like settings generated bynixos-generate-config
layout/<layout>.nix
:Disko
disk layouts used bymanagedDiskLayout
(e.gluks-btrfs
)fragments
: Opinionated NixOS configuration fragmentsprofiles/<profile>.nix
: Base system configurations to build upon (e.g.laptop
,installer
)
overlays
: Just plain Nix overlayspkgs
: Custom packages either not eligible or missing from repositoriessecrets
:agenix
encrypted secretstemplates
: Quickstart files for different languages
-
Copy template and replace
<name>
with module name{ config , lib , ... }: let cfg = config.local.fragment.<name>; in { options.local.fragment."<name>".enable = lib.mkEnableOption '' <name> related Depends on: - [<Condition>] <dependency>: <reason> - ... ''; config = lib.mkIf cfg.enable { assertions = [ { assertion = config."<dependency>"; message = "<name> module depends on <dependency>"; } ]; # put the rest of the config down below }; }
-
Add the newly created file to Git.
-
Add the new module to the import list in
<type>/fragments/default.nix
. -
Activate the module in the wanted profile.
nix run nixpkgs#home-manager -- switch --flake .#lightweight
- Rekey secrets with device root ssh key, and create a session age key.
Milo Moisson © 2023-2024