diff options
author | Ben Sima <ben@bsima.me> | 2020-12-04 11:16:25 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-12-05 07:55:13 -0500 |
commit | 330e4363d8abb509031d2c8c1a89dcc6f955e2c1 (patch) | |
tree | 915c8c50a7125bf6eb9e560f8d00a80592f41c77 /Biz/Que/Site.nix | |
parent | 32f53350a3a3d701e9a1474e670a8454342adc40 (diff) |
Renamespace Devalloc and Que
Move them under the Biz root so that we know they are specific to Biz stuff. Biz
is for proprietary stuff that we own.
I also had to refactor the bild namespace parsing code because it couldn't
handle a namespace with 3 parts. I really need to get that namespace library
written and tested.
Diffstat (limited to 'Biz/Que/Site.nix')
-rw-r--r-- | Biz/Que/Site.nix | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Biz/Que/Site.nix b/Biz/Que/Site.nix new file mode 100644 index 0000000..ba2eeb2 --- /dev/null +++ b/Biz/Que/Site.nix @@ -0,0 +1,61 @@ +{ options +, lib +, config +, pkgs +, modulesPath +}: + + + +let + cfg = config.services.que-website; + static = pkgs.stdenv.mkDerivation { + src = ./.; + name = "que-website-static"; + installPhase = '' + mkdir -p $out + cp ${./Apidocs.md} $out/Apidocs.md + cp ${./Index.md} $out/Index.md + cp ${./Quescripts.md} $out/Quescripts.md + cp ${./Style.css} $out/Style.css + cp ${./Tutorial.md} $out/Tutorial.md + cp ${./Client.py} $out/Client.py + ''; + }; +in +{ + options.services.que-website = { + enable = lib.mkEnableOption "Enable the que-website service"; + namespace = lib.mkOption { + type = lib.types.str; + default = "_"; + description = '' + The que namespace on which que-website will broadcast. + ''; + }; + package = lib.mkOption { + type = lib.types.package; + description = "que-website package to use"; + }; + }; + config = lib.mkIf cfg.enable { + systemd.services.que-website = { + path = [ cfg.package pkgs.pandoc ]; + wantedBy = [ "multi-user.target" ]; + script = '' + ${cfg.package}/bin/que-website ${static} ${cfg.namespace} + ''; + description = '' + Que website server + ''; + serviceConfig = { + User = "root"; + Environment = "HOME=/root"; + KillSignal = "INT"; + Type = "simple"; + Restart = "on-abort"; + RestartSec = "1"; + }; + }; + }; +} |