/dotfiles-nix

NixOS dotfiles and hardware configurations

Primary LanguageNix

dotfiles-nix

NixOS dotfiles and hardware configurations

Installation

ln -s `pwd` ~/.config/nixpkgs
sudo nixos-rebuild switch --flake .#laptop

Free memory

(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

Upgrade

sudo nix-channel --add https://nixos.org/channels/nixos-22.11 nixos    
sudo nix-channel --update
# Rebuild dotfiles

See: https://superuser.com/a/1604695

Errors

Cached failure of attribute '

Run with:

--option eval-cache false

https://discourse.nixos.org/t/cant-switch-to-flakes-error-cached-failure-of-attribute/42933/5

unable to open database file at /run/current-system/sw/bin/command-not-found

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

Fix home-manager error

nix-env --set-flag priority 0 nix-2.11.0
nix-shell '<home-manager>' -A install

Source: nix-community/home-manager#2995 (comment)

Flakes not supported

Add to /etc/nix/nix.conf:

# https://nixos.wiki/wiki/Flakes
experimental-features = nix-command flakes

Random: No such file or directory

nix-store --verify --check-contents

References

Dotfiles: