This repository keep track of my personal NixOS configuration.
This setup uses Nix Flakes and Home Manager.
Structure:
configuration/default.nix
: Main configurationconfiguration/user
: User-specific configurationconfiguration/sway
: Configuration related to swayconfiguration/neovim
: Configuration related to neovimconfiguration/dev
: Configuration related to development
Rebuild the system from the local repository:
sudo nixos-rebuild switch --flake <path_to_repo>
Note that <path_to_repo>
can be the path to the local repository but also the remote repository:
sudo nixos-rebuild switch --flake github:owner/repo
The development shell can be accessed using nix develop
.
You can upgrade NixOS to the latest version by running:
nixos-rebuild switch --upgrade --flake <path_to_repo>
Note that auto-upgrade is enabled in configuration.nix
.
To remove old, unreferenced packages:
nix-collect-garbage
The following command deletes old roots, removing the ability to roll back to them:
nix-collect-garbage -d
sudo nix-collect-garbage -d
To delete all historical versions you can use
sudo nix profile wipe-history
You can manually optimize the store using:
nix-store --optimise