feat(dashy): giving it a test run
This commit is contained in:
@@ -46,6 +46,8 @@ in
|
|||||||
environment.variables = {
|
environment.variables = {
|
||||||
NH_FLAKE = "/home/cnst/.nix-config";
|
NH_FLAKE = "/home/cnst/.nix-config";
|
||||||
GEMINI_API_KEY = config.age.secrets.gcapi.path;
|
GEMINI_API_KEY = config.age.secrets.gcapi.path;
|
||||||
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||||
|
NIXOS_OZONE_WL = "1";
|
||||||
};
|
};
|
||||||
|
|
||||||
# # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
# # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
homepage-dashboard = {
|
homepage-dashboard = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
|
dashy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
bazarr = {
|
bazarr = {
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
./server/caddy
|
./server/caddy
|
||||||
./server/fail2ban
|
./server/fail2ban
|
||||||
./server/homepage-dashboard
|
./server/homepage-dashboard
|
||||||
|
./server/dashy
|
||||||
./server/vaultwarden
|
./server/vaultwarden
|
||||||
./server/bazarr
|
./server/bazarr
|
||||||
./server/prowlarr
|
./server/prowlarr
|
||||||
|
|||||||
132
modules/server/dashy/default.nix
Normal file
132
modules/server/dashy/default.nix
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
unit = "dashy";
|
||||||
|
cfg = config.server.${unit};
|
||||||
|
srv = config.server;
|
||||||
|
|
||||||
|
hl = config.server;
|
||||||
|
mergedServices = hl // (hl.podman or { });
|
||||||
|
|
||||||
|
dashyCategories = [
|
||||||
|
"Arr"
|
||||||
|
"Media"
|
||||||
|
"Downloads"
|
||||||
|
"Services"
|
||||||
|
"Smart Home"
|
||||||
|
];
|
||||||
|
|
||||||
|
getServicesByCategory =
|
||||||
|
cat:
|
||||||
|
lib.attrsets.filterAttrs (name: value: (value ? category && value.category == cat)) mergedServices;
|
||||||
|
|
||||||
|
mkItems =
|
||||||
|
services:
|
||||||
|
lib.attrsets.mapAttrsToList (name: value: {
|
||||||
|
title = value.name or name;
|
||||||
|
description = value.description or "";
|
||||||
|
url =
|
||||||
|
if value ? href then
|
||||||
|
value.href
|
||||||
|
else
|
||||||
|
(if value ? url then "https://${value.url}${value.path or ""}" else "");
|
||||||
|
icon = value.icon or "";
|
||||||
|
}) services;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.server.${unit} = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable ${unit}";
|
||||||
|
};
|
||||||
|
|
||||||
|
misc = lib.mkOption {
|
||||||
|
default = [ ];
|
||||||
|
type = lib.types.listOf (
|
||||||
|
lib.types.attrsOf (
|
||||||
|
lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
name = lib.mkOption { type = lib.types.str; };
|
||||||
|
description = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
href = lib.mkOption { type = lib.types.str; };
|
||||||
|
icon = lib.mkOption { type = lib.types.str; };
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.glances.enable = true;
|
||||||
|
|
||||||
|
services.${unit} = {
|
||||||
|
enable = true;
|
||||||
|
port = cfg.port or 8081;
|
||||||
|
extraOptions = [
|
||||||
|
"-p"
|
||||||
|
"${toString config.services.${unit}.port}:80"
|
||||||
|
];
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
pageInfo = {
|
||||||
|
title = "${srv.domain} Homelab";
|
||||||
|
description = "Homelab made with NixOS";
|
||||||
|
navLinks = [
|
||||||
|
{
|
||||||
|
title = "GitHub";
|
||||||
|
path = "https://github.com/cnsta/cnix";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
appConfig = {
|
||||||
|
theme = "material-dark";
|
||||||
|
layout = "auto";
|
||||||
|
iconSize = "medium";
|
||||||
|
language = "en";
|
||||||
|
statusCheck = true;
|
||||||
|
hideComponents.hideSettings = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
sections =
|
||||||
|
(lib.lists.forEach dashyCategories (cat: {
|
||||||
|
name = cat;
|
||||||
|
icon = "fas fa-box"; # adjust per category
|
||||||
|
items = mkItems (getServicesByCategory cat);
|
||||||
|
}))
|
||||||
|
++ [
|
||||||
|
{
|
||||||
|
name = "Misc";
|
||||||
|
icon = "fas fa-ellipsis-h";
|
||||||
|
items = lib.lists.map (x: {
|
||||||
|
title = x.name;
|
||||||
|
description = x.description or "";
|
||||||
|
url = x.href or "";
|
||||||
|
icon = x.icon or "";
|
||||||
|
}) cfg.misc;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "Monitoring";
|
||||||
|
icon = "fas fa-monitor-heart-rate";
|
||||||
|
items = [
|
||||||
|
{
|
||||||
|
title = "Glances";
|
||||||
|
url = "http://localhost:${toString config.services.glances.port}";
|
||||||
|
icon = "hl-glances";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts."${srv.domain}" = {
|
||||||
|
useACMEHost = srv.domain;
|
||||||
|
extraConfig = ''
|
||||||
|
reverse_proxy http://127.0.0.1:${toString config.services.${unit}.port}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -11,20 +11,6 @@ in
|
|||||||
{
|
{
|
||||||
options.server = {
|
options.server = {
|
||||||
enable = lib.mkEnableOption "The server services and configuration variables";
|
enable = lib.mkEnableOption "The server services and configuration variables";
|
||||||
mounts.fast = lib.mkOption {
|
|
||||||
default = "/mnt/cache";
|
|
||||||
type = lib.types.path;
|
|
||||||
description = ''
|
|
||||||
Path to the 'fast' tier mount
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
mounts.config = lib.mkOption {
|
|
||||||
default = "/persist/opt/services";
|
|
||||||
type = lib.types.path;
|
|
||||||
description = ''
|
|
||||||
Path to the service configuration files
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
email = mkOption {
|
email = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|||||||
@@ -42,71 +42,7 @@ in
|
|||||||
services.${unit} = {
|
services.${unit} = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedHosts = srv.domain;
|
allowedHosts = srv.domain;
|
||||||
# environmentFile = config.age.secrets.homepageEnvironment.path;
|
|
||||||
# customCSS = ''
|
|
||||||
# @font-face {
|
|
||||||
# font-family: "VCR OSD Mono";
|
|
||||||
# src: url("https://git.sr.ht/~canasta/fonts/tree/main/item/fonts/vcr-mono/TTF/vcr-mono.ttf")
|
|
||||||
# format("truetype");
|
|
||||||
# }
|
|
||||||
# body,
|
|
||||||
# html {
|
|
||||||
# --mint: #d7ffff;
|
|
||||||
# --outerspace: #f8ffff;
|
|
||||||
# --ghostY: #0d090f;
|
|
||||||
# background: var(--ghostY);
|
|
||||||
# }
|
|
||||||
# .font-medium {
|
|
||||||
# font-weight: 700 !important;
|
|
||||||
# }
|
|
||||||
# .font-light {
|
|
||||||
# font-weight: 500 !important;
|
|
||||||
# }
|
|
||||||
# .font-thin {
|
|
||||||
# font-weight: 400 !important;
|
|
||||||
# }
|
|
||||||
# body .colorOverlay {
|
|
||||||
# background: linear-gradient(0deg, var(--overlayA) 0%, var(--overlayB) 100%);
|
|
||||||
# z-index: 2147483647;
|
|
||||||
# pointer-events: none;
|
|
||||||
# position: absolute;
|
|
||||||
# top: 0;
|
|
||||||
# bottom: 0;
|
|
||||||
# left: 0;
|
|
||||||
# right: 0;
|
|
||||||
# overflow: hidden;
|
|
||||||
# body {
|
|
||||||
# background: var(--ghostY);
|
|
||||||
# color: var(--mint);
|
|
||||||
# fill: var(--outerspace);
|
|
||||||
# min-width: 320px;
|
|
||||||
# max-width: 100%;
|
|
||||||
# min-height: 100%;
|
|
||||||
# -webkit-font-smoothing: antialiased;
|
|
||||||
# --overlayA: rgba(130, 0, 100, 0.07);
|
|
||||||
# --overlayB: rgba(30, 190, 180, 0.07);
|
|
||||||
# margin: 0;
|
|
||||||
# padding: 0;
|
|
||||||
# font: inherit;
|
|
||||||
# font-family: VCR OSD Mono Regular;
|
|
||||||
# font-size: 16px;
|
|
||||||
# font-weight: 600;
|
|
||||||
# position: relative;
|
|
||||||
# }
|
|
||||||
# #information-widgets {
|
|
||||||
# padding-left: 1.5rem;
|
|
||||||
# padding-right: 1.5rem;
|
|
||||||
# }
|
|
||||||
# div#footer {
|
|
||||||
# display: none;
|
|
||||||
# }
|
|
||||||
# .services-group.basis-full.flex-1.px-1.-my-1 {
|
|
||||||
# padding-bottom: 3rem;
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# '';
|
|
||||||
settings = {
|
settings = {
|
||||||
background = "/fonts/foto.jpg";
|
|
||||||
layout = [
|
layout = [
|
||||||
{
|
{
|
||||||
Glances = {
|
Glances = {
|
||||||
|
|||||||
Reference in New Issue
Block a user