···19191. `cp -r pkgs/by-name/ka/kanidm/patches/1_4 pkgs/by-name/ka/kanidm/patches/1_5`20201. Update `1_5.nix` hashes/paths, and as needed for upstream changes, `generic.nix`21211. Update `all-packages.nix` to add `kanidm_1_5` and `kanidmWithSecretProvisioning_1_5`, leave default2222+1. Update the previous release, e.g. `1_4.nix` and set `eolDate = "YYYY-MM-DD"` where the date is 30 days from release of 1.5.22231. Create commit, `kanidm_1_5: init at 1.5.0` - this is the only commit that will be backported23242425### Update default
+51-54
pkgs/by-name/ka/kanidm/generic.nix
···22 version,33 hash,44 cargoHash,55- patchDir,66- extraMeta ? { },75 unsupported ? false,66+ eolDate ? null,87}:98109{···34353536let3637 arch = if stdenv.hostPlatform.isx86_64 then "x86_64" else "generic";3838+3939+ versionUnderscored = builtins.replaceStrings [ "." ] [ "_" ] (4040+ lib.versions.majorMinor kanidm.version4141+ );4242+4343+ provisionPatches = [4444+ (./. + "/provision-patches/${versionUnderscored}/oauth2-basic-secret-modify.patch")4545+ (./. + "/provision-patches/${versionUnderscored}/recover-account.patch")4646+ ];4747+4848+ upgradeNote = ''4949+ Please upgrade by verifying `kanidmd domain upgrade-check` and choosing the5050+ next version with `services.kanidm.package = pkgs.kanidm_1_x;`5151+5252+ See upgrade guide at https://kanidm.github.io/kanidm/master/server_updates.html5353+ '';3754in3838-rustPlatform.buildRustPackage rec {5555+rustPlatform.buildRustPackage (finalAttrs: {3956 pname = "kanidm" + (lib.optionalString enableSecretProvisioning "-with-secret-provisioning");4057 inherit version cargoHash;4158···6449 inherit hash;6550 };66516767- KANIDM_BUILD_PROFILE = "release_nixpkgs_${arch}";5252+ env.KANIDM_BUILD_PROFILE = "release_nixpkgs_${arch}";68536969- patches = lib.optionals enableSecretProvisioning [7070- "${patchDir}/oauth2-basic-secret-modify.patch"7171- "${patchDir}/recover-account.patch"7272- ];5454+ patches = lib.optionals enableSecretProvisioning provisionPatches;73557456 postPatch =7557 let7676- format = (formats.toml { }).generate "${KANIDM_BUILD_PROFILE}.toml";5858+ format = (formats.toml { }).generate "${finalAttrs.env.KANIDM_BUILD_PROFILE}.toml";7759 socket_path = if stdenv.hostPlatform.isLinux then "/run/kanidmd/sock" else "/var/run/kanidm.socket";7860 profile = {7961 cpu_flags = if stdenv.hostPlatform.isx86_64 then "x86_64_legacy" else "none";···8270 server_admin_bind_path = socket_path;8371 server_config_path = "/etc/kanidm/server.toml";8472 server_ui_pkg_path = "@htmx_ui_pkg_path@";8585- }8686- // lib.optionalAttrs (lib.versionOlder version "1.5") {8787- admin_bind_path = socket_path;8888- default_config_path = "/etc/kanidm/server.toml";8989- default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash";9090- htmx_ui_pkg_path = "@htmx_ui_pkg_path@";9191- }9292- // lib.optionalAttrs (lib.versions.majorMinor version == "1.3") {9393- web_ui_pkg_path = "@web_ui_pkg_path@";9473 };9574 in9675 ''9797- cp ${format profile} libs/profiles/${KANIDM_BUILD_PROFILE}.toml9898- substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml --replace-fail '@htmx_ui_pkg_path@' "$out/ui/hpkg"9999- ''100100- + lib.optionalString (lib.versions.majorMinor version == "1.3") ''101101- substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml --replace-fail '@web_ui_pkg_path@' "$out/ui/pkg"7676+ cp ${format profile} libs/profiles/${finalAttrs.env.KANIDM_BUILD_PROFILE}.toml7777+ substituteInPlace libs/profiles/${finalAttrs.env.KANIDM_BUILD_PROFILE}.toml --replace-fail '@htmx_ui_pkg_path@' "$out/ui/hpkg"10278 '';1037910480 nativeBuildInputs = [···108108 postBuild = ''109109 mkdir -p $out/ui110110 cp -r server/core/static $out/ui/hpkg111111- ''112112- + lib.optionalString (lib.versions.majorMinor version == "1.3") ''113113- cp -r server/web_ui/pkg $out/ui/pkg114111 '';115112116113 # Upstream runs with the Rust equivalent of -Werror,···136139137140 passthru = {138141 tests = {139139- inherit (nixosTests) kanidm kanidm-provisioning;142142+ kanidm = nixosTests.kanidm versionUnderscored;143143+ kanidm-provisioning = nixosTests.kanidm-provisioning versionUnderscored;140144 };141145142146 updateScript = lib.optionals (!enableSecretProvisioning) (nix-update-script {143143- # avoid spurious releases and tags such as "debs"144147 extraArgs = [145148 "-vr"146146- "v([0-9\\.]*)"149149+ "v(${lib.versions.major kanidm.version}\\.${lib.versions.minor kanidm.version}\\.[0-9]*)"147150 "--override-filename"148148- "pkgs/by-name/ka/kanidm/${149149- builtins.replaceStrings [ "." ] [ "_" ] (lib.versions.majorMinor kanidm.version)150150- }.nix"151151+ "pkgs/by-name/ka/kanidm/${versionUnderscored}.nix"151152 ];152153 });153154154155 inherit enableSecretProvisioning;155156 withSecretProvisioning = kanidm.override { enableSecretProvisioning = true; };157157+158158+ eolMessage = lib.optionalString (eolDate != null) ''159159+ kanidm ${lib.versions.majorMinor version} is deprecated and will reach end-of-life on ${eolDate}160160+161161+ ${upgradeNote}162162+ '';156163 };157164158165 # can take over 4 hours on 2 cores and needs 16GB+ RAM159166 requiredSystemFeatures = [ "big-parallel" ];160167161161- meta =162162- with lib;163163- {164164- changelog = "https://github.com/kanidm/kanidm/releases/tag/v${version}";165165- description = "Simple, secure and fast identity management platform";166166- homepage = "https://github.com/kanidm/kanidm";167167- license = licenses.mpl20;168168- platforms = platforms.linux ++ platforms.darwin;169169- maintainers = with maintainers; [170170- adamcstephens171171- Flakebi172172- ];173173- knownVulnerabilities = lib.optionals unsupported [174174- ''175175- kanidm ${version} has reached EOL.168168+ meta = {169169+ changelog = "https://github.com/kanidm/kanidm/releases/tag/v${version}";170170+ description = "Simple, secure and fast identity management platform";171171+ homepage = "https://github.com/kanidm/kanidm";172172+ license = lib.licenses.mpl20;173173+ platforms = lib.platforms.linux ++ lib.platforms.darwin;174174+ maintainers = with lib.maintainers; [175175+ adamcstephens176176+ Flakebi177177+ ];178178+ knownVulnerabilities = lib.optionals unsupported [179179+ ''180180+ kanidm ${lib.versions.majorMinor version} has reached end-of-life.176181177177- Please upgrade by verifying `kanidmd domain upgrade-check` and choosing the next version with `services.kanidm.package = pkgs.kanidm_1_x;`178178- See upgrade guide at https://kanidm.github.io/kanidm/master/server_updates.html179179- ''180180- ];181181- }182182- // extraMeta;183183-}182182+ ${upgradeNote}183183+ ''184184+ ];185185+ };186186+})