Compare commits

..

No commits in common. "9b02e300801a0db6e2e7c3911af2843776099e56" and "cdeb4e108b4604acf9ec15bd2e9bcfb906a2f0a2" have entirely different histories.

17 changed files with 75 additions and 85 deletions

View file

@ -43,6 +43,7 @@ nix multi user, multi system, configuration with `sops` secret management, `home
- Look into this for auto rotating sops keys `https://technotim.live/posts/rotate-sops-encryption-keys/` - Look into this for auto rotating sops keys `https://technotim.live/posts/rotate-sops-encryption-keys/`
- Look into this for npins https://jade.fyi/blog/pinning-nixos-with-npins/ - Look into this for npins https://jade.fyi/blog/pinning-nixos-with-npins/
- https://nixos-and-flakes.thiscute.world/ - https://nixos-and-flakes.thiscute.world/
- nix config mcp https://github.com/utensils/mcp-nixos
# Tasks: # Tasks:
@ -69,4 +70,4 @@ nix multi user, multi system, configuration with `sops` secret management, `home
- ISO target that contains authorized keys for nixos-anywhere https://github.com/diegofariasm/yggdrasil/blob/4acc43ebc7bcbf2e41376d14268e382007e94d78/hosts/bootstrap/default.nix - ISO target that contains authorized keys for nixos-anywhere https://github.com/diegofariasm/yggdrasil/blob/4acc43ebc7bcbf2e41376d14268e382007e94d78/hosts/bootstrap/default.nix
- panoramax instance - panoramax instance
- mastodon instance - mastodon instance
- move searx, home-assistant, actual, jellyfin, paperless, and immich to only be accessible via vpn - move searx, jellyfin, paperless, and immich to only be accessible via vpn

View file

@ -12,6 +12,14 @@ in {
./impermanence.nix ./impermanence.nix
]; ];
options.services.actual = {
subdomain = lib.mkOption {
type = lib.types.str;
default = "actual";
description = "subdomain of base domain that actual will be hosted at";
};
};
config = lib.mkIf config.services.actual.enable { config = lib.mkIf config.services.actual.enable {
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d ${dataDirectory} 2770 actual actual" "d ${dataDirectory} 2770 actual actual"

View file

@ -3,14 +3,6 @@
config, config,
... ...
}: { }: {
options.services.actual = {
subdomain = lib.mkOption {
type = lib.types.str;
default = "actual";
description = "subdomain of base domain that actual will be hosted at";
};
};
config = lib.mkIf (config.services.actual.enable && config.host.reverse_proxy.enable) { config = lib.mkIf (config.services.actual.enable && config.host.reverse_proxy.enable) {
host = { host = {
reverse_proxy.subdomains.${config.services.actual.subdomain} = { reverse_proxy.subdomains.${config.services.actual.subdomain} = {

View file

@ -15,6 +15,14 @@ in {
./impermanence.nix ./impermanence.nix
]; ];
options.services.forgejo = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that forgejo will be hosted at";
default = "forgejo";
};
};
config = lib.mkIf config.services.forgejo.enable { config = lib.mkIf config.services.forgejo.enable {
assertions = [ assertions = [
{ {

View file

@ -6,14 +6,6 @@
const = import ./const.nix; const = import ./const.nix;
httpPort = const.httpPort; httpPort = const.httpPort;
in { in {
options.services.forgejo = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that forgejo will be hosted at";
default = "forgejo";
};
};
config = lib.mkIf (config.services.forgejo.enable && config.host.reverse_proxy.enable) { config = lib.mkIf (config.services.forgejo.enable && config.host.reverse_proxy.enable) {
host.reverse_proxy.subdomains.${config.services.forgejo.subdomain} = { host.reverse_proxy.subdomains.${config.services.forgejo.subdomain} = {
target = "http://localhost:${toString httpPort}"; target = "http://localhost:${toString httpPort}";

View file

@ -12,6 +12,12 @@
]; ];
options.services.home-assistant = { options.services.home-assistant = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that home-assistant will be hosted at";
default = "home-assistant";
};
database = lib.mkOption { database = lib.mkOption {
type = lib.types.enum [ type = lib.types.enum [
"builtin" "builtin"

View file

@ -2,16 +2,8 @@
lib, lib,
config, config,
... ...
}: { }:
options.services.home-assistant = { lib.mkIf (config.host.reverse_proxy.enable && config.services.home-assistant.enable) {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that home-assistant will be hosted at";
default = "home-assistant";
};
};
config = lib.mkIf (config.host.reverse_proxy.enable && config.services.home-assistant.enable) {
host = { host = {
reverse_proxy.subdomains.${config.services.home-assistant.subdomain} = { reverse_proxy.subdomains.${config.services.home-assistant.subdomain} = {
target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}"; target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}";
@ -29,5 +21,4 @@
''; '';
}; };
}; };
};
} }

View file

@ -1,4 +1,4 @@
{...}: { {lib, ...}: {
imports = [ imports = [
./proxy.nix ./proxy.nix
./database.nix ./database.nix
@ -6,6 +6,14 @@
./impermanence.nix ./impermanence.nix
]; ];
options.services.immich = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that immich will be hosted at";
default = "immich";
};
};
# NOTE: This shouldn't be needed now that we are out of testing # NOTE: This shouldn't be needed now that we are out of testing
# config = lib.mkIf config.services.immich.enable { # config = lib.mkIf config.services.immich.enable {
# networking.firewall.interfaces.${config.services.tailscale.interfaceName} = { # networking.firewall.interfaces.${config.services.tailscale.interfaceName} = {

View file

@ -3,14 +3,6 @@
config, config,
... ...
}: { }: {
options.services.immich = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that immich will be hosted at";
default = "immich";
};
};
config = lib.mkIf (config.services.immich.enable && config.host.reverse_proxy.enable) { config = lib.mkIf (config.services.immich.enable && config.host.reverse_proxy.enable) {
host = { host = {
reverse_proxy.subdomains.${config.services.immich.subdomain} = { reverse_proxy.subdomains.${config.services.immich.subdomain} = {

View file

@ -14,6 +14,16 @@ in {
]; ];
options.services.jellyfin = { options.services.jellyfin = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that jellyfin will be hosted at";
default = "jellyfin";
};
extraSubdomains = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "ex subdomain of base domain that jellyfin will be hosted at";
default = [];
};
media_directory = lib.mkOption { media_directory = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "directory jellyfin media will be hosted at"; description = "directory jellyfin media will be hosted at";

View file

@ -5,19 +5,6 @@
}: let }: let
jellyfinPort = 8096; jellyfinPort = 8096;
in { in {
options.services.jellyfin = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that jellyfin will be hosted at";
default = "jellyfin";
};
extraSubdomains = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "ex subdomain of base domain that jellyfin will be hosted at";
default = [];
};
};
config = lib.mkIf (config.services.jellyfin.enable && config.host.reverse_proxy.enable) { config = lib.mkIf (config.services.jellyfin.enable && config.host.reverse_proxy.enable) {
host.reverse_proxy.subdomains.jellyfin = { host.reverse_proxy.subdomains.jellyfin = {
target = "http://localhost:${toString jellyfinPort}"; target = "http://localhost:${toString jellyfinPort}";

View file

@ -57,6 +57,12 @@ in {
description = "The panoramax package to use"; description = "The panoramax package to use";
}; };
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that panoramax will be hosted at";
default = "panoramax";
};
database = { database = {
createDB = mkOption { createDB = mkOption {
type = types.bool; type = types.bool;

View file

@ -3,14 +3,6 @@
config, config,
... ...
}: { }: {
options.services.panoramax = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that panoramax will be hosted at";
default = "panoramax";
};
};
config = lib.mkIf (config.services.panoramax.enable && config.host.reverse_proxy.enable) { config = lib.mkIf (config.services.panoramax.enable && config.host.reverse_proxy.enable) {
host = { host = {
reverse_proxy.subdomains.${config.services.panoramax.subdomain} = { reverse_proxy.subdomains.${config.services.panoramax.subdomain} = {

View file

@ -11,6 +11,11 @@
]; ];
options.services.paperless = { options.services.paperless = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that paperless will be hosted at";
default = "paperless";
};
database = { database = {
user = lib.mkOption { user = lib.mkOption {
type = lib.types.str; type = lib.types.str;

View file

@ -3,14 +3,6 @@
lib, lib,
... ...
}: { }: {
options.services.paperless = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that paperless will be hosted at";
default = "paperless";
};
};
config = lib.mkIf (config.services.paperless.enable && config.host.reverse_proxy.enable) { config = lib.mkIf (config.services.paperless.enable && config.host.reverse_proxy.enable) {
host = { host = {
reverse_proxy.subdomains.${config.services.paperless.subdomain} = { reverse_proxy.subdomains.${config.services.paperless.subdomain} = {

View file

@ -8,6 +8,14 @@
./proxy.nix ./proxy.nix
]; ];
options.services.searx = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that searx will be hosted at";
default = "searx";
};
};
config = lib.mkIf config.services.searx.enable { config = lib.mkIf config.services.searx.enable {
sops.secrets = { sops.secrets = {
"services/searx" = { "services/searx" = {

View file

@ -3,14 +3,6 @@
lib, lib,
... ...
}: { }: {
options.services.searx = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that searx will be hosted at";
default = "searx";
};
};
config = lib.mkIf (config.services.searx.enable && config.host.reverse_proxy.enable) { config = lib.mkIf (config.services.searx.enable && config.host.reverse_proxy.enable) {
host = { host = {
reverse_proxy.subdomains.searx = { reverse_proxy.subdomains.searx = {