refactor(glance): moved to nixos module
This commit is contained in:
parent
36b1088d34
commit
5745510e1a
4 changed files with 36 additions and 15 deletions
104
modules/nixos/services/glance.nix
Normal file
104
modules/nixos/services/glance.nix
Normal file
|
@ -0,0 +1,104 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
moduleName = "service-glance";
|
||||
cfg = config."${moduleName}";
|
||||
|
||||
glancePort = 1227;
|
||||
homeColumn = {
|
||||
size = "full";
|
||||
widgets = [
|
||||
{
|
||||
title = "Services";
|
||||
type = "monitor";
|
||||
cache = "1m";
|
||||
sites = [
|
||||
# https://simpleicons.org/
|
||||
{
|
||||
title = "Gitea";
|
||||
icon = "si:gitea";
|
||||
url = "https://gitea.bwfiq.com";
|
||||
}
|
||||
{
|
||||
title = "LibreChat";
|
||||
icon = "si:googlechat";
|
||||
url = "https://chat.bwfiq.com";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
title = "Newsletters";
|
||||
type = "rss";
|
||||
style = "detailed-list";
|
||||
limit = 100000;
|
||||
feeds = [
|
||||
{
|
||||
title = "selfh.st";
|
||||
url = "https://selfh.st/rss/";
|
||||
}
|
||||
{
|
||||
title = "This Week in Rust";
|
||||
url = "https://this-week-in-rust.org/rss.xml";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
title = "Blogs";
|
||||
type = "rss";
|
||||
style = "detailed-list";
|
||||
limit = 100000;
|
||||
feeds = [
|
||||
{
|
||||
title = "Makefile.feld";
|
||||
url = "https://blog.feld.me/feeds/all.atom.xml";
|
||||
}
|
||||
{
|
||||
title = "Xe Iaso";
|
||||
url = "https://xeiaso.net/blog.rss";
|
||||
}
|
||||
{
|
||||
title = "Alex Haydock";
|
||||
url = "https://blog.infected.systems/posts/index.xml";
|
||||
}
|
||||
{
|
||||
title = "journix.dev";
|
||||
url = "https://journix.dev/feed.xml";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
"${moduleName}" = {
|
||||
enable = lib.mkEnableOption "Enable ${moduleName}.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [ glancePort ];
|
||||
services.glance = {
|
||||
enable = true;
|
||||
settings.server = {
|
||||
host = "0.0.0.0";
|
||||
port = glancePort;
|
||||
};
|
||||
settings.pages = [
|
||||
{
|
||||
name = "Home";
|
||||
columns = [
|
||||
homeColumn
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue