Here lies my NixOS configuration.
.
├── dotfiles
├── flake.lock
├── flake.nix
├── hosts
│ ├── laptop
│ │ └── dotfiles
│ ├── pc
│ │ └── dotfiles
│ └── servarr
├── lib
├── modules
└── secretsdotfilesA directory for all shared non-nix dotfiles.hostsAll subdirectories ofhostsare all files specific to one host.dotfilesNon-nix dotfiles that are specific to that host.
libNix functions used throughout the config.modulesSomewhat coherently organized files that many systems use.secretsAgenix secrets mostly used for my home server.
After cloning this repo to your home directory just run this command:
sudo nixos-rebuild switch --flake /home/<USER>/NixOS#<SYSTEM>Replace <USER> and <SYSTEM> with something that makes sense.
Options for <SYSTEM>: pc laptop servarr
- Add an entry to
secrets/secrets.nixwith its keys. - Write whatever it is in the env file using
agenix -e <SECRET_NAME>.age. (to getagenixusenix develop) - To use that secret add it in the
hosts/<HOST>/secrets.nixfile. - Then in the configuration use
config.age.secrets.<SECRET_NAME>.pathto get the path of the file.