-
Install NixOS (or Nix)
NB! Make sure user-
$USER
and hostname$HOST
match the configuration. -
Put your SSH key with access to the sops-protected vault and your GitHub account on your host (
~/.ssh/id_nix
),
and add it to the ssh agenteval $(ssh-agent) ssh-add ~/.ssh/id_nix
-
Clone this repository (to path matching
$FLAKE
)git clone [email protected]:runarsf/dotfiles.git ~/.config/nixos cd ~/.config/nixos
-
Copy
hardware-configuration.nix
to the host configurationcp /etc/nixos/hardware-configuration.nix ./hosts/${HOST}/hardware-configuration.nix
-
Build and switch
# NB! If your hostname doesn't match the configured one, temporarily change it in the shell ./packages/niks/niks.sh os switch --ask --hostname ${HOST:?} .
-
You should now be able to log in with the same username and the password set in the config (
changeme
).
After logging in, make sure to change your password, and check that all the substituters are applied correctly.passwd nix config show | egrep "^substituters"
- NixOS Package Search
- NixOS Options Search
- Home Manager Option Search
- Noogle
- Nix Package Version Search
- Prefetch hash (prepend
sha256:
):nix-prefetch-url --unpack $url
- Jump into the build of a derivation:
nix-shell -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'
- Test an expression:
nix eval -f test.nix f
test.nix{ lib ? import <nixpkgs/lib> }: { f = builtins.trace "Hello World!" true; }
Core library functions are shamelessly stolen from
imatpot/dotfiles