Update config and option names for modules

This commit is contained in:
Oliver Davies 2025-04-30 03:09:17 +01:00
parent fe508bd127
commit bb9b77e2f8
54 changed files with 122 additions and 120 deletions

View file

@ -8,6 +8,7 @@
imports = [
../common
./hardware-configuration.nix
./homelab.nix
./modules
./secrets.nix
./services
@ -15,31 +16,10 @@
../../users/opdavies.nix
];
nixosModules = {
features = {
core.openssh.enable = true;
cli.podman.enable = true;
desktop.dconf.enable = true;
homelab = {
enable = true;
baseDomain = "oliverdavies.uk";
services = {
audiobookshelf.enable = true;
forgejo = {
enable = true;
cloudflared.tunnelId = "e1514105-327f-4984-974e-e2fbaca76466";
};
immich.enable = true;
jellyfin.enable = true;
paperless.enable = true;
uptime-kuma.enable = true;
};
};
};
services.logind.lidSwitchExternalPower = "ignore";

22
hosts/nixedo/homelab.nix Normal file
View file

@ -0,0 +1,22 @@
{
features.homelab = {
enable = true;
baseDomain = "oliverdavies.uk";
services = {
audiobookshelf.enable = true;
forgejo = {
enable = true;
cloudflared.tunnelId = "e1514105-327f-4984-974e-e2fbaca76466";
};
immich.enable = true;
jellyfin.enable = true;
paperless.enable = true;
uptime-kuma.enable = true;
};
};
}

View file

@ -4,11 +4,11 @@ with lib;
let
cfg = homelab.services.${service};
homelab = config.nixosModules.homelab;
homelab = config.features.homelab;
service = "audiobookshelf";
in
{
options.nixosModules.homelab.services.${service} = {
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
url = mkOption {
@ -26,7 +26,7 @@ in
useACMEHost = homelab.baseDomain;
locations."/" = {
proxyPass = "http://localhost:${toString cfg.port}";
proxyPass = "http://localhost:${toString config.services.${service}.port}";
recommendedProxySettings = true;
};
};

View file

@ -3,7 +3,7 @@
with lib;
{
options.nixosModules.homelab = {
options.features.homelab = {
enable = mkEnableOption "Enable homelab services and configuration";
baseDomain = mkOption {

View file

@ -4,11 +4,11 @@ with lib;
let
cfg = homelab.services.${service};
homelab = config.nixosModules.homelab;
homelab = config.features.homelab;
service = "forgejo";
in
{
options.nixosModules.homelab.services.${service} = {
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
cloudflared.tunnelId = mkOption {

View file

@ -9,11 +9,11 @@ with lib;
let
cfg = homelab.services.${service};
homelab = config.nixosModules.homelab;
homelab = config.features.homelab;
service = "immich";
in
{
options.nixosModules.homelab.services.${service} = {
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
url = mkOption {

View file

@ -4,11 +4,11 @@ with lib;
let
cfg = homelab.services.${service};
homelab = config.nixosModules.homelab;
homelab = config.features.homelab;
service = "jellyfin";
in
{
options.nixosModules.homelab.services.${service} = {
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
url = mkOption {

View file

@ -4,11 +4,11 @@ with lib;
let
cfg = homelab.services.paperless;
homelab = config.nixosModules.homelab;
homelab = config.features.homelab;
service = "paperless";
in
{
options.nixosModules.homelab.services.${service} = {
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
url = mkOption {

View file

@ -9,12 +9,12 @@ with lib;
let
cfg = homelab.services.${service};
homelab = config.homelab;
homelab = config.features.homelab;
opts = options.services.${service};
service = "homepage-dashboard";
in
{
options.homelab.services.${service} = {
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
port = mkOption {

View file

@ -4,11 +4,11 @@ with lib;
let
cfg = homelab.services.${service};
homelab = config.nixosModules.homelab;
homelab = config.features.homelab;
service = "uptime-kuma";
in
{
options.nixosModules.homelab.services.${service} = {
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
url = mkOption {