forked from mirrors_public/oddlama_nix-config
refactor: finish decoupling the library functions from config
This commit is contained in:
parent
68bb9731d3
commit
80e7c1bdbf
59 changed files with 984 additions and 786 deletions
|
@ -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;
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
disko = import ../../lib/disko.nix inputs;
|
||||
in {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
m2-ssd = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/${config.repo.secrets.local.disk.m2-ssd}";
|
||||
content = with config.lib.disko.gpt; {
|
||||
content = with disko.gpt; {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
|
@ -20,7 +23,7 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
zpool = with config.lib.disko.zfs; {
|
||||
zpool = with disko.zfs; {
|
||||
rpool =
|
||||
defaultZpoolOptions
|
||||
// {
|
||||
|
|
|
@ -122,7 +122,7 @@ in {
|
|||
url = "https://${sentinelCfg.networking.providedDomains.loki}";
|
||||
orgId = 1;
|
||||
basicAuth = true;
|
||||
basicAuthUser = "${config.repo.node.name}+grafana-loki-basic-auth-password";
|
||||
basicAuthUser = "${config.node.name}+grafana-loki-basic-auth-password";
|
||||
secureJsonData.basicAuthPassword = "$__file{${config.age.secrets.grafana-loki-basic-auth-password.path}}";
|
||||
}
|
||||
];
|
|
@ -1,10 +1,14 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
utils,
|
||||
...
|
||||
}: let
|
||||
inherit (config.lib.net) cidr;
|
||||
inherit
|
||||
(import ../../lib/net.nix inputs)
|
||||
cidr
|
||||
;
|
||||
|
||||
lanCidrv4 = "192.168.100.0/24";
|
||||
lanCidrv6 = "fd10::/64";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue