nixos/sks: Add a webroot option

The module will now, by default, serve a simple webpage via the built-in
web server (instead of displaying an error message).

+16
+16
nixos/modules/services/security/sks.nix
··· 53 53 type = types.ints.u16; 54 54 description = "HKP port to listen on."; 55 55 }; 56 + 57 + webroot = mkOption { 58 + type = types.path; 59 + default = "${sksPkg.webSamples}/OpenPKG"; 60 + defaultText = "\${pkgs.sks.webSamples}/OpenPKG"; 61 + description = '' 62 + Source directory (will be symlinked) for the files the built-in 63 + webserver should serve. SKS (''${pkgs.sks.webSamples}) provides the 64 + following examples: "HTML5", "OpenPKG", and "XHTML+ES". The index 65 + file can be named index.html, index.htm, index.xhtm, or index.xhtml. 66 + Files with the extensions .css, .es, .js, .jpg, .jpeg, .png, or .gif 67 + are supported. Subdirectories and filenames with anything other than 68 + alphanumeric characters and the '.' character will be ignored. 69 + ''; 70 + }; 56 71 }; 57 72 }; 58 73 ··· 78 93 after = [ "network.target" ]; 79 94 wantedBy = [ "multi-user.target" ]; 80 95 preStart = '' 96 + ln -sfT "${cfg.webroot}" web 81 97 mkdir -p ${home}/dump 82 98 ${sksPkg}/bin/sks build ${home}/dump/*.gpg -n 10 -cache 100 || true #*/ 83 99 ${sksPkg}/bin/sks cleandb || true