Commit 86f6b16d authored by Jan Tojnar's avatar Jan Tojnar
Browse files

Merge branch 'master' into staging-next

Conflicts:
- pkgs/servers/mail/mailman/python.nix (relevant to mailman-web)
  between f8a17e42 and 84f6a675
parents 08287aa0 eeab1c69
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -629,10 +629,10 @@ rec {
            This behavior is deprecated and will throw an error in the future.''
    (let
      preLen = stringLength prefix;
      sLen = stringLength str;
    in
      if substring 0 preLen str == prefix then
        substring preLen (sLen - preLen) str
        # -1 will take the string until the end
        substring preLen (-1) str
      else
        str);

+21 −0
Original line number Diff line number Diff line
@@ -349,6 +349,27 @@ runTests {
    expected = true;
  };

  testRemovePrefixExample1 = {
    expr = removePrefix "foo." "foo.bar.baz";
    expected = "bar.baz";
  };
  testRemovePrefixExample2 = {
    expr = removePrefix "xxx" "foo.bar.baz";
    expected = "foo.bar.baz";
  };
  testRemovePrefixEmptyPrefix = {
    expr = removePrefix "" "foo";
    expected = "foo";
  };
  testRemovePrefixEmptyString = {
    expr = removePrefix "foo" "";
    expected = "";
  };
  testRemovePrefixEmptyBoth = {
    expr = removePrefix "" "";
    expected = "";
  };

  testNormalizePath = {
    expr = strings.normalizePath "//a/b//c////d/";
    expected = "/a/b/c/d/";
+18 −0
Original line number Diff line number Diff line
@@ -8724,6 +8724,11 @@
    githubId = 1927188;
    name = "karolchmist";
  };
  katexochen = {
    github = "katexochen";
    githubId = 49727155;
    name = "Paul Meyer";
  };
  kayhide = {
    email = "kayhide@gmail.com";
    github = "kayhide";
@@ -15081,6 +15086,13 @@
      fingerprint = "30BB FF3F AB0B BB3E 0435  F83C 8E8F F66E 2AE8 D970";
    }];
  };
  scm2342 = {
    name = "Sven Mattsen";
    email = "nix@sven.cc";
    matrix = "@scm:matrix.sven.cc";
    github = "scm2342";
    githubId = 154108;
  };
  scode = {
    email = "peter.schuller@infidyne.com";
    github = "scode";
@@ -17787,6 +17799,12 @@
      fingerprint = "5814 50EB 6E17 E715 7C63  E7F1 9879 8C3C 4D68 8D6D";
    }];
  };
  viluon = {
    email = "nix@viluon.me";
    github = "viluon";
    githubId = 7235381;
    name = "Ondřej Kvapil";
  };
  vincentbernat = {
    email = "vincent@bernat.ch";
    github = "vincentbernat";
+6 −11
Original line number Diff line number Diff line
@@ -17,14 +17,9 @@ with lib;
  options = {
    services.haproxy = {

      enable = mkOption {
        type = types.bool;
        default = false;
        description = lib.mdDoc ''
          Whether to enable HAProxy, the reliable, high performance TCP/HTTP
          load balancer.
        '';
      };
      enable = mkEnableOption (lib.mdDoc "HAProxy, the reliable, high performance TCP/HTTP load balancer.");

      package = mkPackageOptionMD pkgs "haproxy" { };

      user = mkOption {
        type = types.str;
@@ -70,15 +65,15 @@ with lib;
        ExecStartPre = [
          # when the master process receives USR2, it reloads itself using exec(argv[0]),
          # so we create a symlink there and update it before reloading
          "${pkgs.coreutils}/bin/ln -sf ${pkgs.haproxy}/sbin/haproxy /run/haproxy/haproxy"
          "${pkgs.coreutils}/bin/ln -sf ${lib.getExe cfg.package} /run/haproxy/haproxy"
          # when running the config test, don't be quiet so we can see what goes wrong
          "/run/haproxy/haproxy -c -f ${haproxyCfg}"
        ];
        ExecStart = "/run/haproxy/haproxy -Ws -f /etc/haproxy.cfg -p /run/haproxy/haproxy.pid";
        # support reloading
        ExecReload = [
          "${pkgs.haproxy}/sbin/haproxy -c -f ${haproxyCfg}"
          "${pkgs.coreutils}/bin/ln -sf ${pkgs.haproxy}/sbin/haproxy /run/haproxy/haproxy"
          "${lib.getExe cfg.package} -c -f ${haproxyCfg}"
          "${pkgs.coreutils}/bin/ln -sf ${lib.getExe cfg.package} /run/haproxy/haproxy"
          "${pkgs.coreutils}/bin/kill -USR2 $MAINPID"
        ];
        KillMode = "mixed";
+8 −6
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ in
    enableServer = lib.mkEnableOption (lib.mdDoc "the Kanidm server");
    enablePam = lib.mkEnableOption (lib.mdDoc "the Kanidm PAM and NSS integration");

    package = lib.mkPackageOptionMD pkgs "kanidm" {};

    serverSettings = lib.mkOption {
      type = lib.types.submodule {
        freeformType = settingsFormat.type;
@@ -222,7 +224,7 @@ in
        }
      ];

    environment.systemPackages = lib.mkIf cfg.enableClient [ pkgs.kanidm ];
    environment.systemPackages = lib.mkIf cfg.enableClient [ cfg.package ];

    systemd.services.kanidm = lib.mkIf cfg.enableServer {
      description = "kanidm identity management daemon";
@@ -237,7 +239,7 @@ in
          StateDirectory = "kanidm";
          StateDirectoryMode = "0700";
          RuntimeDirectory = "kanidmd";
          ExecStart = "${pkgs.kanidm}/bin/kanidmd server -c ${serverConfigFile}";
          ExecStart = "${cfg.package}/bin/kanidmd server -c ${serverConfigFile}";
          User = "kanidm";
          Group = "kanidm";

@@ -270,7 +272,7 @@ in
          CacheDirectory = "kanidm-unixd";
          CacheDirectoryMode = "0700";
          RuntimeDirectory = "kanidm-unixd";
          ExecStart = "${pkgs.kanidm}/bin/kanidm_unixd";
          ExecStart = "${cfg.package}/bin/kanidm_unixd";
          User = "kanidm-unixd";
          Group = "kanidm-unixd";

@@ -302,7 +304,7 @@ in
      partOf = [ "kanidm-unixd.service" ];
      restartTriggers = [ unixConfigFile clientConfigFile ];
      serviceConfig = {
        ExecStart = "${pkgs.kanidm}/bin/kanidm_unixd_tasks";
        ExecStart = "${cfg.package}/bin/kanidm_unixd_tasks";

        BindReadOnlyPaths = [
          "/nix/store"
@@ -346,7 +348,7 @@ in
      })
    ];

    system.nssModules = lib.mkIf cfg.enablePam [ pkgs.kanidm ];
    system.nssModules = lib.mkIf cfg.enablePam [ cfg.package ];

    system.nssDatabases.group = lib.optional cfg.enablePam "kanidm";
    system.nssDatabases.passwd = lib.optional cfg.enablePam "kanidm";
@@ -365,7 +367,7 @@ in
          description = "Kanidm server";
          isSystemUser = true;
          group = "kanidm";
          packages = with pkgs; [ kanidm ];
          packages = [ cfg.package ];
        };
      })
      (lib.mkIf cfg.enablePam {
Loading