morn: configure glance
This commit is contained in:
parent
93783fe482
commit
bca8a78af9
@ -7,6 +7,9 @@
|
||||
../../common/metrics-exporters.nix
|
||||
../../common/auto-upgrade.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
./services/nginx.nix
|
||||
./services/glance
|
||||
];
|
||||
|
||||
networking = {
|
||||
|
15
hosts/morn/services/glance/default.nix
Normal file
15
hosts/morn/services/glance/default.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ config, values, ... }:
|
||||
{
|
||||
services.glance = {
|
||||
enable = true;
|
||||
settings = import ./settings.nix;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."glance.home.feal.no" = let
|
||||
inherit (config.services.glance.settings.server) host port;
|
||||
in {
|
||||
locations."/" = {
|
||||
proxyPass = "http://${host}:${toString port}";
|
||||
};
|
||||
};
|
||||
}
|
83
hosts/morn/services/glance/settings.nix
Normal file
83
hosts/morn/services/glance/settings.nix
Normal file
@ -0,0 +1,83 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
server = {
|
||||
port = 5001;
|
||||
host = "127.0.1.2";
|
||||
};
|
||||
|
||||
pages =
|
||||
let
|
||||
fullCol = widgets: {
|
||||
size = "full";
|
||||
inherit widgets;
|
||||
};
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "Home";
|
||||
columns = [
|
||||
(fullCol [
|
||||
{
|
||||
type = "search";
|
||||
search-engine = "http://search.home.feal.no/search?q={QUERY}";
|
||||
}
|
||||
{
|
||||
type = "weather";
|
||||
units = "metric";
|
||||
location = "Trondheim, Norway";
|
||||
}
|
||||
])
|
||||
(fullCol [
|
||||
{
|
||||
type = "hacker-news";
|
||||
limit = 20;
|
||||
collapse-after = 5;
|
||||
}
|
||||
{
|
||||
type = "monitor";
|
||||
cache = "5m";
|
||||
sites =
|
||||
let
|
||||
site = title: url: { inherit title url; };
|
||||
in
|
||||
[
|
||||
(site "Jellyfin" "http://jellyfin.home.feal.no")
|
||||
(site "Gitea" "https://git.feal.no")
|
||||
(site "VaultWarden" "https://pw.feal.no")
|
||||
];
|
||||
}
|
||||
])
|
||||
];
|
||||
}
|
||||
|
||||
{
|
||||
name = "News";
|
||||
columns =
|
||||
let
|
||||
feed = title: url: { inherit title url; };
|
||||
rss = title: feeds: {
|
||||
type = "rss";
|
||||
inherit title feeds;
|
||||
};
|
||||
in
|
||||
[
|
||||
(fullCol [
|
||||
(rss "Norway" [
|
||||
(feed "NRK" "https://www.nrk.no/toppsaker.rss")
|
||||
(feed "Bygdeposten" "https://www.bygdeposten.no/service/rss")
|
||||
(feed "Nidaros" "https://www.nidaros.no/service/rss")
|
||||
])
|
||||
])
|
||||
|
||||
(fullCol [
|
||||
(rss "NTNU" [
|
||||
(feed "OmegaV" "https://omegav.no/newsrss")
|
||||
(feed "PVV" "https://www.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&days=7&limit=50&action=feedrecentchanges&feedformat=atom")
|
||||
(feed "IT-Varsel" "https://varsel.it.ntnu.no/subscribe/rss/")
|
||||
])
|
||||
])
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
19
hosts/morn/services/nginx.nix
Normal file
19
hosts/morn/services/nginx.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ config, values, ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
enableReload = true;
|
||||
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "felix@albrigtsen.it";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user