Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 56b3c5b2dde6
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 28a46c2c6f5e
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Sep 8, 2018

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    a0d7b88 View commit details
  2. nixos/sks: Update the descriptions and add meta.maintainers

    TODO: Merge this module with #24516
    primeos committed Sep 8, 2018
    Copy the full SHA
    6764d41 View commit details
  3. Merge pull request #46361 from primeos/nixos-sks

    nixos/sks: Minor improvements
    primeos authored Sep 8, 2018
    Copy the full SHA
    28a46c2 View commit details
Showing with 35 additions and 22 deletions.
  1. +35 −22 nixos/modules/services/security/sks.nix
57 changes: 35 additions & 22 deletions nixos/modules/services/security/sks.nix
Original file line number Diff line number Diff line change
@@ -3,44 +3,55 @@
with lib;

let

cfg = config.services.sks;

sksPkg = cfg.package;

in

{
in {
meta.maintainers = with maintainers; [ primeos calbrecht jcumming ];

options = {

services.sks = {

enable = mkEnableOption "sks";
enable = mkEnableOption ''
SKS (synchronizing key server for OpenPGP) and start the database
server. You need to create "''${dataDir}/dump/*.gpg" for the initial
import'';

package = mkOption {
default = pkgs.sks;
defaultText = "pkgs.sks";
type = types.package;
description = "
Which sks derivation to use.
";
description = "Which SKS derivation to use.";
};

dataDir = mkOption {
type = types.path;
default = "/var/db/sks";
example = "/var/lib/sks";
# TODO: The default might change to "/var/lib/sks" as this is more
# common. There's also https://github.com/NixOS/nixpkgs/issues/26256
# and "/var/db" is not FHS compliant (seems to come from BSD).
description = ''
Data directory (-basedir) for SKS, where the database and all
configuration files are located (e.g. KDB, PTree, membership and
sksconf).
'';
};

hkpAddress = mkOption {
default = [ "127.0.0.1" "::1" ];
type = types.listOf types.str;
description = "
Wich ip addresses the sks-keyserver is listening on.
";
description = ''
Domain names, IPv4 and/or IPv6 addresses to listen on for HKP
requests.
'';
};

hkpPort = mkOption {
default = 11371;
type = types.int;
description = "
Which port the sks-keyserver is listening on.
";
type = types.ints.u16;
description = "HKP port to listen on.";
};
};
};
@@ -51,7 +62,7 @@ in

users.users.sks = {
createHome = true;
home = "/var/db/sks";
home = cfg.dataDir;
isSystemUser = true;
shell = "${pkgs.coreutils}/bin/true";
};
@@ -62,19 +73,21 @@ in
home = config.users.users.sks.home;
user = config.users.users.sks.name;
in {
sks-keyserver = {
"sks-db" = {
description = "SKS database server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
mkdir -p ${home}/dump
${pkgs.sks}/bin/sks build ${home}/dump/*.gpg -n 10 -cache 100 || true #*/
${pkgs.sks}/bin/sks cleandb || true
${pkgs.sks}/bin/sks pbuild -cache 20 -ptree_cache 70 || true
${sksPkg}/bin/sks build ${home}/dump/*.gpg -n 10 -cache 100 || true #*/
${sksPkg}/bin/sks cleandb || true
${sksPkg}/bin/sks pbuild -cache 20 -ptree_cache 70 || true
'';
serviceConfig = {
WorkingDirectory = home;
User = user;
Restart = "always";
ExecStart = "${pkgs.sks}/bin/sks db -hkp_address ${hkpAddress} -hkp_port ${hkpPort}";
ExecStart = "${sksPkg}/bin/sks db -hkp_address ${hkpAddress} -hkp_port ${hkpPort}";
};
};
};