aboutsummaryrefslogtreecommitdiff
path: root/modules/services/nixos/glance.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-08-22 12:42:46 -0500
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-08-22 12:42:46 -0500
commitbc81e75bead05fdf2cb6aaf3fec6e933ce8feb1a (patch)
treea572e2bfddca3c1b81fe15fdf3ee6cc045f67e1e /modules/services/nixos/glance.nix
parent967ec14cba166079d71d67f4137ee62fca315d62 (diff)
everything is working now
Diffstat (limited to 'modules/services/nixos/glance.nix')
-rw-r--r--modules/services/nixos/glance.nix117
1 files changed, 56 insertions, 61 deletions
diff --git a/modules/services/nixos/glance.nix b/modules/services/nixos/glance.nix
index 38e5e1d..8d305a5 100644
--- a/modules/services/nixos/glance.nix
+++ b/modules/services/nixos/glance.nix
@@ -6,8 +6,6 @@
}: let
cfg = config.collinux.services.glance;
- pure = x: [x];
-
servicesLinks = builtins.attrValues cfg.homelabServices;
settings = {
@@ -19,76 +17,73 @@
};
branding.hide-footer = true;
- pages = pure {
- name = "Dashboard";
- width = "slim";
- hide-desktop-navigation = true;
- center-vertically = true;
- columns = pure {
- size = "full";
- widgets = [
+ pages = [
+ {
+ name = "Dashboard";
+ width = "slim";
+ hide-desktop-navigation = true;
+ center-vertically = true;
+ columns = [
{
- type = "search";
- autofocus = true;
- search-engine = "duckduckgo";
- bangs = [
- {
- title = "GitHub";
- shortcut = "gh";
- url = "https://github.com/search?q={QUERY}&type=repositories";
- }
+ size = "full";
+ widgets = [
{
- title = "I'm Feeling Lucky";
- shortcut = "!";
- url = "https://www.google.com/search?q={QUERY}&btnI=&sourceid=navclient&gfns=1";
+ type = "search";
+ autofocus = true;
+ search-engine = "duckduckgo";
+ bangs = [
+ {
+ title = "GitHub";
+ shortcut = "gh";
+ url = "https://github.com/search?q={QUERY}&type=repositories";
+ }
+ {
+ title = "I'm Feeling Lucky";
+ shortcut = "!";
+ url = "https://www.google.com/search?q={QUERY}&btnI=&sourceid=navclient&gfns=1";
+ }
+ {
+ title = "YouTube Music";
+ shortcut = "ytm";
+ url = "https://music.youtube.com/search?q={QUERY}";
+ }
+ {
+ title = "Google AI Mode";
+ shortcut = "ai";
+ url = "https://www.google.com/search?udm=50&q={QUERY}";
+ }
+ ];
}
{
- title = "YouTube Music";
- shortcut = "ytm";
- url = "https://music.youtube.com/search?q={QUERY}";
+ type = "server-stats";
+ servers = [
+ {
+ type = "local";
+ name = "ganymede";
+ hide-mountpoints-by-default = true;
+ mountpoints = {
+ "/".hide = false;
+ "/media".hide = false;
+ };
+ }
+ ];
}
{
- title = "Google AI Mode";
- shortcut = "ai";
- url = "https://www.google.com/search?udm=50&q={QUERY}";
+ type = "monitor";
+ cache = "1m";
+ title = "Services";
+ sites = servicesLinks;
}
];
}
- {
- type = "server-stats";
- servers = pure {
- type = "local";
- name = "Ganymede";
- hide-mountpoints-by-default = true;
- mountpoints = {
- "/".hide = false;
- "/media".hide = false;
- };
- };
- }
- {
- type = "monitor";
- cache = "1m";
- title = "Services";
- sites = servicesLinks;
- }
];
- };
- };
+ }
+ ];
};
settingsFile = (pkgs.formats.yaml {}).generate "config.yml" settings;
in {
config = lib.mkIf cfg.enable {
- users.groups."glance" = {};
- users.users."glance" = {
- isSystemUser = true;
- group = "glance";
-
- home = "/var/lib/glance";
- createHome = true;
- };
-
systemd.services."glance" = {
restartIfChanged = true;
wants = ["network-online.target"];
@@ -96,12 +91,12 @@ in {
wantedBy = ["multi-user.target"];
serviceConfig = {
- User = "glance";
Type = "simple";
- ReadWritePaths = "/var/lib/glance";
- WorkingDirectory = "/var/lib/glance";
- ExecStart = "${pkgs.glance}/bin/glance -config ${settingsFile}";
+ DynamicUser = true;
+ StateDirectory = "glance";
+
+ ExecStart = "${lib.getExe pkgs.glance} -config ${settingsFile}";
NoNewPrivileges = true;
PrivateTmp = true;