dotfiles/modules/nixos/services/glance/default.nix
2025-05-26 14:56:10 -05:00

58 lines
1.3 KiB
Nix
Executable file

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