From 9f6a184d17480c4e3282e6402738d44659a45f54 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sat, 10 Dec 2022 22:09:21 +1000 Subject: [PATCH] calibre-web now does kobo sync --- flake.nix | 2 +- hosts/box/default.nix | 2 +- hosts/profiles/calibre/default.nix | 33 ++++++++++++++---------- hosts/profiles/mossnet-hosts/default.nix | 1 + overlays/default.nix | 3 +++ 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index c4e508d1..6ce377d3 100644 --- a/flake.nix +++ b/flake.nix @@ -90,6 +90,7 @@ nur.overlay unstableOverlay self.overlays.additions + self.overlays.modifications ]; }); @@ -247,7 +248,6 @@ }; helix = { hostname = "git.sealight.xyz"; - autoRollback = false; profiles.system = { user = "root"; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix; diff --git a/hosts/box/default.nix b/hosts/box/default.nix index f5734c64..9a18e474 100644 --- a/hosts/box/default.nix +++ b/hosts/box/default.nix @@ -42,7 +42,7 @@ "/var/backup/postgresql" # wallabag "/var/lib/radicale" # radicale "/home/anish/usr/drawing" # syncthing - "/home/anish/usr/nonfiction" # syncthing + # "/home/anish/usr/nonfiction" # syncthing "/home/anish/usr/finance" # beancount "/mnt/two/postgres" # sealight postgres backups TODO remove once moved to capsul ]; diff --git a/hosts/profiles/calibre/default.nix b/hosts/profiles/calibre/default.nix index 3457e15c..517dd378 100644 --- a/hosts/profiles/calibre/default.nix +++ b/hosts/profiles/calibre/default.nix @@ -1,17 +1,22 @@ +{ pkgs, ... }: { - # Unnecessary at this stage - #services.calibre-web = { - # enable = true; - # listen.port = 8083; - # openFirewall = true; - # # Bug in the module puts this in quotes in the systemd file - # # user = calibre; - # # group = calibre; - # options = { - # calibreLibrary = "/data/books"; - # enableBookUploading = true; - # }; - #}; + services.calibre-web = { + enable = true; + listen.port = 8083; + openFirewall = true; + # Bug in the module puts this in quotes in the systemd file + user = "calibre-server"; + group = "calibre-server"; + options = { + calibreLibrary = "/data/books"; + enableBookUploading = true; + }; + }; + + users.users.calibre-server = { + isSystemUser = true; + group = "calibre-server"; + }; services.calibre-server = { enable = true; @@ -21,6 +26,8 @@ # group = calibre; }; + environment.systemPackages = with pkgs; [ calibre ]; + services.nginx.virtualHosts."books.mossnet.lan" = { enableACME = false; forceSSL = false; diff --git a/hosts/profiles/mossnet-hosts/default.nix b/hosts/profiles/mossnet-hosts/default.nix index 20033d8a..ec95ab80 100644 --- a/hosts/profiles/mossnet-hosts/default.nix +++ b/hosts/profiles/mossnet-hosts/default.nix @@ -10,6 +10,7 @@ 192.168.1.240 task.mossnet.lan 192.168.1.240 fin.mossnet.lan 192.168.1.240 paper.mossnet.lan + 192.168.1.240 books.mossnet.lan ''; # 10.0.69.4 mossnet.lan # 10.0.69.4 links.mossnet.lan diff --git a/overlays/default.nix b/overlays/default.nix index b2653c9d..0876eec2 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -7,6 +7,9 @@ # You can change versions, add patches, set compilation flags, anything really. # https://nixos.wiki/wiki/Overlays modifications = final: prev: { + calibre-web = prev.calibre-web.overrideAttrs (prevAttrs: rec { + propagatedBuildInputs = prevAttrs.propagatedBuildInputs ++ [ final.python3.pkgs.jsonschema ]; # allow kobo sync stuff + }); # example = prev.example.overrideAttrs (oldAttrs: rec { # ... # });