mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-09-14 06:22:02 +02:00
Compare commits
No commits in common. "f1b9c9edca30d0d0833376dbd4c2acd11ecdb197" and "efd88fb11bb26af4dabbfd42bb6d883fd22be99a" have entirely different histories.
f1b9c9edca
...
efd88fb11b
3 changed files with 47 additions and 45 deletions
18
flake.lock
generated
18
flake.lock
generated
|
@ -7,11 +7,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748225455,
|
"lastModified": 1747742835,
|
||||||
"narHash": "sha256-AzlJCKaM4wbEyEpV3I/PUq5mHnib2ryEy32c+qfj6xk=",
|
"narHash": "sha256-kYL4GCwwznsypvsnA20oyvW8zB/Dvn6K5G/tgMjVMT4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "a894f2811e1ee8d10c50560551e50d6ab3c392ba",
|
"rev": "df522e787fdffc4f32ed3e1fca9ed0968a384d62",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -242,11 +242,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748302896,
|
"lastModified": 1747953325,
|
||||||
"narHash": "sha256-ixMT0a8mM091vSswlTORZj93WQAJsRNmEvqLL+qwTFM=",
|
"narHash": "sha256-y2ZtlIlNTuVJUZCqzZAhIw5rrKP4DOSklev6c8PyCkQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7848cd8c982f7740edf76ddb3b43d234cb80fc4d",
|
"rev": "55d1f923c480dadce40f5231feb472e81b0bab48",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -296,11 +296,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748370509,
|
"lastModified": 1747744144,
|
||||||
"narHash": "sha256-QlL8slIgc16W5UaI3w7xHQEP+Qmv/6vSNTpoZrrSlbk=",
|
"narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "4faa5f5321320e49a78ae7848582f684d64783e9",
|
"rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -105,46 +105,39 @@
|
||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
cfg = config.webapps;
|
cfg = config.webapps;
|
||||||
appsWithName = builtins.filter (app: app.dashboard.name != null) (lib.attrValues cfg.apps);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib.webapps.homerServices = lib.forEach cfg.dashboardCategories (
|
lib.webapps.homerServices =
|
||||||
category:
|
let
|
||||||
|
apps = builtins.filter (a: a.dashboard.name != null) (lib.attrValues cfg.apps);
|
||||||
|
in
|
||||||
|
lib.forEach cfg.dashboardCategories (
|
||||||
|
cat:
|
||||||
let
|
let
|
||||||
catTag = category.tag;
|
|
||||||
catApps = lib.sort (a: b: a.dashboard.name < b.dashboard.name) (
|
catApps = lib.sort (a: b: a.dashboard.name < b.dashboard.name) (
|
||||||
builtins.filter (
|
builtins.filter (
|
||||||
app:
|
a:
|
||||||
let
|
a.dashboard.category != null && a.dashboard.category == cat.tag
|
||||||
cat = app.dashboard.category;
|
|| a.dashboard.category == null && cat.tag == "misc"
|
||||||
in
|
) apps
|
||||||
(cat != null && cat == catTag) || (cat == null && catTag == "misc")
|
|
||||||
) appsWithName
|
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit (category) name;
|
inherit (cat) name;
|
||||||
items = lib.forEach catApps (
|
items = lib.forEach catApps (a: {
|
||||||
app:
|
inherit (a.dashboard)
|
||||||
let
|
|
||||||
dash = app.dashboard;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
inherit (dash)
|
|
||||||
method
|
method
|
||||||
name
|
name
|
||||||
type
|
type
|
||||||
url
|
url
|
||||||
;
|
;
|
||||||
icon = lib.optionalString (dash.icon != null) "fas fa-${dash.icon}";
|
icon = lib.optionalString (a.dashboard.icon != null) "fas fa-${a.dashboard.icon}";
|
||||||
target = "_blank";
|
target = "_blank";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
my.services.blackbox.http_endpoints =
|
||||||
);
|
lib.mapAttrsToList (_key: value: value.dashboard.url) config.webapps.apps
|
||||||
|
++ [ "https://${config.networking.domain}/" ];
|
||||||
my.services.blackbox.http_endpoints = lib.mapAttrsToList (_: app: app.dashboard.url) cfg.apps ++ [
|
|
||||||
"https://${config.networking.domain}/"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,10 @@ let
|
||||||
inherit (config.networking) domain;
|
inherit (config.networking) domain;
|
||||||
|
|
||||||
homeConfig = {
|
homeConfig = {
|
||||||
|
title = "Dashboard";
|
||||||
header = false;
|
header = false;
|
||||||
footer = false;
|
footer = false;
|
||||||
|
connectivityCheck = true;
|
||||||
columns = "auto";
|
columns = "auto";
|
||||||
services = config.lib.webapps.homerServices;
|
services = config.lib.webapps.homerServices;
|
||||||
};
|
};
|
||||||
|
@ -24,11 +26,18 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.homer = {
|
# TODO: 25.05 use stable
|
||||||
enable = true;
|
services.caddy.virtualHosts.${domain} = {
|
||||||
virtualHost.caddy.enable = true;
|
extraConfig = ''
|
||||||
virtualHost.domain = domain;
|
import common
|
||||||
settings = homeConfig;
|
root * ${pkgs.unstable.homer}
|
||||||
|
file_server
|
||||||
|
handle_path /assets/config.yml {
|
||||||
|
root * ${pkgs.writeText "homerConfig.yml" (builtins.toJSON homeConfig)}
|
||||||
|
file_server
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
useACMEHost = domain;
|
||||||
};
|
};
|
||||||
|
|
||||||
webapps = {
|
webapps = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue