Update Nixpkgs
Updates the nixpkgs flake input to the latest version from the nixos-unstable branch.
Workflow
When the user requests to update nixpkgs:
- •
Update the nixpkgs flake input
bashnix flake update nixpkgs
This command:
- •Fetches the latest commit from github:nixos/nixpkgs/nixos-unstable
- •Updates the flake.lock file with the new revision and hash
- •Preserves all other flake inputs unchanged
- •
Verify the changes
bashnix flake check
Or build without applying:
bashnix build .#homeConfigurations.company-mbp.activationPackage
This verifies the flake is valid and all packages build correctly without activating the configuration.
- •
Show what changed
bashgit diff flake.lock
Review the nixpkgs revision change to confirm the update.
Package Details
The flake.nix contains:
- •nixpkgs: Main package repository (github:nixos/nixpkgs/nixos-unstable)
- •Used by home-manager and all package definitions
- •Updates bring in latest package versions and security fixes
Prerequisites
- •Nix with flakes enabled
- •Write access to the flake.lock file
- •Internet connection to fetch latest nixpkgs
Example Usage
User: "Update nixpkgs to the latest version"
Response workflow:
- •Navigate to the home-manager config directory
- •Run
nix flake update nixpkgs - •Verify with
nix flake checkornix build - •Show the user what revision was updated to
- •Do NOT apply automatically