From 9f97706ba2912f92ffc0c09be791bdfc63c001ee Mon Sep 17 00:00:00 2001 From: iFargle <albert@sysctl.io> Date: Thu, 21 Sep 2023 14:43:49 +0900 Subject: [PATCH] Docs and framework disk configs --- README.md | 11 ++++++++ nixos/hosts/nixos-framework/disks.nix | 38 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 nixos/hosts/nixos-framework/disks.nix diff --git a/README.md b/README.md index ab65e9e6..d2e9fb8d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,17 @@ ## NOTE: These configs expect this repo to be cloned to /etc/nixos/git/ ### For first-run, see [setup.sh](docs/setup.sh) +* Installing a system from the ISO: +``` +HOSTNAME='YourHostnameHere' +curl https://git.sysctl.io/albert/nix/raw/branch/main/nixos/hosts/${HOSTNAME}/disks.nix >> /tmp/disks.nix +echo 'LUKSEncryptionKeyHere' >> /tmp/secret.key +nix run github:nix-community/disko -- --mode disko /tmp/disks.nix +mkdir -p /mnt/etc/nixos/ +git clone https://git.sysctl.io/albert/nix /etc/nixos/git +nixos-install --flake /etc/nixos/git#${HOSTNAME} -v --show-trace +``` +  --- # To Do List diff --git a/nixos/hosts/nixos-framework/disks.nix b/nixos/hosts/nixos-framework/disks.nix new file mode 100644 index 00000000..11d5859a --- /dev/null +++ b/nixos/hosts/nixos-framework/disks.nix @@ -0,0 +1,38 @@ +{ disks ? }: { + disko.devices = { + disk = { + vda = { + type = "disk"; + device = "/dev/vda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "100M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + extraOpenArgs = [ "--allow-discards" ]; + passwordFile = "/tmp/secret.key"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; + }; +} \ No newline at end of file