chore: Prepare for first install attempt
This commit is contained in:
parent
0585138161
commit
c3eab3b1ae
5 changed files with 55 additions and 35 deletions
38
SETUP.md
Normal file
38
SETUP.md
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# Bootstrapping a New Device
|
||||||
|
|
||||||
|
This guide assumes you have a somewhat sane sops setup.
|
||||||
|
|
||||||
|
1. First, boot the NixOS live environment (minimal ISO is recommended).
|
||||||
|
2. Then, get the harddrive ID using `lsblk` or `fdisk -l`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo fdisk -l
|
||||||
|
ls -lah /dev/disk/by-id | grep -i <drive disk ID ie. sda>
|
||||||
|
```
|
||||||
|
|
||||||
|
Example output:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[nix-shell:~]$ sudo fdisk -l
|
||||||
|
Disk /dev/loop0: 1.14 GiB, 1221455872 bytes, 2385656 sectors
|
||||||
|
Units: sectors of 1 * 512 = 512 bytes
|
||||||
|
Sector size (logical/physical): 512 bytes / 512 bytes
|
||||||
|
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
||||||
|
|
||||||
|
|
||||||
|
Disk /dev/sda: 256 GiB, 274877906944 bytes, 536870912 sectors
|
||||||
|
Disk model: QEMU HARDDISK
|
||||||
|
Units: sectors of 1 * 512 = 512 bytes
|
||||||
|
Sector size (logical/physical): 512 bytes / 512 bytes
|
||||||
|
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
||||||
|
|
||||||
|
[nix-shell:~]$ ls -lah /dev/disk/by-id | grep -i sda
|
||||||
|
lrwxrwxrwx 1 root root 9 May 5 13:20 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 -> ../../sda
|
||||||
|
|
||||||
|
[nix-shell:~]$ # disk path: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Manually create a host configuration by modifying/duplicating `hosts/<target_host_to_base_off_of>` to `hosts/<new_host_name>`. Be sure to modify the hostname in `hosts/<new_host_name>/configuration.nix`.
|
||||||
|
4. Add the host to `flake.nix`.
|
||||||
|
5. Modify the disko configuration for our host to use the correct disk ID that we found earlier.
|
||||||
|
6. Make any other additional modifications if needed.
|
41
flake.nix
41
flake.nix
|
@ -5,13 +5,11 @@
|
||||||
flake-utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
flake-utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
|
||||||
disko = {
|
disko = {
|
||||||
url = "github:nix-community/disko";
|
url = "github:nix-community/disko";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
||||||
};
|
};
|
||||||
sops-nix.url = "github:Mic92/sops-nix";
|
sops-nix.url = "github:Mic92/sops-nix";
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
nh = {
|
nh = {
|
||||||
url = "github:viperML/nh";
|
url = "github:viperML/nh";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
||||||
};
|
};
|
||||||
nix-secrets = {
|
nix-secrets = {
|
||||||
url = "git+https://git.terah.dev/imterah/sops?shallow=1&ref=main";
|
url = "git+https://git.terah.dev/imterah/sops?shallow=1&ref=main";
|
||||||
|
@ -28,30 +26,23 @@
|
||||||
mkApp = flake-utils.lib.mkApp;
|
mkApp = flake-utils.lib.mkApp;
|
||||||
mkFlake = flake-utils.lib.mkFlake;
|
mkFlake = flake-utils.lib.mkFlake;
|
||||||
in mkFlake {
|
in mkFlake {
|
||||||
inherit self inputs nixpkgs;
|
inherit self inputs nixpkgs;
|
||||||
overlays = import ./overlays.nix {inherit inputs;};
|
|
||||||
|
|
||||||
sharedOverlays = [
|
hostDefaults.extraArgs = {inherit flake-utils;};
|
||||||
self.overlays.additions
|
hostDefaults.specialArgs = {
|
||||||
self.overlays.modifications
|
inherit inputs;
|
||||||
self.overlays.unstable-packages
|
inherit (self) outputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Main Docker-based host
|
||||||
|
hosts.andromeda = {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
inputs.disko.nixosModules.default
|
||||||
|
(import ./hosts/andromeda/disko.nix {device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0";})
|
||||||
|
inputs.impermanence.nixosModules.impermanence
|
||||||
|
./hosts/andromeda/configuration.nix
|
||||||
];
|
];
|
||||||
|
};
|
||||||
hostDefaults.extraArgs = {inherit flake-utils;};
|
|
||||||
hostDefaults.specialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
inherit (self) outputs;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Main Docker-based host
|
|
||||||
hosts.andromeda = {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
inputs.disko.nixosModules.default
|
|
||||||
(import ./hosts/andromeda/disko.nix {device = "/dev/disk/by-id/nvme-Samsung_SSD_979_PRO_with_Heatsink_1TB_S6WSNJ0T900943T";})
|
|
||||||
inputs.impermanence.nixosModules.impermanence
|
|
||||||
./hosts/andromeda/configuration.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,7 @@
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"wheel"
|
"wheel"
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"audio"
|
|
||||||
"docker"
|
"docker"
|
||||||
"input"
|
|
||||||
"plugdev"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
# networking.interfaces.enp193s0f3u2u3.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
|
|
@ -10,11 +10,7 @@
|
||||||
allowUnfreePredicate = _: true;
|
allowUnfreePredicate = _: true;
|
||||||
cudaSupport = true;
|
cudaSupport = true;
|
||||||
};
|
};
|
||||||
nixpkgs.overlays = [
|
|
||||||
outputs.overlays.additions
|
|
||||||
outputs.overlays.modifications
|
|
||||||
outputs.overlays.unstable-packages
|
|
||||||
];
|
|
||||||
nix = let
|
nix = let
|
||||||
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
|
||||||
in {
|
in {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue