feat: Add homepage module
This commit is contained in:
parent
d38c53762a
commit
5582384f01
3 changed files with 84 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
./changedetection
|
||||
./freshrss
|
||||
./gitea
|
||||
./homepage
|
||||
./jellyfin
|
||||
./plex
|
||||
./speedtest
|
||||
|
|
|
|||
79
modules/apps/homepage/default.nix
Normal file
79
modules/apps/homepage/default.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homelab.apps.homepage;
|
||||
|
||||
PUID = toString config.users.users.homepage.uid;
|
||||
PGID = toString config.users.groups.apps.gid;
|
||||
|
||||
homepage-config = "/srv/homepage-config";
|
||||
|
||||
proxyNet = config.homelab.apps.traefik.sharedNetworkName;
|
||||
in {
|
||||
options.homelab.apps.homepage = {
|
||||
enable = lib.mkEnableOption "homepage";
|
||||
port = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 3000;
|
||||
description = "homepage WebUI port";
|
||||
};
|
||||
exposePort = lib.mkEnableOption "expose homepage port";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
homelab = {
|
||||
users.apps.enable = true;
|
||||
virtualisation.containers.enable = true;
|
||||
};
|
||||
|
||||
users.users.homepage = {
|
||||
uid = lib.mkForce 3018;
|
||||
isSystemUser = true;
|
||||
group = config.users.groups.apps.name;
|
||||
home = "/var/empty";
|
||||
shell = null;
|
||||
};
|
||||
|
||||
fileSystems."${homepage-config}" = {
|
||||
device = "192.168.0.11:/mnt/SMALL/CONFIG/HOMEPAGE";
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"rw"
|
||||
"auto"
|
||||
"nfsvers=4.2"
|
||||
"async" "soft" "timeo=100" "retry=50" "actimeo=1800" "lookupcache=all"
|
||||
"nosuid" "tcp"
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.homepage = let
|
||||
host = "homepage.${config.networking.domain}";
|
||||
in {
|
||||
hostname = "homepage";
|
||||
image = "ghcr.io/gethomepage/homepage:v1.10.1";
|
||||
autoStart = true;
|
||||
user = "${toString PUID}:${toString PGID}";
|
||||
ports = lib.mkIf cfg.exposePort [
|
||||
"${toString cfg.port}:3000/tcp"
|
||||
];
|
||||
networks = [
|
||||
proxyNet
|
||||
];
|
||||
volumes = [
|
||||
"${homepage-config}:/app/config"
|
||||
# "/var/run/docker.sock:/var/run/docker.sock:ro" # For docker integrations
|
||||
];
|
||||
labels = {
|
||||
"traefik.enable" = "true";
|
||||
"traefik.docker.network" = proxyNet;
|
||||
"traefik.http.routers.homepage.rule" = "Host(`${host}`)";
|
||||
"traefik.http.services.homepage.loadbalancer.server.port" = toString cfg.port;
|
||||
};
|
||||
environment = {
|
||||
inherit PUID PGID;
|
||||
|
||||
HOMEPAGE_ALLOWED_HOSTS = "${host},192.168.0.91:3000";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue