Skip to content

Commit

Permalink
kanidm: fix 1.3 build and permit hydra to build it (#363662)
Browse files Browse the repository at this point in the history
  • Loading branch information
cafkafk authored Dec 10, 2024
2 parents 9e46b6e + 21b9737 commit 940f800
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
36 changes: 23 additions & 13 deletions pkgs/by-name/ka/kanidm/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,24 @@ rustPlatform.buildRustPackage rec {
postPatch =
let
format = (formats.toml { }).generate "${KANIDM_BUILD_PROFILE}.toml";
profile = {
admin_bind_path = "/run/kanidmd/sock";
cpu_flags = if stdenv.hostPlatform.isx86_64 then "x86_64_legacy" else "none";
default_config_path = "/etc/kanidm/server.toml";
default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash";
htmx_ui_pkg_path = "@htmx_ui_pkg_path@";
};
profile =
{
admin_bind_path = "/run/kanidmd/sock";
cpu_flags = if stdenv.hostPlatform.isx86_64 then "x86_64_legacy" else "none";
default_config_path = "/etc/kanidm/server.toml";
default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash";
htmx_ui_pkg_path = "@htmx_ui_pkg_path@";
}
// lib.optionalAttrs (lib.versions.majorMinor version == "1.3") {
web_ui_pkg_path = "@web_ui_pkg_path@";
};
in
''
cp ${format profile} libs/profiles/${KANIDM_BUILD_PROFILE}.toml
substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml \
--replace-fail '@htmx_ui_pkg_path@' "$out/ui/hpkg"
substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml --replace-fail '@htmx_ui_pkg_path@' "$out/ui/hpkg"
''
+ lib.optionalString (lib.versions.majorMinor version == "1.3") ''
substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml --replace-fail '@web_ui_pkg_path@' "$out/ui/pkg"
'';

nativeBuildInputs = [
Expand All @@ -83,10 +89,14 @@ rustPlatform.buildRustPackage rec {
];

# The UI needs to be in place before the tests are run.
postBuild = ''
mkdir -p $out/ui
cp -r server/core/static $out/ui/hpkg
'';
postBuild =
''
mkdir -p $out/ui
cp -r server/core/static $out/ui/hpkg
''
+ lib.optionalString (lib.versions.majorMinor version == "1.3") ''
cp -r server/web_ui/pkg $out/ui/pkg
'';

# Upstream runs with the Rust equivalent of -Werror,
# which breaks when we upgrade to new Rust before them.
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# so users choosing to allow don't have to rebuild them every time.
permittedInsecurePackages = [
"olm-3.2.16" # see PR #347899
"kanidm_1_3-1.3.3"
];
}; }

Expand Down

0 comments on commit 940f800

Please sign in to comment.