Here lies my NixOS configuration.
To access my neovim configuration on a system that has Nix installed, use this:
nix run git+https://git.doceys.computer/NixOS#neovim.
├── 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.
-
Before running
nixos-install- If needed generate the system SSH Key
sudo mkdir -p /mnt/etc/ssh sudo ssh-keygen -t ed25519 -N "" -f /mnt/etc/ssh/ssh_host_ed25519_key
- If needed generate the system SSH Key
-
Copy my SSH Keys to
~/.ssh -
Add the SSH Keys to the GPG-Agent
ssh-add ~/.ssh/<private-key-name>
-
Restore my GPG Keys
# For each key: gpg --import public.gpg gpg --import private.gpg
(I hope that's all)
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.
- Create the repo directory with
sudo -u git mkdir -p /home/git/<repository>.git - Initialize the bare repository with
git-sys init --bare /home/git/<repository>.git
sudo -u git touch /home/git/<repository>.git/git-daemon-export-okAnd to make it private again remove that file.