NixOS dotfiles and hardware configurations
nix-shell -p git vscode
git clone github.com/not-matthias/dotfiles-nix
cd dotfiles-nix
code .
Then create a new folder inside hosts
and configure it:
cp /etc/nixos/configuration.nix ./hosts/<name>
cp /etc/nixos/hardware-configuration.nix ./hosts/<name>
ln -s `pwd` ~/.config/nixpkgs
sudo nixos-rebuild switch --flake .#laptop
(Also try to restart your computer before)
nix-collect-garbage -d
# or
nix-collect-garbage --delete-older-than 14d
nix store optimise
nix store gc
sudo nix-channel --add https://nixos.org/channels/nixos-22.11 nixos
sudo nix-channel --update
# Rebuild dotfiles
See: https://superuser.com/a/1604695
Run with:
--option eval-cache false
https://discourse.nixos.org/t/cant-switch-to-flakes-error-cached-failure-of-attribute/42933/5
You need to update the system channel (run with sudo!) not your user's channel.
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nix-channel --update
nix-env --set-flag priority 0 nix-2.11.0
nix-shell '<home-manager>' -A install
Source: https://github.com/nix-community/home-manager/issues/2995#issuecomment-1146676866
Add to /etc/nix/nix.conf:
# https://nixos.wiki/wiki/Flakes
experimental-features = nix-command flakes
nix-store --verify --check-contents
Dotfiles: