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:
mkdir -p ~/repos
cd ~/repos
git clone <forked-repo>
cd nix-configIf Nix is not installed, run the official installer (yes to all defaults):
sh <(curl -L https://nixos.org/nix/install) --daemonVerify installation:
nix --versionRun the following to enable system-wide nix commands:
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.confSpecify 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 backupNote
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.activationPackageThis lists previous generations. You can activate an earlier one using its path.
nix run github:nix-community/home-manager -- generationsPrune 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.