2023-07-31 04:21:32 +00:00
|
|
|
# iiogama's Personal NixOS/Home-Manager Configuration
|
|
|
|
|
|
|
|
## How to build existing system with flake
|
|
|
|
|
|
|
|
```
|
|
|
|
cd <build repo>
|
|
|
|
sudo nixos-rebuild switch --flake ".#<hostname>"
|
|
|
|
```
|
|
|
|
|
2023-09-29 01:28:33 +00:00
|
|
|
## How to update existing system's packages
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo nixos-rebuild switch --flake ".#<hostname>" --update-input nixpkgs --commit-lock-file
|
|
|
|
```
|
|
|
|
|
2023-07-31 04:21:32 +00:00
|
|
|
## How to install new system with flake
|
|
|
|
|
|
|
|
1. Boot into live NixOS disk and run the following commands:
|
|
|
|
```
|
|
|
|
sudo su
|
|
|
|
nix-env -iA nixos.git
|
|
|
|
git clone <repo url> /mnt/etc/nixos
|
|
|
|
nixos-install --flake ".#<host>"
|
|
|
|
```
|
|
|
|
2. Reboot machine, log in, and run the following commands:
|
|
|
|
```
|
|
|
|
sudo rm -r /etc/nixos/configuration.nix
|
|
|
|
```
|
|
|
|
3. Move build to desired location.
|
|
|
|
|
|
|
|
## Nix commands to remember
|
|
|
|
|
|
|
|
```
|
|
|
|
nix flake update
|
|
|
|
nix run nixpkgs#<package>
|
|
|
|
```
|
2023-08-02 14:10:29 +00:00
|
|
|
|
2023-11-23 06:24:22 +00:00
|
|
|
[Resources](https://pinboard.in/u:iiogama/t:nix/)
|