Unverified Commit a9c4ba31 authored by nicoo's avatar nicoo Committed by GitHub
Browse files

Merge #308806: docuum 0.24.0 -> 0.25.0

Also adds missing options in NixOS module
parents 5b75ddc9 a4776f9f
Loading
Loading
Loading
Loading
+27 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

let
  cfg = config.services.docuum;
  inherit (lib) mkIf mkEnableOption mkOption getExe types;
  inherit (lib) mkIf mkEnableOption mkOption getExe types optionals concatMap;
in
{
  options.services.docuum = {
@@ -14,6 +14,27 @@ in
      default = "10 GB";
      example = "50%";
    };

    minAge = mkOption {
      description = "Sets the minimum age of images to be considered for deletion.";
      type = types.nullOr types.str;
      default = null;
      example = "1d";
    };

    keep = mkOption {
      description = "Prevents deletion of images for which repository:tag matches the specified regex.";
      type = types.listOf types.str;
      default = [];
      example = [ "^my-image" ];
    };

    deletionChunkSize = mkOption {
      description = "Removes specified quantity of images at a time.";
      type = types.int;
      default = 1;
      example = 10;
    };
  };

  config = mkIf cfg.enable {
@@ -35,10 +56,13 @@ in
        DynamicUser = true;
        StateDirectory = "docuum";
        SupplementaryGroups = [ "docker" ];
        ExecStart = utils.escapeSystemdExecArgs [
        ExecStart = utils.escapeSystemdExecArgs ([
          (getExe pkgs.docuum)
          "--threshold" cfg.threshold
        ];
          "--deletion-chunk-size" cfg.deletionChunkSize
        ] ++ (concatMap (keep: [ "--keep" keep ]) cfg.keep)
          ++ (optionals (cfg.minAge != null) [ "--min-age" cfg.minAge ])
        );
      };
    };
  };
+3 −3
Original line number Diff line number Diff line
@@ -7,16 +7,16 @@

rustPlatform.buildRustPackage rec {
  pname = "docuum";
  version = "0.24.0";
  version = "0.25.0";

  src = fetchFromGitHub {
    owner = "stepchowfun";
    repo = "docuum";
    rev = "v${version}";
    hash = "sha256-/30wuLnCcomgJ14c5rNbitD1dEpvyRal3L60gQdZPBU=";
    hash = "sha256-nWd6h39jU1eZWPFMxhxActsmrs9k0TDMlealuzTa+o0=";
  };

  cargoHash = "sha256-BvZM0tAgwoOO0VFQEoifgmENnW3cfKV3Zj872/Lki6A=";
  cargoHash = "sha256-uoQ1qUII6TSZsosAdNfs2CREVuN2kuT9Bmi5vuDT/rY=";

  checkFlags = [
    # fails, no idea why