test: forgejo microVM

This commit is contained in:
Nick 2025-11-09 02:42:22 -06:00
parent aedf6e4be4
commit 6d83b2b2f5
11 changed files with 270 additions and 294 deletions

View file

@ -6,9 +6,31 @@
}:
let
inherit (flake.config.people) user0;
inherit (flake.config.machines.devices) eris;
erisSecrets = config.sops.secrets."network/server".path;
rootDevice = "/dev/disk/by-label/root";
bootDevice = "/dev/disk/by-label/BOOT";
sambaDrives = [
"samba0"
];
sambaFolders = [
"raid0"
];
sambaMounts = sambaDrive: folder: {
name = "${eris.${sambaDrive}.mount}/${folder}";
value = {
device = "${eris.${sambaDrive}.device}/${folder}";
fsType = "cifs";
options = eris.${sambaDrive}.options ++ [
"credentials=${erisSecrets}"
];
};
};
in
{
fileSystems = {
@ -54,7 +76,11 @@ in
"/etc/ssh" = {
neededForBoot = true;
};
};
}
// (builtins.listToAttrs (
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
));
boot.initrd.postResumeCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount -o subvolid=5 ${rootDevice} /btrfs_tmp