From 87e0ff243c01aaecb01f61868c038d3d2add3ce2 Mon Sep 17 00:00:00 2001 From: fwastring Date: Mon, 24 Nov 2025 11:06:05 +0100 Subject: [PATCH] disko --- README.md | 8 +++++++ flake.nix | 5 +++++ maskiner/core/disk-config.nix | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 maskiner/core/disk-config.nix diff --git a/README.md b/README.md index f4ab78f..2233f94 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,11 @@ @ Old Computers - laptop (Acer Swift 3) † 2025-08-05 + +``` +nixos-anywhere -- \ + --flake .#kiosk \ + --generate-hardware-config nixos-generate-config ./machines/kiosk/hardware-configuration.nix \ + + --target-host fw@192.168.1.186 +``` diff --git a/flake.nix b/flake.nix index b656b22..2f4eb3f 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,8 @@ minimal-tmux = { url = "github:niksingh710/minimal-tmux-status"; inputs.nixpkgs.follows = "nixpkgs"; + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -39,6 +41,7 @@ catppuccin, confetti, bbk, + disko, ... }@inputs: let @@ -85,6 +88,8 @@ catppuccin.nixosModules.catppuccin confetti.nixosModules.default bbk.nixosModules.default + ./maskiner/core/disk-config.nix + disko.nixosModules.disko ]; }; diff --git a/maskiner/core/disk-config.nix b/maskiner/core/disk-config.nix new file mode 100644 index 0000000..91f6ebd --- /dev/null +++ b/maskiner/core/disk-config.nix @@ -0,0 +1,41 @@ +{ lib, ... }: + +{ + disko.devices = { + disk = { + main = { + device = lib.mkDefault "/dev/nvme0n1"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + type = "EF00"; + size = "1G"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + swap = { + size = "101G"; + content = { + type = "swap"; + }; + }; + }; + }; + }; + }; + }; +}