From 43c026c451e964212d1477547e5eb94fb6abeccd Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Sun, 3 May 2026 14:09:35 -0400 Subject: [PATCH] add argiletum --- flake.lock | 21 +++++++++++++ flake.nix | 5 ++++ systems/argiletum/configuration.nix | 6 ++-- systems/argiletum/default.nix | 1 + systems/argiletum/disk.nix | 46 +++++++++++++++++++++++++++++ systems/argiletum/hardware.nix | 20 ++----------- 6 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 systems/argiletum/disk.nix diff --git a/flake.lock b/flake.lock index 3afa2ce..e2e2a5e 100644 --- a/flake.lock +++ b/flake.lock @@ -68,6 +68,26 @@ "type": "github" } }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1777713215, + "narHash": "sha256-8GzXDOXckDWwST8TY5DbwYFjdvQLlP7K9CLSVx6iTTo=", + "owner": "nix-community", + "repo": "disko", + "rev": "63b4e7e6cf75307c1d26ac3762b886b5b0247267", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "firefox-addons": { "inputs": { "nixpkgs": [ @@ -565,6 +585,7 @@ }, "root": { "inputs": { + "disko": "disko", "firefox-addons": "firefox-addons", "flake-compat": "flake-compat", "flake-parts": "flake-parts", diff --git a/flake.nix b/flake.nix index ef00814..57e6839 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,11 @@ systems.url = "github:nix-systems/default"; # flake inputs with dependencies (in alphabetic order) + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs = { diff --git a/systems/argiletum/configuration.nix b/systems/argiletum/configuration.nix index 0b85d97..bc8da7b 100644 --- a/systems/argiletum/configuration.nix +++ b/systems/argiletum/configuration.nix @@ -1,9 +1,11 @@ { lib, ... }: { + imports = [ ./disk.nix ]; + time.timeZone = "America/New_York"; networking = { - hostId = "5f8a1c2e"; + hostId = "c3798ccc"; firewall = { enable = true; allowedTCPPorts = [ 80 ]; @@ -21,5 +23,5 @@ services.tang.enable = true; - system.stateVersion = "25.11"; + system.stateVersion = "26.11"; } diff --git a/systems/argiletum/default.nix b/systems/argiletum/default.nix index b906976..1d1e4ca 100644 --- a/systems/argiletum/default.nix +++ b/systems/argiletum/default.nix @@ -7,5 +7,6 @@ users = [ "alice" ]; modules = [ inputs.nixos-hardware.nixosModules.raspberry-pi-4 + inputs.disko.nixosModules.disko ]; } diff --git a/systems/argiletum/disk.nix b/systems/argiletum/disk.nix new file mode 100644 index 0000000..b577721 --- /dev/null +++ b/systems/argiletum/disk.nix @@ -0,0 +1,46 @@ +{ + disko.devices = { + disk = { + # SD card — change device to /dev/sda if booting from USB instead + main = { + type = "disk"; + device = "/dev/mmcblk0"; + content = { + type = "table"; + format = "mbr"; + partitions = [ + { + # Raspberry Pi firmware partition — must be vfat and first + name = "firmware"; + type = "primary"; + start = "1MiB"; + end = "512MiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot/firmware"; + mountOptions = [ + "fmask=0077" + "dmask=0077" + ]; + }; + } + { + # Root filesystem + name = "root"; + type = "primary"; + start = "512MiB"; + end = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; + }; + }; +} diff --git a/systems/argiletum/hardware.nix b/systems/argiletum/hardware.nix index 5ea917c..6b30bc9 100644 --- a/systems/argiletum/hardware.nix +++ b/systems/argiletum/hardware.nix @@ -1,21 +1,7 @@ -# TODO: replace with the output of: -# sudo nixos-generate-config --show-hardware-config -# run on the Pi after initial boot into the NixOS installer. +# TODO: after first boot, regenerate with: +# sudo nixos-generate-config --no-filesystems +# (disko owns fileSystems; do not add them here) { ... }: { - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; - - fileSystems."/boot/firmware" = { - device = "/dev/disk/by-label/NIXOS_BOOT"; - fsType = "vfat"; - options = [ - "fmask=0077" - "dmask=0077" - ]; - }; - swapDevices = [ ]; }