1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

fix: remove faulty agenix directory early and only if necessary

chore: change default microvm naming scheme to <host>-<name>
This commit is contained in:
oddlama 2023-05-21 01:29:54 +02:00
parent 43b2bd1982
commit 88f1ac54b8
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
9 changed files with 30 additions and 29 deletions

View file

@ -210,8 +210,8 @@
# to create a link called /run/agenix. Agenix should probably fail in this case,
# but doesn't and instead puts the generation link into the existing directory.
# TODO See https://github.com/ryantm/agenix/pull/187.
system.activationScripts.removeAgenixLink.text = "[[ -d /run/agenix ]] && rm -rf /run/agenix";
system.activationScripts.agenixInstall.deps = ["removeAgenixLink"];
system.activationScripts.removeAgenixLink.text = "[[ ! -L /run/agenix ]] && [[ -d /run/agenix ]] && rm -rf /run/agenix";
system.activationScripts.agenixNewGeneration.deps = ["removeAgenixLink"];
# Disable sudo which is entierly unnecessary.
security.sudo.enable = false;

View file

@ -25,17 +25,18 @@
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" "r8169"];
extra.microvms = {
vms.test = {
id = 11;
extra.microvms.vms = let
defineVm = id: {
inherit id;
system = "x86_64-linux";
autostart = true;
zfs = {
enable = true;
pool = "rpool";
dataset = "safe/vms/test";
mountpoint = "/persist/vms/test";
};
};
in {
test = defineVm 11;
#hi = defineVm 12;
};
}