From 37062e1ca6c479b7cf773931aa0e797ebcfafe8b Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 5 Jun 2020 22:27:14 -0700 Subject: Add user datatype to keep I also restructured some types so that I could grab a handle on the keep to close it on shutdown, otherwise the database would be locked and I can't do anything about it. This might mean I have to delete and start the database from scratch when I deploy, but that's okay because I haven't stored anything yet. I also renamed some stuff like 'deck' and 'beam' just for fun. I could make these into more general interfaces like I always planned to. Also I haven't really tested this yet, so... next commit will implement the user login. --- Hero/Service.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Hero/Service.nix') diff --git a/Hero/Service.nix b/Hero/Service.nix index 8bad6d7..a3c6bd5 100644 --- a/Hero/Service.nix +++ b/Hero/Service.nix @@ -18,16 +18,16 @@ in The port on which herocomics-server will listen for incoming HTTP traffic. ''; }; - dataDir = lib.mkOption { + keep = lib.mkOption { type = lib.types.path; default = "/var/lib/hero"; description = "herocomics-server database directory"; }; - server = lib.mkOption { + deck = lib.mkOption { type = lib.types.package; description = "herocomics-server package to use"; }; - client = lib.mkOption { + beam = lib.mkOption { type = lib.types.package; description = "herocomics-client package to use"; }; @@ -42,10 +42,10 @@ in }; config = lib.mkIf cfg.enable { systemd.services.herocomics = { - path = [ cfg.server ]; + path = [ cfg.deck ]; wantedBy = [ "multi-user.target" ]; script = '' - ${cfg.server}/bin/mmc + ${cfg.deck}/bin/mmc ''; description = '' Hero Comics app server @@ -53,9 +53,9 @@ in serviceConfig = { KillSignal = "INT"; Environment = [ - "HERO_CLIENT=${cfg.client}/static" + "HERO_BEAM=${cfg.beam}/static" "HERO_PORT=${toString cfg.port}" - "HERO_DATA_DIR=${cfg.dataDir}" + "HERO_KEEP=${cfg.keep}" ]; Type = "simple"; Restart = "on-abort"; -- cgit v1.2.3