dotfiles/modules/nixos/services/glance/default.nix

58 lines
1.3 KiB
Nix
Raw Normal View History

2025-05-24 02:45:00 -05:00
{ config, flake, ... }:
let
inherit (flake.config.people) user0;
2025-05-25 18:28:37 -05:00
inherit (flake.config.services.instances) glance jellyfin web;
2025-05-24 02:45:00 -05:00
inherit (flake.config.machines.devices) ceres;
service = glance;
2025-05-25 18:28:37 -05:00
configPath = ./config;
configImports = {
server = import (configPath + /server.nix) { inherit service; };
branding = import (configPath + /branding.nix);
theme = import (configPath + /theme.nix);
pages = import (configPath + /pages.nix) { inherit config flake; };
};
2025-05-24 02:45:00 -05:00
in
{
services = {
glance = {
enable = true;
2025-05-25 18:28:37 -05:00
settings = configImports;
};
};
sops =
let
sopsPath = secret: {
path = "${service.sops.path0}/${service.name}-${secret}";
owner = "root";
mode = "600";
2025-05-24 02:45:00 -05:00
};
2025-05-25 18:28:37 -05:00
in
{
secrets = builtins.listToAttrs (
map
(secret: {
name = "${service.name}-${secret}";
value = sopsPath secret;
})
[
# "key"
# "${user0}-pass"
jellyfin.name
]
);
2025-05-24 02:45:00 -05:00
};
2025-05-25 18:28:37 -05:00
systemd.tmpfiles.rules = [
# "Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
# "Z ${service.sops.path0} 755 root root -"
];
2025-05-24 02:45:00 -05:00
networking = {
firewall = {
allowedTCPPorts = [
service.ports.port0
];
};
};
}