- Nix 100%
|
|
||
|---|---|---|
| hosts | ||
| modules | ||
| secrets | ||
| users | ||
| .gitignore | ||
| .sops.yaml | ||
| common.nix | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
NIXOS Dotfiles
Usage
Nixos Configurations
Due to the host module referencing /etc/nixos/hardware-configuration.nix, so that it is seperated from the repo, all rebuild commands will need --impure, unless you copy your configuration into the repo.
Create age private key from new ssh host key
sudo ssh-keygen -A
nix-shell -p 'import (fetchTarball "https://github.com/Mic92/ssh-to-age/archive/main.tar.gz") {}' --run "sudo ssh-to-age -i /etc/ssh/ssh_host_ed25519_key.pub -o key.txt"
Follow update encryption keys afterward
First install - On installed OS
change "<HOSTNAME>" in the rebuild command to the name of the host you are installing
nix-shell -p git --run "sudo git clone https://git.awdawd.eu/Shared/nix-dotfiles.git /etc/nixos"
sudo nixos-rebuild --impure --flake /etc/nixos/nix-dotfiles#<HOSTNAME> switch
You may need to go through the boot options, and boot from nixos for the OS to start with the new settings
Build and switch
sudo nixos-rebuild --impure switch
Append the full path and hostname if you are going to switch config
sudo nixos-rebuild --impure --flake /etc/nixos/nix-dotfiles#test01 switch
Update encryption keys
To update all age files with a new encryption key, first add the public key to .sops.nix Then to sync all files run the command below. Change the "secrets/shared" path if desired
find secrets/shared -type f -name "*.yaml" -exec sops updatekeys -y {} +
Modules
Priority
Most options in default modules have values set with priority. This can be used to override the options in other modules. Lowest priority will be used
| Modules | Priority |
|---|---|
| /modules/10-system/10-core | 990 |
| /modules/10-system/20-base | 980 |
| /modules/30-graphical/10-login | 790 |
| /modules/30-graphical/30-desktop | 770 |
| /modules/30-graphical/70-web | 730 |
| /modules/40-daemons/50-server | 650 |
| /modules/50-packages/20-text_editor | 580 |