8 cfg = config.services.glance;
19 settingsFormat = pkgs.formats.yaml { };
22 options.services.glance = {
23 enable = mkEnableOption "glance";
24 package = mkPackageOption pkgs "glance" { };
27 type = types.submodule {
28 freeformType = settingsFormat.type;
32 description = "Glance bind address";
33 default = "127.0.0.1";
38 description = "Glance port to listen on";
45 type = settingsFormat.type;
47 List of pages to be present on the dashboard.
49 See <https://github.com/glanceapp/glance/blob/main/docs/configuration.md#pages--columns>
57 widgets = [ { type = "calendar"; } ];
69 { type = "calendar"; }
72 location = "Nivelles, Belgium";
84 Configuration written to a yaml file that is read by glance. See
85 <https://github.com/glanceapp/glance/blob/main/docs/configuration.md>
90 openFirewall = mkOption {
94 Whether to open the firewall for Glance.
95 This adds `services.glance.settings.server.port` to `networking.firewall.allowedTCPPorts`.
100 config = mkIf cfg.enable {
101 systemd.services.glance = {
102 description = "Glance feed dashboard server";
103 wantedBy = [ "multi-user.target" ];
104 after = [ "network.target" ];
109 glance-yaml = settingsFormat.generate "glance.yaml" cfg.settings;
111 "${getExe cfg.package} --config ${glance-yaml}";
112 WorkingDirectory = "/var/lib/glance";
113 StateDirectory = "glance";
114 RuntimeDirectory = "glance";
115 RuntimeDirectoryMode = "0755";
118 DevicePolicy = "closed";
119 LockPersonality = true;
120 MemoryDenyWriteExecute = true;
123 ProtectHostname = true;
124 ProtectKernelLogs = true;
125 ProtectKernelModules = true;
126 ProtectKernelTunables = true;
127 ProtectControlGroups = true;
129 RestrictNamespaces = true;
130 RestrictRealtime = true;
131 SystemCallArchitectures = "native";
136 networking.firewall = mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.settings.server.port ]; };
139 meta.doc = ./glance.md;
140 meta.maintainers = [ lib.maintainers.drupol ];