Install process is currently dumb basic.
To restore a known host:
sudo mv /etc/nixos /etc/nixos-orig
sudo mkdir /etc/nixos
sudo chmod 0775 /etc/nixos
git clone [email protected]:Gipetto/nixos.git /etc/nixos
cd /etc/nixos
If this is a new host:
- create host specific files in the
hosts
directory - update
flake.nix
to reflect necessary changes
make init
# test to make sure it looks good
make install
Open Question: what is the best way to do hardware configuration in the new flake world?
git clone [email protected]:Gipetto/nixos.git ~/.nixos
cd ~/.nixos
make init
make install
- Local ad-hoc configuration can be done by adding a
~/.zshrc.local
file
- The included
config/gitconfig
is registered as an include in/etc/gitconfig
- The included
config/gitignore
is registered as a global exludes file in/etc/gitconfig
- The declarations in home manager are supplied in
~/.config/git/gitconfig
- Local overrides can still be made by adding and populating a
~/.gitconfig
file
Find details on Packages, NixOS options and Flakes: https://search.nixos.org
Operation | Command |
---|---|
Search | nix-env -qaP '.*package.*' |
Install | nix-env -i package-name |
Upgrade | nix-channel --update nixpkgs nix-env --upgrade '*' |
Uninstall | nix-env --uninstall package-name |
Rollback | nix-env --rollback |
Info (short) | nix-env -qaP --description '.*package.*' |
Info (full) | nix-env -qaP --description --json --meta '.*package.*' |
List packages in the current environment (non-system packages) |
nix-env -qa --installed "*" |
Operation | Command |
---|---|
Search | nix search nixpkgs 'package' |
Upgrade? | nixos-rebuild switch --upgrade |
Upgrade | nix flake update sudo nixos-rebuild switch --flake . |
Operation | Command |
---|---|
New shell with packages | nix-shell -p pandoc |
Operation | Command |
---|---|
Remove all generations | nix-env --delete-generations old |
Remove specific generations | nix-env --delete-generations 10 11 14 |
Remove generagions by age | nix-env --delete-generations 14d |
Garbage collect | nix-store --gc |
Remove old & garbage collect | nix-collect-garbage -d |
Operation | Command |
---|---|
List packages in current environment | nix-env -q |
List packages in current system & current environment | nix-store -q --requisites /run/current-system ~/.nix-profile |
List direct dependencies of the current system | nix-store -q --references /run/current-system |
To permanently mount a drive, rebuild the hardware-configuration after the drive has been mounted. You many need to prune out Docker overlays before applying with nixos-rebuild
.
nixos-regenerate-config
nixos-rebuild switch
nixos-rebuild build-vm --flake https://github.com/Gipetto/nixos/tarball/master
./result/bin/run-nixos-vm