This document walks you through setting up Nix and Home Manager with Flakes to manage your system configuration. This is catered towards Azure ML compute instances with its inherent volume configuration challenges. Still WIP
Clone from your forked repo:
cd repos
git clone <repo>
cd nix-config
If Nix is not installed, run the official installer (yes to all defaults):
sh <(curl -L https://nixos.org/nix/install) --daemon
Verify installation:
nix --version
Run the following to enable system-wide nix commands:
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
Specify your userName and userEmail in nix-config/modules/git.nix
Build and activate your flake-based Home Manager configurations:
nix run github:nix-community/home-manager -- switch --flake .#azureuser -b backup
At this point, you should now be setup with basic Nix! Read on to learn more about working with Nix.
To reapply changes after editing your config:
nix flake update
nix run .#homeConfigurations.azureuser.activationPackage
This lists previous generations. You can activate an earlier one using its path.
nix run github:nix-community/home-manager -- generations
Prune nix system garbage:
nix-collect-garbage --delete-older-than 10d
- If you encounter permission issues during Nix installation, make sure you have sudo access
- You may have to restart or create a new shell after installations or activations to ensure changes take effect
- For configuration errors, check the syntax in your home.nix file
This project is licensed under the MIT License - see the LICENSE file for details.