Commit 09ac18fb authored by Guillaume Girol's avatar Guillaume Girol
Browse files

nixos/nixseparatedebuginfod2: adapt to v1

several substituters are supported at the same time
parent b9a31d88
Loading
Loading
Loading
Loading
+25 −14
Original line number Diff line number Diff line
@@ -10,6 +10,11 @@ let
  url = "127.0.0.1:${toString cfg.port}";
in
{
  imports = [
    (lib.mkRemovedOptionModule [ "services" "nixseparatedebuginfod2" "substituter" ] ''
      Instead of `services.nixseparatedebuginfod2.substituter = "foo"`, set `services.nixseparatedebuginfod2.substituters = [ "foo" ]` (possibly with mkForce to override the default value).
    '')
  ];
  options = {
    services.nixseparatedebuginfod2 = {
      enable = lib.mkEnableOption "nixseparatedebuginfod2, a debuginfod server providing source and debuginfo for nix packages";
@@ -19,11 +24,13 @@ in
        type = lib.types.port;
      };
      package = lib.mkPackageOption pkgs "nixseparatedebuginfod2" { };
      substituter = lib.mkOption {
        description = "nix substituter to fetch debuginfo from. Either http/https substituters, or `local:` to use debuginfo present in the local store.";
        default = "https://cache.nixos.org";
        example = "local:";
        type = lib.types.str;
      substituters = lib.mkOption {
        description = "nix substituter to fetch debuginfo from. Either http/https/file substituters, or `local:` to use debuginfo present in the local store.";
        default = [
          "local:"
          "https://cache.nixos.org"
        ];
        type = lib.types.listOf lib.types.str;
      };
      cacheExpirationDelay = lib.mkOption {
        description = "keep unused cache entries for this long. A number followed by a unit";
@@ -38,15 +45,19 @@ in
      path = [ config.nix.package ];
      serviceConfig = {
        ExecStart = [
          (utils.escapeSystemdExecArgs [
          (utils.escapeSystemdExecArgs (
            [
              (lib.getExe cfg.package)
              "--listen-address"
              url
            "--substituter"
            cfg.substituter
              "--expiration"
              cfg.cacheExpirationDelay
          ])
            ]
            ++ (lib.lists.concatMap (s: [
              "--substituter"
              s
            ]) cfg.substituters)
          ))
        ];
        Restart = "on-failure";
        CacheDirectory = "nixseparatedebuginfod2";
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
  nodes.machine = {
    services.nixseparatedebuginfod2 = {
      enable = true;
      substituter = "http://cache";
      substituters = [ "http://cache" ];
    };
    environment.systemPackages = [
      pkgs.valgrind