Simplify nixedo modules
This commit is contained in:
parent
791d206764
commit
828985d76f
6 changed files with 102 additions and 154 deletions
|
@ -29,14 +29,6 @@
|
||||||
./modules/paperless.nix
|
./modules/paperless.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixosModules = {
|
|
||||||
audiobookshelf.enable = true;
|
|
||||||
immich.enable = true;
|
|
||||||
jellyfin.enable = true;
|
|
||||||
paperless.enable = true;
|
|
||||||
pihole.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
services.logind.lidSwitchExternalPower = "ignore";
|
services.logind.lidSwitchExternalPower = "ignore";
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
{ config, lib, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.nixosModules.audiobookshelf;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.nixosModules.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf";
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
services = {
|
services = {
|
||||||
audiobookshelf = {
|
audiobookshelf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -22,5 +14,4 @@ in
|
||||||
extraConfig = "reverse_proxy localhost:${toString config.services.audiobookshelf.port}";
|
extraConfig = "reverse_proxy localhost:${toString config.services.audiobookshelf.port}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,9 @@
|
||||||
{
|
{ pkgs, lib, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
port = 8082;
|
port = 8082;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.nixosModules.pihole.enable = mkEnableOption "Enable pihole";
|
|
||||||
|
|
||||||
config = mkIf config.nixosModules.pihole.enable {
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
docker = {
|
docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -97,5 +87,4 @@ in
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,19 @@
|
||||||
{
|
{ config, pkgs, ... }:
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
options.nixosModules.immich.enable = mkEnableOption "Enable immich";
|
services = {
|
||||||
|
immich = {
|
||||||
config = mkIf config.nixosModules.immich.enable {
|
|
||||||
services.immich = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
group = "media";
|
group = "media";
|
||||||
mediaLocation = "/mnt/media/immich";
|
mediaLocation = "/mnt/media/immich";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.immich-cli ];
|
caddy.virtualHosts."immich.oliverdavies.uk" = {
|
||||||
|
|
||||||
services.caddy.virtualHosts."immich.oliverdavies.uk" = {
|
|
||||||
useACMEHost = "oliverdavies.uk";
|
useACMEHost = "oliverdavies.uk";
|
||||||
|
|
||||||
extraConfig = "reverse_proxy localhost:${toString config.services.immich.port}";
|
extraConfig = "reverse_proxy localhost:${toString config.services.immich.port}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.immich-cli ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
options.nixosModules.jellyfin.enable = mkEnableOption "Enable jellyfin";
|
services = {
|
||||||
|
jellyfin = {
|
||||||
config = mkIf config.nixosModules.jellyfin.enable {
|
|
||||||
services.jellyfin = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
group = "media";
|
group = "media";
|
||||||
configDir = "/mnt/media/jellyfin";
|
configDir = "/mnt/media/jellyfin";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.caddy.virtualHosts."jellyfin.oliverdavies.uk" = {
|
caddy.virtualHosts."jellyfin.oliverdavies.uk" = {
|
||||||
useACMEHost = "oliverdavies.uk";
|
useACMEHost = "oliverdavies.uk";
|
||||||
|
|
||||||
extraConfig = "reverse_proxy localhost:8096";
|
extraConfig = "reverse_proxy localhost:8096";
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
{ config, lib, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
url = "paperless.oliverdavies.uk";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.nixosModules.paperless.enable = mkEnableOption "Enable paperless";
|
|
||||||
|
|
||||||
config = mkIf config.nixosModules.paperless.enable {
|
|
||||||
services = {
|
services = {
|
||||||
paperless = {
|
paperless = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -16,15 +8,14 @@ in
|
||||||
dataDir = "/mnt/media/paperless";
|
dataDir = "/mnt/media/paperless";
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
PAPERLESS_URL = "https://${url}";
|
PAPERLESS_URL = "https://paperless.oliverdavies.uk";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
caddy.virtualHosts."${url}" = {
|
caddy.virtualHosts."${config.services.paperless.settings.PAPERLESS_URL}" = {
|
||||||
useACMEHost = "oliverdavies.uk";
|
useACMEHost = "oliverdavies.uk";
|
||||||
|
|
||||||
extraConfig = "reverse_proxy localhost:28981";
|
extraConfig = "reverse_proxy localhost:28981";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue