From 35a5d08c3ecd03740cffb05ea5b2c58b63cb0254 Mon Sep 17 00:00:00 2001 From: oddlama Date: Thu, 18 Jan 2024 13:14:57 +0100 Subject: [PATCH] wip: add comment on fixing file system oopsie --- README.md | 2 +- modules/guests/default.nix | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8066526..2157b04 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Interface naming by MAC | Module | [Link](./modules/interface-naming.nix) | - | EFI/BIOS boot config | Module | [Link](./modules/boot.nix) | - | - | Allows you to specify a boot type (bios/efi) and the correct loader will automatically be configured Nginx recommended options | Module | [Link](./modules/nginx.nix) | - | agenix | Sets many recommended settings for nginx with a single switch plus some opinionated defaults. Also adds a switch for setting recommended security headers on each location. Node options | Module | [Link](./modules/node.nix) | - | - | A module that stores meta information about your nodes (hosts). Required for some other modules that operate across nodes. -Guests (MicroVMs & Containers) | Module | [Link](./modules/guests) | zfs, node options | - | This module implements a common interface to use guest systems with microvms or nixos-containers. +Guests (MicroVMs & Containers) | Module | [Link](./modules/guests) | zfs, disko, node options | - | This module implements a common interface to use guest systems with microvms or nixos-containers. Restic hetzner storage box setup | Module | [Link](./modules/restic.nix) | agenix, agenix-rekey | - | This module exposes new options for restic backups that allow a simple setup of hetzner storage boxes. There's [an app](./apps/setup-hetzner-storage-boxes.nix) that you should expose on your flake to automate remote setup. #### Home Manager Modules diff --git a/modules/guests/default.nix b/modules/guests/default.nix index 48bf930..5409bce 100644 --- a/modules/guests/default.nix +++ b/modules/guests/default.nix @@ -51,6 +51,7 @@ then disko.zfs.filesystem zfsCfg.hostMountpoint else disko.zfs.unmountable; })); + # Add the required fileSystems for shared folders fileSystems = mkMerge (flip map (attrValues guestCfg.zfs) (zfsCfg: { ${zfsCfg.hostMountpoint} = { @@ -281,6 +282,9 @@ in { "d /guests 0700 root root -" ]; + fileSystems = + # for guests filter zfs shared, group by mountpoint, fold and add dependencies. + assertions = flatten (flip mapAttrsToList config.guests ( guestName: guestCfg: flip mapAttrsToList guestCfg.zfs (