Update
This commit is contained in:
parent
f24240f8ca
commit
45688ee74b
|
@ -35,5 +35,5 @@ in
|
||||||
rascal = nixosSystem [ ./nixos/rascal.nix ];
|
rascal = nixosSystem [ ./nixos/rascal.nix ];
|
||||||
musicbox = diskoNixosSystem self.diskoConfigurations.unencrypted [ "/dev/sda" ] [ ./nixos/musicbox.nix ];
|
musicbox = diskoNixosSystem self.diskoConfigurations.unencrypted [ "/dev/sda" ] [ ./nixos/musicbox.nix ];
|
||||||
thinker = diskoNixosSystem self.diskoConfigurations.standard [ "/dev/nvme0n1" ] [ ./nixos/thinker.nix ];
|
thinker = diskoNixosSystem self.diskoConfigurations.standard [ "/dev/nvme0n1" ] [ ./nixos/thinker.nix ];
|
||||||
dragon = diskoNixosSystem self.diskoConfigurations.standard [ "/dev/disk/by-uuid/asdf" ] [ ./machines/dragon.nix ];
|
# dragon = diskoNixosSystem self.diskoConfigurations.standard [ "/dev/disk/by-uuid/asdf" ] [ ./nixos/dragon.nix ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
boot.loader.grub = {
|
boot.loader.grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
version = 2;
|
|
||||||
device = "/dev/sda";
|
device = "/dev/sda";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
81
readme.md
81
readme.md
|
@ -1,46 +1,57 @@
|
||||||
# zomg nixos
|
# Nix
|
||||||
|
|
||||||
TODO: overhaul this readme
|
The grand unification of configuration.
|
||||||
|
|
||||||
|
## Not on NixOS?
|
||||||
|
|
||||||
|
Install Nix using Determinate Systems's installer:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ssh -t beefcake 'cdd && pwd && g pl && cd os/linux/nix && sudo nixos-rebuild switch --flake .# && echo DONE'
|
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
|
||||||
```
|
```
|
||||||
|
|
||||||
Or for pushing:
|
And [install Home Manager in standalone mode](https://nix-community.github.io/home-manager/index.html#sec-install-standalone):
|
||||||
|
|
||||||
|
# NixOS
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# do once to setup
|
nixos-rebuild --flake git+https://git.lyte.dev/lytedev/nix switch
|
||||||
$ ssh -t beefcake 'cdd && git config receive.denyCurrentBranch updateInstead'
|
|
||||||
|
|
||||||
# probably regenerate and commit flake.lock from this directory
|
|
||||||
nix flake lock
|
|
||||||
|
|
||||||
# push and rebuild+switch
|
|
||||||
$ git push beefcake:~/.config/lytedev-dotfiles
|
|
||||||
$ ssh -t beefcake 'cd ~/.config/lytedev-dotfiles/os/linux/nix && sudo nixos-rebuild switch --flake .# && echo DONE'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Install For Home Manager
|
## Remotely
|
||||||
|
|
||||||
<!-- TODO: document nix+home manager installation for arch boxes -->
|
```bash
|
||||||
|
nixos-rebuild --flake git+https://git.lyte.dev/lytedev/nix#host \
|
||||||
|
--target-host root@host --build-host root@host \
|
||||||
|
switch
|
||||||
|
```
|
||||||
|
|
||||||
|
# Home Manager
|
||||||
|
|
||||||
|
This can be used on non-NixOS hosts:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
home-manager switch --flake .#daniel
|
home-manager switch --flake .#daniel
|
||||||
```
|
```
|
||||||
|
|
||||||
# Install From NixOS Bootable Media
|
## Remotely
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh daniel@host 'home-manager switch --flake git+https://git.lyte.dev/lytedev/nix#daniel'
|
||||||
|
```
|
||||||
|
|
||||||
|
# Provisioning New NixOS Hosts
|
||||||
|
|
||||||
Documented below is my process for standing up a new NixOS node configured and
|
Documented below is my process for standing up a new NixOS node configured and
|
||||||
managed by this flake.
|
managed by this flake from scratch.
|
||||||
|
|
||||||
## Network Access
|
## Network Access
|
||||||
|
|
||||||
Boot the ISO (via Ventoy USB drive) and establish network access:
|
Boot a NixOS ISO and establish network access:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# plug in ethernet or do the wpa_cli song and dance
|
# plug in ethernet or do the wpa_cli song and dance for wifi access
|
||||||
# scan if needed
|
wpa_cli scan # if you need to
|
||||||
wpa_cli scan
|
|
||||||
wpa_cli scan_results
|
wpa_cli scan_results
|
||||||
|
|
||||||
wpa_cli add_network 0
|
wpa_cli add_network 0
|
||||||
|
@ -50,38 +61,36 @@ wpa_cli enable_network 0
|
||||||
wpa_cli save_config
|
wpa_cli save_config
|
||||||
```
|
```
|
||||||
|
|
||||||
Partition and mount disk(s) however you like. Preferably, though, use a disko
|
Partition disk(s) and mount up however you like. Preferably, though, use a
|
||||||
configuration from this flake like so:
|
[disko configuration](./disko.nix) from this flake like so:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo nix-shell --packages git --run "
|
# TODO: I'm relatively certain this can be simplified to a single `nix run` command
|
||||||
nix run \
|
sudo nix-shell --packages git --run "nix run \
|
||||||
--extra-experimental-features nix-command \
|
--extra-experimental-features nix-command \
|
||||||
--extra-experimental-features flakes \
|
--extra-experimental-features flakes \
|
||||||
github:nix-community/disko -- \
|
github:nix-community/disko -- \
|
||||||
--flake 'git+https://git.lyte.dev/lytedev/nix#diskoConfigOfChoice' \
|
--flake 'git+https://git.lyte.dev/lytedev/nix#standard' \
|
||||||
--mode disko \
|
--mode disko \
|
||||||
--arg disks '[ \"/dev/your_disk\" ]'
|
--arg disks '[ \"/dev/your_disk\" ]'"
|
||||||
"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
And finally install NixOS as specified by this flake:
|
And finally install NixOS as specified by this flake:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix-shell --packages git \
|
nix-shell --packages git \
|
||||||
--run "
|
--run "sudo nixos-install \
|
||||||
sudo nixos-install \
|
--flake 'git+https://git.lyte.dev/lytedev/nix#yourNixosConfig'"
|
||||||
--flake 'git+https://git.lyte.dev/lytedev/nix#yourNixosConfig'
|
|
||||||
"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**NOTE**: This takes a while, mostly due to building Helix myself on each box. I
|
**NOTE**: This takes a while, mostly due to building Helix myself on each box. I
|
||||||
really need to figure out a good local caching setup.
|
really need to figure out a good local caching setup.
|
||||||
|
|
||||||
# Ops stuff
|
**NOTE**: since the disko setup _should_ be included in the nixosConfiguration,
|
||||||
|
I would like to know how to do this all in one go -- maybe even building my own
|
||||||
- **TODO**: Look into https://github.com/zhaofengli/colmena
|
live media?
|
||||||
|
|
||||||
# Other To Dos
|
# Other To Dos
|
||||||
|
|
||||||
- **TODO**: check stuff during receive with a hook?
|
- Local Nix substitute/cache setup?
|
||||||
|
- Pre-commit checks with `nix flake check`?
|
||||||
|
|
Loading…
Reference in a new issue