From fa8354f1f8184c876c37aee36f2e7548de294688 Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:15:40 +0100 Subject: [PATCH] Make disko config universal --- hosts/franz/disko.nix => disko/btrfs-swap.nix | 4 ++-- hosts/franz/README.md | 2 +- hosts/franz/default.nix | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename hosts/franz/disko.nix => disko/btrfs-swap.nix (94%) diff --git a/hosts/franz/disko.nix b/disko/btrfs-swap.nix similarity index 94% rename from hosts/franz/disko.nix rename to disko/btrfs-swap.nix index 29ec4ca..c709bca 100644 --- a/hosts/franz/disko.nix +++ b/disko/btrfs-swap.nix @@ -1,7 +1,7 @@ -{ +{device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: { disko.devices = { disk.main = { - device = "/dev/nvme0n1"; + inherit device; type = "disk"; content = { type = "gpt"; diff --git a/hosts/franz/README.md b/hosts/franz/README.md index 38356ad..cdbf42f 100644 --- a/hosts/franz/README.md +++ b/hosts/franz/README.md @@ -3,5 +3,5 @@ ## Drive Formatting ```sh -sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko ./disko.nix +sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko ../../disko/btrfs-swap.nix --arg device '"/dev/nvme0n1"' ``` diff --git a/hosts/franz/default.nix b/hosts/franz/default.nix index 9d5478c..32956d4 100644 --- a/hosts/franz/default.nix +++ b/hosts/franz/default.nix @@ -13,7 +13,7 @@ in { inputs.disko.nixosModules.default ./hardware-configuration.nix - ./disko.nix + (import ../../disko/btrfs-swap.nix {device = "/dev/nvme0n1";}) ../common/global