My Nix Configuration
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[marvin] migrate shelfmark to non-docker service

dish d37c7d2c ec72ba38

+22 -17
+22 -17
hosts/marvin/services/shelfmark.nix
··· 1 - { self, config, ... }: 1 + { 2 + self, 3 + config, 4 + pkgs, 5 + ... 6 + }: 2 7 let 3 8 d = self.lib.data.services.shelfmark; 4 9 sec = config.age.secrets; ··· 7 12 systemd.tmpfiles.settings = { 8 13 "10-shelfmark" = { 9 14 "/var/lib/shelfmark/config".d = { 10 - user = "booklore"; 11 - group = "booklore"; 15 + user = "shelfmark"; 16 + group = "shelfmark"; 12 17 mode = "0750"; 13 18 }; 14 19 "/var/media/books/unorganized".d = { 15 - user = "booklore"; 16 - group = "booklore"; 20 + user = "shelfmark"; 21 + group = "shelfmark"; 17 22 mode = "0666"; 18 23 }; 19 24 }; 20 25 }; 21 - virtualisation.oci-containers.containers.shelfmark = { 22 - image = "ghcr.io/calibrain/shelfmark:latest"; 23 - ports = [ "${toString d.port}:8084" ]; 24 - environmentFiles = [ sec.shelfmark-secrets.path ]; 26 + 27 + services.shelfmark = { 28 + enable = true; 29 + package = pkgs.shelfmark-full; 25 30 environment = { 26 - PUID = toString config.users.users.booklore.uid; 27 - PGID = toString config.users.groups.booklore.gid; 28 - 29 - # General Config 31 + FLASK_HOST = "0.0.0.0"; 32 + FLASK_PORT = d.port; 33 + # General settings 30 34 CALIBRE_WEB_URL = "https://lib.pyrox.dev"; 31 35 # Downloads 36 + INGEST_DIR = "/var/media/books/unorganized"; 32 37 TEMPLATE_RENAME = "{Author} - {Title} ({Year})"; 33 38 FILE_ORGANIZATION = "rename"; 34 39 # Auth ··· 43 48 HARDCOVER_ENABLED = "true"; 44 49 OPENLIBRARY_ENABLED = "true"; 45 50 }; 46 - volumes = [ 47 - "/var/lib/shelfmark/config:/config" 48 - "/var/media/books/unorganized:/books" 49 - ]; 50 51 }; 52 + 53 + systemd.services.shelfmark.serviceConfig.EnvironmentFile = [ sec.shelfmark-secrets.path ]; 54 + # Allow grimmory to delete files from INGEST_DIR 55 + systemd.services.grimmory.serviceConfig.SupplementaryGroups = [ "shelfmark" ]; 51 56 52 57 age.secrets.shelfmark-secrets = { 53 58 file = ./secrets/shelfmark-secrets.age;