NixOS configuration
Installation
(I highly recommend making your own configuration and copy snippets from mine, but anyway…)
Get the latest NixOS 22.05 image here, do your partitions (root must be mounted at /mnt
), then run the following commands:
# move the output file of this to hosts/*/hardware-configuration.nix
nixos-generate-config
nix-shell -p git nixUnstable
git clone https://github.com/fortuneteller2k/nix-config ~
cd ~
sudo nixos-install --flake '.#superfluous'
# After rebooting
home-manager switch --flake '.#fortuneteller2k'
For WSL, follow the quickstart guide, then run the following commands:
nix shell nixpkgs#git
git clone https://github.com/fortuneteller2k/nix-config ~
cd ~
sudo nixos-rebuild switch --flake '.#turncoat'
home-manager switch --flake '.#zero'
Caveats
- You probably should replace hosts/superfluous/hardware-configuration.nix with your own with
nixos-generate-config
. - You might want to change all instances of my username to yours.
- Comment out every
__contentAddressed = true;
inhosts
. - You might want to disable
agenix
, for my secret cannot be decrypted without my private key. See hosts/superfluous/default.nix and users/fortuneteller2k/config/zsh/default.nix.
Description
NixOS configuration that I use daily, it contains the system-wide and home configuration, symlinked to /etc/nixos
.
See also:
- home-manager
- flakes
- nixpkgs-f2k, my package collection
- NixOS-WSL, for
hosts/turncoat
Resources and configurations I used to base on:
- hlissner/dotfiles
- colemickens/nixos-flake-example
- dunklecat/nixos-config
- Nix Flakes talk by Eelco Dolstra on NixCon
Why flakes?
jonringer gave a brief explanation as to why one might want to use Nix flakes.