# Nix Package Manager ## Managing packages ```bash nix-env -iA nixpkgs. ``` # NixOS ## Updating a Flake based system ```bash sudo nix update --flake /etc/nixos sudo nixos-rebuild switch ``` ## Updating a non-Flake based system ```bash sudo nixos-rebuild switch ``` You can use `boot` instead of `switch` for the system to boot into the new generation on reboot instead. # Contributing to nixpkgs ## Updating packages that you maintain ```bash git checkout -b bump-mypkg nix-shell -p nix-update --run 'nix-update --commit' nix-build -A # ensure it builds git push bump-mypkg ```