From 181985484d4bd0b446c19221d3aa74e9464d1e57 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 18 Feb 2024 00:10:05 -0500 Subject: [PATCH] feat(arion): add homepage setup --- devices/nas/modules/arion/default.nix | 1 + .../nas/modules/arion/homepage/compose.nix | 58 ++++ .../arion/homepage/images/homepage.nix | 8 + .../nas/modules/arion/homepage/services.nix | 267 ++++++++++++++++++ flake.lock | 8 +- 5 files changed, 338 insertions(+), 4 deletions(-) create mode 100644 devices/nas/modules/arion/homepage/compose.nix create mode 100644 devices/nas/modules/arion/homepage/images/homepage.nix create mode 100644 devices/nas/modules/arion/homepage/services.nix diff --git a/devices/nas/modules/arion/default.nix b/devices/nas/modules/arion/default.nix index aca5942..c37afe9 100644 --- a/devices/nas/modules/arion/default.nix +++ b/devices/nas/modules/arion/default.nix @@ -5,6 +5,7 @@ in { ../../../../modules/arion.nix ./forgejo/compose.nix + ./homepage/compose.nix ./music/jbots/compose.nix ]; diff --git a/devices/nas/modules/arion/homepage/compose.nix b/devices/nas/modules/arion/homepage/compose.nix new file mode 100644 index 0000000..7d120f9 --- /dev/null +++ b/devices/nas/modules/arion/homepage/compose.nix @@ -0,0 +1,58 @@ +{config, ...}: let + inherit (config.arion) toYAML; + inherit (config.sops) secrets; +in { + arion.projects."homepage" = { + "homepage" = { + image = ./images/homepage.nix; + restart = "always"; + + ports = [ + "3020:3000" + ]; + + env_file = [secrets.homepage.path]; + + volumes = let + services = toYAML "services.yaml" (import ./services.nix); + + bookmarks = toYAML "bookmarks.yaml" {}; + + settings = toYAML "settings.yaml" { + # FIXME: title not working + title = "bruh"; + theme = "dark"; + color = "gray"; + target = "_self"; + + layout.video = { + style = "columns"; + row = 4; + # columns = 2; + }; + }; + + widgets = toYAML "widgets.yaml" [ + { + resources = { + cpu = true; + memory = true; + disk = "/"; + }; + } + { + search = { + provider = "duckduckgo"; + target = "_blank"; + }; + } + ]; + in [ + "${bookmarks}:/app/config/bookmarks.yaml:ro" + "${services}:/app/config/services.yaml:ro" + "${settings}:/app/config/settings.yaml:ro" + "${widgets}:/app/config/widgets.yaml:ro" + ]; + }; + }; +} diff --git a/devices/nas/modules/arion/homepage/images/homepage.nix b/devices/nas/modules/arion/homepage/images/homepage.nix new file mode 100644 index 0000000..69c59f3 --- /dev/null +++ b/devices/nas/modules/arion/homepage/images/homepage.nix @@ -0,0 +1,8 @@ +pkgs: +pkgs.dockerTools.pullImage { + imageName = "ghcr.io/gethomepage/homepage"; + imageDigest = "sha256:0f066a6d6fba3a810a85aa79a483302b0fee21139b67adaeb245edae5051f3e8"; + sha256 = "1isj9xai2m723g1m6ma2x8g11j6cb8g9jpvrlg3z6m8jhdnn33d7"; + finalImageName = "ghcr.io/gethomepage/homepage"; + finalImageTag = "latest"; +} diff --git a/devices/nas/modules/arion/homepage/services.nix b/devices/nas/modules/arion/homepage/services.nix new file mode 100644 index 0000000..299f1b2 --- /dev/null +++ b/devices/nas/modules/arion/homepage/services.nix @@ -0,0 +1,267 @@ +[ + ##################################################### + ## PUBLIC + ##################################################### + { + public = [ + { + jellyfin = rec { + href = "https://jelly.nelim.org"; + icon = "jellyfin.png"; + description = "ourflix"; + widget = { + type = "jellyfin"; + url = href; + key = "{{HOMEPAGE_VAR_JELLY_API}}"; + }; + }; + } + { + accounts = { + href = "https://jelly.nelim.org/accounts"; + icon = "jellyfin.png"; + description = "manage jellyfin users"; + }; + } + { + jellyseerr = rec { + href = "https://seerr.nelim.org"; + icon = "jellyseerr.png"; + description = "request handler"; + widget = { + type = "jellyseerr"; + url = href; + key = "{{HOMEPAGE_VAR_SEERR_API}}"; + }; + }; + } + { + gitea = { + href = "https://git.nelim.org"; + icon = "gitea.png"; + description = "git"; + }; + } + { + immich = rec { + href = "https://photos.nelim.org"; + icon = "immich.png"; + description = "gphotos replacement"; + widget = { + type = "immich"; + url = href; + key = "{{HOMEPAGE_VAR_IMMICH_API}}"; + }; + }; + } + { + gameyfin = { + href = "https://games.nelim.org"; + description = "steam (tm)"; + }; + } + { + nextcloud = rec { + href = "https://cloud.nelim.org"; + icon = "nextcloud.png"; + description = "PDrive"; + widget = { + type = "nextcloud"; + url = href; + username = "mathis"; + password = "{{HOMEPAGE_VAR_CLOUD_PASS}}"; + }; + }; + } + { + "public vaultwarden" = { + href = "https://vault.nelim.org"; + icon = "bitwarden.png"; + description = "password manager"; + }; + } + { + calibre-web = { + href = "https://books.nelim.org"; + icon = "calibreweb.png"; + description = "online library"; + }; + } + ]; + } + ##################################################### + ## VIDEO AUTOMATION + ##################################################### + { + "video automation" = [ + { + qbit = rec { + href = "https://lan.nelim.org/qbt"; + icon = "qbittorrent.png"; + description = "torrent client"; + widget = { + type = "qbittorrent"; + url = href; + username = "admin"; + password = "{{HOMEPAGE_VAR_QBIT_PASS}}"; + }; + }; + } + { + sabnzbd = rec { + href = "https://lan.nelim.org/sabnzbd"; + icon = "sabnzbd.png"; + description = "nzb client"; + widget = { + type = "sabnzbd"; + url = href; + key = "{{HOMEPAGE_VAR_SAB_API}}"; + }; + }; + } + { + sonarr = rec { + href = "https://lan.nelim.org/sonarr"; + icon = "sonarr.png"; + description = "fetches tv shows"; + widget = { + type = "sonarr"; + url = href; + key = "{{HOMEPAGE_VAR_SONARR_API}}"; + }; + }; + } + { + radarr = rec { + href = "https://lan.nelim.org/radarr"; + icon = "radarr.png"; + description = "fetches movies"; + widget = { + type = "radarr"; + url = href; + key = "{{HOMEPAGE_VAR_RADARR_API}}"; + }; + }; + } + { + bazarr = rec { + href = "https://lan.nelim.org/bazarr"; + icon = "bazarr.png"; + description = "fetches subs"; + widget = { + type = "bazarr"; + url = href; + key = "{{HOMEPAGE_VAR_BAZARR_API}}"; + }; + }; + } + { + "bazarr french" = rec { + href = "https://lan.nelim.org/bafrr"; + icon = "bazarr.png"; + description = "fetches subs"; + widget = { + type = "bazarr"; + url = href; + key = "{{HOMEPAGE_VAR_BAZARRFR_API}}"; + }; + }; + } + { + prowlarr = rec { + href = "https://lan.nelim.org/prowlarr"; + icon = "prowlarr.png"; + description = "fetches tracker queries"; + widget = { + type = "prowlarr"; + url = href; + key = "{{HOMEPAGE_VAR_PROWLARR_API}}"; + }; + }; + } + { + joal = { + href = "https://joal.nelim.org"; + icon = "joal.png"; + description = "boosts YGGTorrent ratio"; + }; + } + ]; + } + ##################################################### + ## MISC PROJECTS + ##################################################### + { + "misc projects" = [ + { + freshrss = { + href = "https://rss.nelim.org"; + icon = "freshrss.png"; + description = "rss client"; + }; + } + { + docker-hub-rss = { + href = "https://drss.nelim.org"; + icon = "freshrss.png"; + description = "dockerhub feed maker"; + }; + } + { + calibre = { + href = "https://lan.nelim.org/calibre"; + icon = "calibre.png"; + description = "library backend"; + }; + } + ]; + } + ##################################################### + ## MANAGEMENT + ##################################################### + { + management = [ + { + cloudflare = { + href = "https://dash.cloudflare.com/3152abbe78daf6d91c57b6fcc424f958/nelim.org/dns"; + icon = "cloudflare.png"; + description = "dns to the world"; + }; + } + { + vaultwarden = { + href = "https://lan.nelim.org/vault"; + icon = "bitwarden.png"; + description = "password manager"; + }; + } + { + wireguard = { + href = "https://wg.nelim.org"; + icon = "wireguard.png"; + description = "wireguard gui"; + }; + } + { + steampunk = { + icon = "minecraft.png"; + description = "minecwaf"; + widget = { + type = "minecraft"; + url = "udp://mc.nelim.org"; + }; + }; + } + { + creative = { + icon = "minecraft.png"; + description = "minecwaf"; + widget = { + type = "minecraft"; + url = "udp://cv.nelim.org"; + }; + }; + } + ]; + } +] diff --git a/flake.lock b/flake.lock index 4eb3cec..10693fa 100644 --- a/flake.lock +++ b/flake.lock @@ -1274,11 +1274,11 @@ "sops-nix": "sops-nix" }, "locked": { - "lastModified": 1707423613, - "narHash": "sha256-rGiSc2fyGie91dNA8GxdJbGE4PTLh1TIgd96DiJnazM=", + "lastModified": 1708231529, + "narHash": "sha256-BAYVOr3jmamIAR8E/PZxcSM33do0JCsUFiuMO04HRXQ=", "ref": "refs/heads/main", - "rev": "f6873a5ce3dc73f6f9b8cc2a28874c7550fe5f98", - "revCount": 39, + "rev": "98afa3adce5e38f91f9c733c154784aabbba00d5", + "revCount": 40, "type": "git", "url": "ssh://git@git.nelim.org/matt1432/nixos-secrets" },