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

refactor: finish decoupling the library functions from config

This commit is contained in:
oddlama 2023-07-01 01:11:58 +02:00
parent 68bb9731d3
commit 80e7c1bdbf
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
59 changed files with 984 additions and 786 deletions

View file

@ -1,6 +1,7 @@
{
inputs,
config,
inputs,
lib,
nodes,
...
}: {
@ -43,29 +44,23 @@
];
meta.microvms.vms = let
defaults = {
defaultConfig = name: {
system = "x86_64-linux";
autostart = true;
zfs = {
enable = true;
pool = "rpool";
};
todo
configPath =
if nodePath != null && builtins.pathExists (nodePath + "/microvms/${name}") then
nodePath + "/microvms/${name}"
else if nodePath != null && builtins.pathExists (nodePath + "/microvms/${name}") then
nodePath + "/microvms/${name}.nix"
else null;
modules = [
# XXX: this could be interpolated in-place but statix has a bug https://github.com/nerdypepper/statix/issues/75
(./microvms + "/${name}.nix")
{node.secretsDir = ./secrets + "/${name}";}
];
};
in {
kanidm = defaults;
grafana = defaults;
loki = defaults;
vaultwarden = defaults;
adguardhome = defaults;
influxdb = defaults;
};
in
lib.genAttrs
["kanidm" "grafana" "loki" "vaultwarden" "adguardhome" "influxdb"]
defaultConfig;
#ddclient = defineVm;
#gitea/forgejo = defineVm;