feat: changed config module names

This commit is contained in:
Nick 2024-11-04 20:49:43 -06:00
parent 95346caae6
commit 7a6685cbc2
34 changed files with 123 additions and 123 deletions

View file

@ -34,7 +34,7 @@ in let
]
)
// {
user = lib.mkOption {
users = lib.mkOption {
type = lib.types.attrsOf userSubmodule;
};
};
@ -79,7 +79,7 @@ in let
"writefreely"
])
// {
instance = lib.mkOption {
instances = lib.mkOption {
type = lib.types.attrsOf instanceSubmodule;
};
};
@ -102,7 +102,7 @@ in let
};
};
};
systemSubmodule = lib.types.submodule {
machineSubmodule = lib.types.submodule {
options =
builtins.listToAttrs (map (name: {
inherit name;
@ -119,7 +119,7 @@ in let
"tablet"
])
// {
device = lib.mkOption {
devices = lib.mkOption {
type = lib.types.attrsOf deviceSubmodule;
};
};
@ -146,11 +146,11 @@ in let
};
in {
options = {
service = lib.mkOption {
services = lib.mkOption {
type = serviceSubmodule;
};
system = lib.mkOption {
type = systemSubmodule;
machines = lib.mkOption {
type = machineSubmodule;
};
people = lib.mkOption {
type = peopleSubmodule;
@ -158,8 +158,8 @@ in {
};
config = {
people = import ./user.nix;
service = import ./instance.nix;
system = import ./device.nix;
people = import ./users.nix;
services = import ./instances.nix;
machines = import ./devices.nix;
};
}

View file

@ -7,7 +7,7 @@ let
userIdForUser0 = ["uid=1000"];
userIdForUser1 = ["uid=1001"];
in {
device = {
devices = {
# Desktop
desktop = {
label = "Desktop";

View file

@ -14,7 +14,7 @@ let
varLib = "/var/lib";
in {
instance = {
instances = {
web = {
domains = {
url0 = domain0;

View file

@ -6,7 +6,7 @@ in {
user0
user1
;
user = {
users = {
"${user0}" = {
name = "Nick";
aliases = {

View file

@ -1,14 +1,14 @@
{flake, ...}: let
inherit (flake.config.people) user0;
inherit (flake.config.people.user.${user0}) aliases;
inherit (flake.config.system.device) nas server;
inherit (flake.config.service) instance;
inherit (flake.config.people.users.${user0}) aliases;
inherit (flake.config.machines.devices) nas server;
inherit (flake.config.services) instances;
gitlabTags = ["git" "gitlab"];
youtubeTags = ["youtube" "you" "tube" "yt"];
jellyfinTags = ["jelly" "video" "streaming" "movies" "shows" "music"];
ollamaTags = [instance.ollama.name "chat" "ai"];
owncastTags = [instance.owncast.name "own" "cast" "stream"];
syncthingTags = [instance.syncthing.name "sync" "thing" instance.synology.name];
ollamaTags = [instances.ollama.name "chat" "ai"];
owncastTags = [instances.owncast.name "own" "cast" "stream"];
syncthingTags = [instances.syncthing.name "sync" "thing" instances.synology.name];
in {
programs.firefox.profiles = {
${user0} = {
@ -224,28 +224,28 @@ in {
toolbar = false;
bookmarks = [
{
name = instance.forgejo.label;
url = "https://${instance.forgejo.subdomain}.${instance.web.domains.url0}";
tags = [instance.forgejo.name "forge" "git"];
keyword = instance.forgejo.label;
name = instances.forgejo.label;
url = "https://${instances.forgejo.subdomain}.${instances.web.domains.url0}";
tags = [instances.forgejo.name "forge" "git"];
keyword = instances.forgejo.label;
}
{
name = "${instance.jellyfin.label} (Internet)";
url = "https://${instance.jellyfin.name}.${instance.web.domains.url0}";
name = "${instances.jellyfin.label} (Internet)";
url = "https://${instances.jellyfin.name}.${instances.web.domains.url0}";
tags = jellyfinTags;
keyword = instance.jellyfin.label;
keyword = instances.jellyfin.label;
}
{
name = "${instance.jellyfin.label} (Local)";
url = "http://${server.ip.address0}:${toString instance.jellyfin.ports.port1}";
name = "${instances.jellyfin.label} (Local)";
url = "http://${server.ip.address0}:${toString instances.jellyfin.ports.port1}";
tags = jellyfinTags;
keyword = instance.jellyfin.label;
keyword = instances.jellyfin.label;
}
{
name = instance.mastodon.label;
url = "https://${instance.web.domains.url1}";
tags = [instance.mastodon.name "mast" "md"];
keyword = instance.mastodon.label;
name = instances.mastodon.label;
url = "https://${instances.web.domains.url1}";
tags = [instances.mastodon.name "mast" "md"];
keyword = instances.mastodon.label;
}
{
name = "Namecheap";
@ -254,86 +254,86 @@ in {
keyword = "Name";
}
{
name = instance.nextcloud.label;
url = "https://${instance.nextcloud.subdomain}.${instance.web.domains.url1}";
tags = [instance.nextcloud.name "next" "cloud" "calendar"];
keyword = instance.nextcloud.label;
name = instances.nextcloud.label;
url = "https://${instances.nextcloud.subdomain}.${instances.web.domains.url1}";
tags = [instances.nextcloud.name "next" "cloud" "calendar"];
keyword = instances.nextcloud.label;
}
{
name = aliases.name2;
url = instance.web.domains.url2;
url = instances.web.domains.url2;
tags = [aliases.name3 "blog"];
keyword = aliases.name2;
}
{
name = "${instance.ollama.label} (Server)";
url = "https://${instance.ollama.subdomain}.${instance.web.domains.url1}";
name = "${instances.ollama.label} (Server)";
url = "https://${instances.ollama.subdomain}.${instances.web.domains.url1}";
tags = ollamaTags;
keyword = instance.ollama.label;
keyword = instances.ollama.label;
}
{
name = "${instance.ollama.label} (Desktop)";
url = "http://localhost:${toString instance.ollama.ports.port0}";
name = "${instances.ollama.label} (Desktop)";
url = "http://localhost:${toString instances.ollama.ports.port0}";
tags = ollamaTags;
keyword = instance.ollama.label;
keyword = instances.ollama.label;
}
{
name = "${instance.owncast.label} (Admin)";
url = "http://${server.ip.address0}:${toString instance.owncast.ports.port0}/admin";
name = "${instances.owncast.label} (Admin)";
url = "http://${server.ip.address0}:${toString instances.owncast.ports.port0}/admin";
tags = owncastTags;
keyword = instance.owncast.label;
keyword = instances.owncast.label;
}
{
name = "${instance.owncast.label} (Server)";
url = "http://${instance.owncast.subdomain}.${instance.web.domains.url1}";
name = "${instances.owncast.label} (Server)";
url = "http://${instances.owncast.subdomain}.${instances.web.domains.url1}";
tags = owncastTags;
keyword = instance.owncast.label;
keyword = instances.owncast.label;
}
{
name = instance.peertube.label;
url = "https://${instance.peertube.subdomain}.${instance.web.domains.url1}";
tags = [instance.peertube.name "peer" "tube" "nutrivore"];
keyword = instance.peertube.label;
name = instances.peertube.label;
url = "https://${instances.peertube.subdomain}.${instances.web.domains.url1}";
tags = [instances.peertube.name "peer" "tube" "nutrivore"];
keyword = instances.peertube.label;
}
{
name = "Router";
url = "http://${instance.web.localhost.address2}";
url = "http://${instances.web.localhost.address2}";
tags = ["router" "asus"];
keyword = "Router";
}
{
name = "${instance.syncthing.label} (${instance.synology.label})";
url = "http://${nas.ip.address0}:${toString instance.syncthing.ports.port0}";
name = "${instances.syncthing.label} (${instances.synology.label})";
url = "http://${nas.ip.address0}:${toString instances.syncthing.ports.port0}";
tags =
["synology"]
++ syncthingTags;
keyword = instance.syncthing.label;
keyword = instances.syncthing.label;
}
{
name = "${instance.syncthing.label} (Desktop)";
url = "http://localhost:${toString instance.syncthing.ports.port0}";
name = "${instances.syncthing.label} (Desktop)";
url = "http://localhost:${toString instances.syncthing.ports.port0}";
tags =
["desktop"]
++ syncthingTags;
keyword = instance.syncthing.label;
keyword = instances.syncthing.label;
}
{
name = instance.synology.label;
url = "https://${nas.ip.address0}:${toString instance.synology.ports.port0}";
tags = [instance.synology.name "dsm" "cloud"];
keyword = instance.synology.label;
name = instances.synology.label;
url = "https://${nas.ip.address0}:${toString instances.synology.ports.port0}";
tags = [instances.synology.name "dsm" "cloud"];
keyword = instances.synology.label;
}
{
name = instance.vaultwarden.label;
url = "https://${instance.vaultwarden.subdomain}.${instance.web.domains.url0}";
tags = [instance.vaultwarden.name "bitwarden" "vault" "bit" "warden"];
keyword = instance.vaultwarden.label;
name = instances.vaultwarden.label;
url = "https://${instances.vaultwarden.subdomain}.${instances.web.domains.url0}";
tags = [instances.vaultwarden.name "bitwarden" "vault" "bit" "warden"];
keyword = instances.vaultwarden.label;
}
{
name = instance.wiki.label;
url = "https://${instance.wiki.subdomain}.${instance.web.domains.url1}";
tags = [instance.wiki.name "vault"];
keyword = instance.wiki.label;
name = instances.wiki.label;
url = "https://${instances.wiki.subdomain}.${instances.web.domains.url1}";
tags = [instances.wiki.name "vault"];
keyword = instances.wiki.label;
}
];
}

View file

@ -4,7 +4,7 @@
...
}: let
user = config.home.username;
userConfig = flake.config.people.user.${user};
userConfig = flake.config.people.users.${user};
in {
programs.git = {
enable = true;

View file

@ -1,5 +1,5 @@
{flake, ...}: let
inherit (flake.config.service.instance) ollama web;
inherit (flake.config.services.instances) ollama web;
service = ollama;
localhost = web.localhost.address0;
in {

View file

@ -1,5 +1,5 @@
{flake, ...}: let
inherit (flake.config.system.device) printer0 printer1;
inherit (flake.config.machines.devices) printer0 printer1;
genericPPD = "drv:///sample.drv/generic.ppd";
pageSize = "Letter";
in {

View file

@ -4,18 +4,18 @@
...
}: let
inherit (flake.config.people) user0;
inherit (flake.config.people.user.${user0}) email;
inherit (flake.config.service) instance;
inherit (flake.config.people.users.${user0}) email;
inherit (flake.config.services) instances;
domain0 = instance.web.domains.url0;
domain1 = instance.web.domains.url1;
dns = instance.web.dns.provider0;
domain0 = instances.web.domains.url0;
domain1 = instances.web.domains.url1;
dns = instances.web.dns.provider0;
instanceName = service: (instance.${service}.subdomain);
instanceName = service: (instances.${service}.subdomain);
dnsConfig = {
dnsProvider = dns;
directory = instance.acme.paths.path0;
directory = instances.acme.paths.path0;
environmentFile = config.sops.secrets."dns/namecheap".path;
};
in {
@ -68,7 +68,7 @@ in {
sops = let
sopsSecrets = ["pass"];
sopsPath = secret: {
path = "/var/lib/secrets/${instance.acme.name}/${dns}-${secret}";
path = "/var/lib/secrets/${instances.acme.name}/${dns}-${secret}";
owner = "root";
mode = "600";
};

View file

@ -1,5 +1,5 @@
{flake, ...}: let
inherit (flake.config.service.instance) caddy web;
inherit (flake.config.services.instances) caddy web;
domain0 = web.domains.url0;

View file

@ -3,8 +3,8 @@
config,
...
}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) castopod nginx web;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) castopod nginx web;
service = castopod;
localhost = web.localhost.address0;
host = "${service.subdomain}.${web.domains.url1}";

View file

@ -3,8 +3,8 @@
config,
...
}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) forgejo web;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) forgejo web;
service = forgejo;
localhost = web.localhost.address0;
host = "${service.subdomain}.${web.domains.url1}";

View file

@ -1,7 +1,7 @@
{flake, ...}: let
inherit (flake.config.people) user0;
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) jellyfin web;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) jellyfin web;
service = jellyfin;
localhost = web.localhost.address0;
host = "${service.subdomain}.${web.domains.url0}";

View file

@ -5,8 +5,8 @@
lib,
...
}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) mastodon web;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) mastodon web;
service = mastodon;
host = web.domains.url1;
localhost = web.localhost.address0;

View file

@ -3,8 +3,8 @@
flake,
...
}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) minecraft;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) minecraft;
service = minecraft;
in {
services = {

View file

@ -5,9 +5,9 @@
...
}: let
inherit (flake.config.people) user0;
inherit (flake.config.people.user.${user0}) name;
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) nextcloud nginx web;
inherit (flake.config.people.users.${user0}) name;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) nextcloud nginx web;
service = nextcloud;
localhost = web.localhost.address0;
host = "${service.subdomain}.${web.domains.url1}";

View file

@ -1,6 +1,6 @@
{flake, ...}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) ollama web;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) ollama web;
service = ollama;
localhost = web.localhost.address0;
host = "${service.subdomain}.${web.domains.url0}";

View file

@ -1,5 +1,5 @@
{flake, ...}: let
inherit (flake.config.service.instance) owncast web;
inherit (flake.config.services.instances) owncast web;
service = owncast;
localhost = web.localhost.address1;
host = "${service.subdomain}.${web.domains.url1}";

View file

@ -4,8 +4,8 @@
pkgs,
...
}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) caddy peertube web;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) caddy peertube web;
service = peertube;
localhost = web.localhost.address0;
host = "${service.subdomain}.${web.domains.url1}";

View file

@ -1,6 +1,6 @@
{flake, ...}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) postgresql;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) postgresql;
service = postgresql;
in {

View file

@ -3,7 +3,7 @@
flake,
...
}: let
inherit (flake.config.service.instance) samba jellyfin;
inherit (flake.config.services.instances) samba jellyfin;
service = samba;
in {
# If you ever need to start fresh, you need to add yourself to the Samba users database:

View file

@ -3,7 +3,7 @@
config,
...
}: let
inherit (flake.config.service.instance) vaultwarden web;
inherit (flake.config.services.instances) vaultwarden web;
service = vaultwarden;
localhost = web.localhost.address0;
host = "${service.subdomain}.${web.domains.url0}";

View file

@ -3,8 +3,8 @@
config,
...
}: let
inherit (flake.config.system.device) server;
inherit (flake.config.service.instance) web wiki;
inherit (flake.config.machines.devices) server;
inherit (flake.config.services.instances) web wiki;
service = wiki;
localhost = web.localhost.address1;
host = "${service.subdomain}.${web.domains.url1}";

View file

@ -1,6 +1,6 @@
{flake, ...}: let
inherit (flake.config.people) user0;
inherit (flake.config.people.user.${user0}) sshKeys;
inherit (flake.config.people.users.${user0}) sshKeys;
in {
users.users.${user0} = {
openssh.authorizedKeys.keys = sshKeys;

View file

@ -1,6 +1,6 @@
{flake, ...}: let
inherit (flake.config.system.device) nas phone tablet;
inherit (flake.config.service.instance) syncthing web;
inherit (flake.config.machines.devices) nas phone tablet;
inherit (flake.config.services.instances) syncthing web;
service = syncthing;
localhost = web.localhost.address0;
in {

View file

@ -5,7 +5,7 @@
...
}: let
inherit (flake.config.people) user0;
inherit (flake.config.people.user.${user0}) name paths;
inherit (flake.config.people.users.${user0}) name paths;
hostname = config.networking.hostName;
in {

View file

@ -6,7 +6,7 @@
}: let
hostname = config.networking.hostName;
inherit (flake.config.people) user1;
inherit (flake.config.people.user.${user1}) name;
inherit (flake.config.people.users.${user1}) name;
in {
users = {
users.${user1} = {

View file

@ -4,8 +4,8 @@
...
}: let
inherit (flake.config.people) user0 user1;
inherit (flake.config.system.device) desktop server nas;
inherit (flake.config.service.instance) samba;
inherit (flake.config.machines.devices) desktop server nas;
inherit (flake.config.services.instances) samba;
synologySecrets = config.sops.secrets."network/synology".path;
serverSecrets = config.sops.secrets."network/server".path;

View file

@ -3,7 +3,7 @@
flake,
...
}: let
inherit (flake.config.system.device) desktop;
inherit (flake.config.machines.devices) desktop;
in {
networking = {
hostName = desktop.name;

View file

@ -1,6 +1,6 @@
{flake, ...}: let
inherit (flake.config.people) user0;
inherit (flake.config.people.user.${user0}) paths;
inherit (flake.config.people.users.${user0}) paths;
in {
sops = {
secrets = {

View file

@ -4,8 +4,8 @@
...
}: let
inherit (flake.config.people) user0 user1;
inherit (flake.config.system.device) laptop nas server;
inherit (flake.config.service.instance) samba;
inherit (flake.config.machines.devices) laptop nas server;
inherit (flake.config.services.instances) samba;
synologySecrets = config.sops.secrets."network/synology".path;
serverSecrets = config.sops.secrets."network/server".path;

View file

@ -3,7 +3,7 @@
flake,
...
}: let
inherit (flake.config.system.device) laptop;
inherit (flake.config.machines.devices) laptop;
in {
networking = {
hostName = laptop.name;

View file

@ -4,7 +4,7 @@
...
}: let
inherit (flake.config.people) user0;
inherit (flake.config.system.device) server;
inherit (flake.config.machines.devices) server;
in {
fileSystems = let
storageDrives = [

View file

@ -3,7 +3,7 @@
flake,
...
}: let
inherit (flake.config.system.device) server;
inherit (flake.config.machines.devices) server;
in {
networking = {
hostName = server.name;