feat: migrate to nix flake
This commit is contained in:
parent
d466f7e800
commit
80d4bb746e
12 changed files with 214 additions and 56 deletions
45
README.md
45
README.md
|
|
@ -1,8 +1,43 @@
|
|||
# FelschR's NixOS configuration
|
||||
# felschr's NixOS configuration
|
||||
|
||||
## Installation on new machine
|
||||
To setup a new machine run the following command after completing partitioning and mounting:
|
||||
## Installation
|
||||
|
||||
Clone the configuraiton into `etc/nixos`.
|
||||
|
||||
On a new machine run:
|
||||
|
||||
```sh
|
||||
nixos-generate-config --root /mnt
|
||||
```
|
||||
./install.sh <NIX_CONFIG>
|
||||
|
||||
Then move the resulting `/etc/nixos/hardware-configuration.nix` to `./hardware/<config>.nix` and adjust it and the `flake.nix` accodringly.
|
||||
Make sure everything was properly recognised. Btrfs mount options might be missing, for example.
|
||||
|
||||
To install run the following command where `<config>` matches `outputs.nixosConfigurations.<config>` in `flake.nix`:
|
||||
|
||||
```sh
|
||||
nixos-install --flake /etc/nixos#<config>
|
||||
```
|
||||
|
||||
## Updating
|
||||
|
||||
Update all or specific locked flake inputs:
|
||||
|
||||
```sh
|
||||
nix flake update
|
||||
nix flake update --update-input <input>
|
||||
```
|
||||
|
||||
## Rebuilding the system
|
||||
|
||||
Rebuild the system:
|
||||
|
||||
```sh
|
||||
sudo nixos-rebuild switch
|
||||
```
|
||||
|
||||
Update flake.lock and rebuild the system:
|
||||
|
||||
```sh
|
||||
nix flake update && sudo nixos-rebuild switch
|
||||
```
|
||||
This runs `nixos-generate-config`, symlinks the passed configuration to `/etc/nixos/configuration.nix`, sets up required nix channels and then runs `nixos-install`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue