ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/id.pub
nix run nixpkgs#git -- clone [email protected]:nazmir/nix-config.git
Install nix from determinate systems for non nixos systems. In case of Nixos enable experimental features - this should already be enabled in configuration.nix
On nixos systems to permanently enable add the following to configuration.nix
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix run home-manager/master -- init --switch ~/nix-config/home/
sudo ~/nix-config/bin/rename-and-link /etc/nixos/ ~/nix-config/nixos/
Install Doom Emacs and make sure to run
doom doctor
#To check for any issues
Backup ~/.emacs.d if it exists
mv ~/.emacs.d ~/.emacs.d.orig
Copy doom configuration files to ~/.nix-config/.config/doom
~/nix-config/bin/rename-and-link.sh ~/.config/doom/ ~/nix-config/.config/doom
~/nix-config/bin/rename-and-link ~/.config/sway/config ~/.config/sway/config
~/nix-config/bin/rename-and-link ~/.config/kitty/ ~/nix-config/.config/kitty
#The result will be in current folder
nix flake update
nh os switch --ask #Ask for confirmation before applying configuration
nh home switch --ask
#To specify flakes explicitly use:
nh os switch --ask ~/nix-config/.#mir-nixos-thinkpad
#To use the current hostname and specify flake path reference use:
nh os switch --ask ~/nix-config/
nh clean all #Clean OS and Home profiles
nh clean user #clean user profiles
nix profile list
nh clean profile -a nixGL #nixGL is profile name and -a asks for confirmation
sudo nixos-rebuild switch --flake /home/mir/nix-config/.#mir-nixos-thinkpad
home-manager switch --flake /home/mir/nix-config/.#mir@mir-nixos-thinkpad
Build the result before switching
sudo nixos-rebuild build --flake /home/mir/nix-config/.#mir-nixos-thinkpad
To compare current system with build result run
nvd diff /run/current-system/ ./result/
nvd diff $(ls -d1v /nix/var/nix/profiles/system-*-link|tail -n 2) #To compare result after switch
nvd uses nix store diff-closure, but with improved reporting. Syntax for nix store diff-closure is:
nix store diff-closures $(ls -d1v /nix/var/nix/profiles/system-*-link|tail -n 2)