fmt
This commit is contained in:
@@ -138,7 +138,7 @@
|
|||||||
# variable assignments for simple strings (e.g. username=admin).
|
# variable assignments for simple strings (e.g. username=admin).
|
||||||
# shellcheck SC2209 flags this as a warning, breaking the build when
|
# shellcheck SC2209 flags this as a warning, breaking the build when
|
||||||
# the value matches a command name. Exclude SC2209 globally.
|
# the value matches a command name. Exclude SC2209 globally.
|
||||||
(final: prev: {
|
(_final: prev: {
|
||||||
writeShellApplication =
|
writeShellApplication =
|
||||||
args:
|
args:
|
||||||
prev.writeShellApplication (
|
prev.writeShellApplication (
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ in
|
|||||||
desktop.plasma = enabled;
|
desktop.plasma = enabled;
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
opencode = enabled;
|
||||||
thunderbird = enabled;
|
thunderbird = enabled;
|
||||||
hyprland = {
|
hyprland = {
|
||||||
enable = false;
|
enable = false;
|
||||||
|
|||||||
@@ -147,6 +147,20 @@ rec {
|
|||||||
"Extra environment variables passed to the service";
|
"Extra environment variables passed to the service";
|
||||||
|
|
||||||
reverseProxy = mkReverseProxyOpt name;
|
reverseProxy = mkReverseProxyOpt name;
|
||||||
|
|
||||||
|
hostedService = {
|
||||||
|
enable = mkBoolOpt false "Expose this service in Glance dashboard";
|
||||||
|
title = mkOpt types.str name "Display title in Glance";
|
||||||
|
icon = mkOpt types.str "si:glance" "Icon identifier for Glance (e.g. si:actualbudget)";
|
||||||
|
group = mkOpt types.str "Services" "Glance group/category for this service";
|
||||||
|
url = mkOpt types.str (
|
||||||
|
if cfg.reverseProxy.enable then
|
||||||
|
"https://${cfg.reverseProxy.subdomain}.${cfg.reverseProxy.domain}"
|
||||||
|
else
|
||||||
|
"http://127.0.0.1:${toString cfg.port}"
|
||||||
|
) "Service URL for Glance (auto-derived from reverseProxy if enabled)";
|
||||||
|
basicAuth = mkOpt types.bool false "Require basic auth for this service in Glance";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
// options;
|
// options;
|
||||||
};
|
};
|
||||||
@@ -298,6 +312,8 @@ rec {
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Option creation helpers
|
# Option creation helpers
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
# Option creation helpers
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
mkOpt =
|
mkOpt =
|
||||||
type: default: description:
|
type: default: description:
|
||||||
|
|||||||
@@ -69,10 +69,11 @@ in
|
|||||||
mission-center
|
mission-center
|
||||||
parted
|
parted
|
||||||
vesktop
|
vesktop
|
||||||
] ++ (
|
]
|
||||||
if isArm then
|
++ (
|
||||||
|
if isArm then
|
||||||
[ ]
|
[ ]
|
||||||
else
|
else
|
||||||
[
|
[
|
||||||
proton-pass
|
proton-pass
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -92,9 +92,7 @@ in
|
|||||||
|
|
||||||
type = mkOpt types.str "wifi" "type of the network.(wifi/ethernet)";
|
type = mkOpt types.str "wifi" "type of the network.(wifi/ethernet)";
|
||||||
|
|
||||||
interface =
|
interface = mkOpt types.str "" "Interface for this profile (defaults to global ipv4.interface).";
|
||||||
mkOpt types.str ""
|
|
||||||
"Interface for this profile (defaults to global ipv4.interface).";
|
|
||||||
|
|
||||||
autoconnect = mkBoolOpt true "autoconnect to this connection";
|
autoconnect = mkBoolOpt true "autoconnect to this connection";
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,130 @@
|
|||||||
namespace,
|
namespace,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
with lib;
|
||||||
let
|
let
|
||||||
name = "glance";
|
name = "glance";
|
||||||
cfg = config.${namespace}.services.${name};
|
cfg = config.${namespace}.services.${name};
|
||||||
net = lib.${namespace}.network;
|
net = lib.${namespace}.network;
|
||||||
|
|
||||||
|
hostedServiceSites =
|
||||||
|
let
|
||||||
|
servicesCfg = config.${namespace}.services;
|
||||||
|
serviceNames = builtins.attrNames servicesCfg;
|
||||||
|
in
|
||||||
|
builtins.concatMap (
|
||||||
|
serviceName:
|
||||||
|
let
|
||||||
|
serviceCfg = servicesCfg.${serviceName};
|
||||||
|
hosted = serviceCfg.hostedService or null;
|
||||||
|
in
|
||||||
|
if hosted != null && hosted.enable then
|
||||||
|
[
|
||||||
|
(
|
||||||
|
{
|
||||||
|
title = hosted.title;
|
||||||
|
url = hosted.url;
|
||||||
|
icon = hosted.icon;
|
||||||
|
}
|
||||||
|
// optionalAttrs hosted.basicAuth {
|
||||||
|
basic-auth = {
|
||||||
|
username = "\${ARR_USER}";
|
||||||
|
password = "\${ARR_PASS}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]
|
||||||
|
else
|
||||||
|
[ ]
|
||||||
|
) serviceNames;
|
||||||
|
|
||||||
|
coreSites = {
|
||||||
|
actual = {
|
||||||
|
title = "Actual";
|
||||||
|
url = "https://actual.mjallen.dev/";
|
||||||
|
icon = "si:actualbudget";
|
||||||
|
};
|
||||||
|
jellyfin = {
|
||||||
|
title = "Jellyfin";
|
||||||
|
url = "https://jellyfin.mjallen.dev/";
|
||||||
|
icon = "si:jellyfin";
|
||||||
|
};
|
||||||
|
gitea = {
|
||||||
|
title = "Gitea";
|
||||||
|
url = "https://gitea.mjallen.dev/";
|
||||||
|
icon = "si:gitea";
|
||||||
|
};
|
||||||
|
nextcloud = {
|
||||||
|
title = "Nextcloud";
|
||||||
|
url = "https://cloud.mjallen.dev/";
|
||||||
|
icon = "si:nextcloud";
|
||||||
|
};
|
||||||
|
immich = {
|
||||||
|
title = "Immich";
|
||||||
|
url = "https://immich.mjallen.dev/";
|
||||||
|
icon = "si:immich";
|
||||||
|
};
|
||||||
|
homeassistant = {
|
||||||
|
title = "Home Assistant";
|
||||||
|
url = "https://hass.mjallen.dev/";
|
||||||
|
icon = "si:homeassistant";
|
||||||
|
};
|
||||||
|
adguard = {
|
||||||
|
title = "AdGuard Home";
|
||||||
|
url = "http://${net.hosts.pi5.lan}:${toString net.ports.pi5.adguard}/";
|
||||||
|
icon = "si:adguard";
|
||||||
|
allow-insecure = true;
|
||||||
|
};
|
||||||
|
manyfold = {
|
||||||
|
title = "Manyfold";
|
||||||
|
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.manyfold}/collections";
|
||||||
|
icon = "sh:manyfold";
|
||||||
|
allow-insecure = true;
|
||||||
|
};
|
||||||
|
code-server = {
|
||||||
|
title = "Code Server";
|
||||||
|
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.codeServer}/";
|
||||||
|
icon = "si:vscodium";
|
||||||
|
allow-insecure = true;
|
||||||
|
};
|
||||||
|
nas-kvm = {
|
||||||
|
title = "NAS KVM";
|
||||||
|
url = "http://nas-kvm.local/";
|
||||||
|
icon = "si:nanokvm";
|
||||||
|
allow-insecure = true;
|
||||||
|
};
|
||||||
|
sonarr = {
|
||||||
|
title = "Sonarr";
|
||||||
|
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.sonarr}/";
|
||||||
|
icon = "si:sonarr";
|
||||||
|
allow-insecure = true;
|
||||||
|
basic-auth = {
|
||||||
|
username = "\${ARR_USER}";
|
||||||
|
password = "\${ARR_PASS}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
radarr = {
|
||||||
|
title = "Radarr";
|
||||||
|
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.radarr}/";
|
||||||
|
icon = "si:radarr";
|
||||||
|
allow-insecure = true;
|
||||||
|
basic-auth = {
|
||||||
|
username = "\${ARR_USER}";
|
||||||
|
password = "\${ARR_PASS}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
sabnzbd = {
|
||||||
|
title = "Sabnzbd";
|
||||||
|
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.sabnzbd}/";
|
||||||
|
icon = "si:sabnzbd";
|
||||||
|
allow-insecure = true;
|
||||||
|
basic-auth = {
|
||||||
|
username = "\${ARR_USER}";
|
||||||
|
password = "\${ARR_PASS}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
glanceConfig = lib.${namespace}.mkModule {
|
glanceConfig = lib.${namespace}.mkModule {
|
||||||
inherit config name;
|
inherit config name;
|
||||||
description = "glance";
|
description = "glance";
|
||||||
@@ -18,6 +137,58 @@ let
|
|||||||
default = cfg.dataDir;
|
default = cfg.dataDir;
|
||||||
description = "Path to the NAS pool mount to display in server-stats.";
|
description = "Path to the NAS pool mount to display in server-stats.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableCoreSites = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable the default core service sites in the monitor widget";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableHostedServices = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Auto-discover services with hostedService.enable and add them to the monitor widget";
|
||||||
|
};
|
||||||
|
|
||||||
|
coreServices = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = builtins.attrNames coreSites;
|
||||||
|
description = "List of core service keys to include (filtered by enableCoreSites)";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraSites = lib.mkOption {
|
||||||
|
type = lib.types.listOf (
|
||||||
|
lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
title = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Display title";
|
||||||
|
};
|
||||||
|
url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Service URL";
|
||||||
|
};
|
||||||
|
icon = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "si:glance";
|
||||||
|
description = "Icon identifier (e.g. si:servicename)";
|
||||||
|
};
|
||||||
|
allow-insecure = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Allow insecure connections";
|
||||||
|
};
|
||||||
|
basic-auth = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Require basic auth (uses ARR credentials)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
default = [ ];
|
||||||
|
description = "Extra sites to display in the monitor widget";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
moduleConfig = {
|
moduleConfig = {
|
||||||
services.glance = {
|
services.glance = {
|
||||||
@@ -33,7 +204,6 @@ let
|
|||||||
{
|
{
|
||||||
name = "Startpage";
|
name = "Startpage";
|
||||||
width = "default";
|
width = "default";
|
||||||
# tab = "First";
|
|
||||||
hide-desktop-navigation = true;
|
hide-desktop-navigation = true;
|
||||||
center-vertically = true;
|
center-vertically = true;
|
||||||
columns = [
|
columns = [
|
||||||
@@ -56,7 +226,7 @@ let
|
|||||||
{
|
{
|
||||||
type = "local";
|
type = "local";
|
||||||
name = "Jallen-NAS";
|
name = "Jallen-NAS";
|
||||||
cpu-temp-sensor = "/sys/devices/pci0000:00/0000:00:08.1/0000:cd:00.0/hwmon/hwmon*/temp1_input"; # Tctl
|
cpu-temp-sensor = "/sys/devices/pci0000:00/0000:00:08.1/0000:cd:00.0/hwmon/hwmon*/temp1_input";
|
||||||
mountpoints = {
|
mountpoints = {
|
||||||
"/home" = {
|
"/home" = {
|
||||||
name = "Home";
|
name = "Home";
|
||||||
@@ -72,7 +242,6 @@ let
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
size = "full";
|
size = "full";
|
||||||
# tab = "First";
|
|
||||||
widgets = [
|
widgets = [
|
||||||
{
|
{
|
||||||
type = "search";
|
type = "search";
|
||||||
@@ -90,101 +259,21 @@ let
|
|||||||
type = "monitor";
|
type = "monitor";
|
||||||
cache = "1m";
|
cache = "1m";
|
||||||
title = "Services";
|
title = "Services";
|
||||||
sites = [
|
sites =
|
||||||
{
|
(if cfg.enableCoreSites then builtins.map (key: coreSites.${key}) cfg.coreServices else [ ])
|
||||||
title = "Actual";
|
++ (if cfg.enableHostedServices then hostedServiceSites else [ ])
|
||||||
url = "https://actual.mjallen.dev/";
|
++ builtins.map (
|
||||||
icon = "si:actualbudget";
|
site:
|
||||||
}
|
{
|
||||||
{
|
title = site.title;
|
||||||
title = "Jellyfin";
|
url = site.url;
|
||||||
url = "https://jellyfin.mjallen.dev/";
|
icon = site.icon;
|
||||||
icon = "si:jellyfin";
|
}
|
||||||
}
|
// optionalAttrs site.allow-insecure { allow-insecure = true; }
|
||||||
{
|
) cfg.extraSites;
|
||||||
title = "Gitea";
|
|
||||||
url = "https://gitea.mjallen.dev/";
|
|
||||||
icon = "si:gitea";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Nextcloud";
|
|
||||||
url = "https://cloud.mjallen.dev/";
|
|
||||||
icon = "si:nextcloud";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Immich";
|
|
||||||
url = "https://immich.mjallen.dev/";
|
|
||||||
icon = "si:immich";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "AdGuard Home";
|
|
||||||
url = "http://${net.hosts.pi5.lan}:${toString net.ports.pi5.adguard}/";
|
|
||||||
icon = "si:adguard";
|
|
||||||
allow-insecure = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Home Assistant";
|
|
||||||
url = "https://hass.mjallen.dev/";
|
|
||||||
icon = "si:homeassistant";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Manyfold";
|
|
||||||
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.manyfold}/collections";
|
|
||||||
icon = "sh:manyfold";
|
|
||||||
allow-insecure = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Code Server";
|
|
||||||
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.codeServer}/";
|
|
||||||
icon = "si:vscodium";
|
|
||||||
allow-insecure = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "NAS KVM";
|
|
||||||
url = "http://nas-kvm.local/";
|
|
||||||
icon = "si:nanokvm";
|
|
||||||
allow-insecure = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Sonarr";
|
|
||||||
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.sonarr}/";
|
|
||||||
icon = "si:sonarr";
|
|
||||||
allow-insecure = true;
|
|
||||||
basic-auth = {
|
|
||||||
username = "\${ARR_USER}";
|
|
||||||
password = "\${ARR_PASS}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Radarr";
|
|
||||||
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.radarr}/";
|
|
||||||
icon = "si:radarr";
|
|
||||||
allow-insecure = true;
|
|
||||||
basic-auth = {
|
|
||||||
username = "\${ARR_USER}";
|
|
||||||
password = "\${ARR_PASS}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Sabnzbd";
|
|
||||||
url = "http://${net.hosts.nas.lan}:${toString net.ports.nas.sabnzbd}/";
|
|
||||||
icon = "si:sabnzbd";
|
|
||||||
allow-insecure = true;
|
|
||||||
basic-auth = {
|
|
||||||
username = "\${ARR_USER}";
|
|
||||||
password = "\${ARR_PASS}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
# {
|
|
||||||
# title = "";
|
|
||||||
# url = "";
|
|
||||||
# icon = "si:";
|
|
||||||
# }
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
type = "bookmarks";
|
type = "bookmarks";
|
||||||
# tab = "First";
|
|
||||||
groups = [
|
groups = [
|
||||||
{
|
{
|
||||||
title = "General";
|
title = "General";
|
||||||
@@ -255,25 +344,6 @@ let
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
# {
|
|
||||||
# name = "test";
|
|
||||||
# width = "default";
|
|
||||||
# hide-desktop-navigation = true;
|
|
||||||
# center-vertically = true;
|
|
||||||
# columns = [
|
|
||||||
# {
|
|
||||||
# size = "small";
|
|
||||||
# widgets = [
|
|
||||||
# {
|
|
||||||
# type = "adguard";
|
|
||||||
# url = "http://pi4.local:3000";
|
|
||||||
# username = "mjallen";
|
|
||||||
# password = "BogieDudie1";
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# }
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -284,7 +354,6 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
glanceConfig
|
glanceConfig
|
||||||
|
|
||||||
# Sops env-file for arr credentials (gated behind glance.enable)
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable (
|
config = lib.mkIf cfg.enable (
|
||||||
lib.${namespace}.mkSopsEnvFile {
|
lib.${namespace}.mkSopsEnvFile {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ with lib;
|
|||||||
let
|
let
|
||||||
name = "kavita";
|
name = "kavita";
|
||||||
cfg = config.${namespace}.services.${name};
|
cfg = config.${namespace}.services.${name};
|
||||||
rootUrl = "https://kavita.${namespace}.dev/";
|
|
||||||
|
|
||||||
kavitaConfig = lib.${namespace}.mkModule {
|
kavitaConfig = lib.${namespace}.mkModule {
|
||||||
inherit config name;
|
inherit config name;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
final: prev: {
|
_final: prev: {
|
||||||
home-assistant = prev.home-assistant.override {
|
home-assistant = prev.home-assistant.override {
|
||||||
packageOverrides = _self: super: {
|
packageOverrides = _self: super: {
|
||||||
psnawp = super.psnawp.overridePythonAttrs (old: {
|
psnawp = super.psnawp.overridePythonAttrs (old: {
|
||||||
|
|||||||
Reference in New Issue
Block a user