This repo holds my nix configurations.
- NixOS
- home-manager
- Supports both NixOS and MacOS
The rebuild script takes care of applying the hardware-configuration.nix
without checking it in to the repo. Also handles formatting nix files and auto-generating a commit message. Inspired by No Boilerplate's rebuild script.
The configurations use nix flakes.
I followed this guide to get NixOS and home-manager running using a flake.
Uses my neovim config as an input.
Currently running on these hosts:
- PC with NixOS unstable (also uses home-manager unstable)
- MacBook with home-manager (on MacOS)
- Configurable home-manager. This will allow me to use this same repo for my Mac's home-manager config as well. The goal is to keep linux-specific and darwin-specific configs separate while sharing as much nix code as possible between them.
- nix-darwin set up.
Starting from a fresh NixOS set up, this describes the steps needed to get a fully working set up.
- Enable flakes support: add the following snippet to
/etc/nixos/configuration.nix
:nix.settings.experimental-features = [ "nix-command" "flakes" ];
- Get
git
and an editor: either add it to/etc/nixos/configuration.nix
or usenix-shell -p git neovim
- Clone this repo:
cd && git clone https://github.com/Samyak2/nixos.git
- Switch:
sudo nixos-rebuild switch --flake .
- Reboot
- Set up ssh and gpg keys
Starting from a fresh Mac OS installation, this describes the steps needed to get a fully working set up.
- Install nix using the determinate systems installer
- TODO: xcode CLI tools are needed?
- Clone this repo:
cd && git clone https://github.com/Samyak2/nixos.git
- Get a shell with
home-manager
:nix-shell -p home-manager
- Switch:
home-manager switch --flake .
- Set up ssh and gpg keys
- Generate and add a gpg key:
gpg --full-generate-key
(9) ECC (sign and encrypt) *default*
(1) Curve 25519 *default*
Key is valid for? (0) 6m
- Use
gpg --list-secret-keys --keyid-format=long
and copy the ID (the text aftered25519/
) gpg --armor --export <key-id>
- Add gpg key to GitHub: https://github.com/settings/keys
- Generate and add an ssh key:
ssh-keygen -t ed25519 -C "your_email@example.com"
cat ~/.ssh/id_ed25519.pub
and add it to GitHub: https://github.com/settings/keys