Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clevis: 19 -> 20 #294314

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,6 @@
{ lib
, stdenv
, asciidoc
, bash
, coreutils
, cryptsetup
, curl
Expand All @@ -9,56 +9,61 @@
, gnused
, jansson
, jose
, jq
, libpwquality
, luksmeta
, makeWrapper
, meson
, ninja
, nixosTests
, pkg-config
, stdenv
, tpm2-tools
, nixosTests
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "clevis";
version = "19";
version = "20";

src = fetchFromGitHub {
owner = "latchset";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-3J3ti/jRiv+p3eVvJD7u0ko28rPd8Gte0mCJaVaqyOs=";
repo = "clevis";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-rBdZrnHPzRd9vbyl1h/Nb0cFAtIPUHSmxVoKrKuCrQ8=";
};

outputs = [ "out" "man" ];

patches = [
# Replaces the clevis-decrypt 300s timeout to a 10s timeout
# https://github.com/latchset/clevis/issues/289
./tang-timeout.patch
./001-tang-timeout.patch
];

postPatch = ''
for f in $(find src/ -type f); do
grep -q "/bin/cat" "$f" && substituteInPlace "$f" \
--replace '/bin/cat' '${coreutils}/bin/cat' || true
grep -q "/bin/cat" "$f" && \
substituteInPlace "$f" \
--replace-fail '/bin/cat' '${coreutils}/bin/cat' || true
done
'';

postInstall = ''
# We wrap the main clevis binary entrypoint but not the sub-binaries.
wrapProgram $out/bin/clevis \
--prefix PATH ':' "${lib.makeBinPath [tpm2-tools jose cryptsetup libpwquality luksmeta gnugrep gnused coreutils]}:${placeholder "out"}/bin"
'';
depsBuildBuild = [
pkg-config
];

nativeBuildInputs = [
asciidoc
cryptsetup
jq
makeWrapper
meson
ninja
pkg-config
];

buildInputs = [
cryptsetup
bash
curl
jansson
jose
Expand All @@ -67,24 +72,43 @@ stdenv.mkDerivation rec {
tpm2-tools
];

outputs = [
"out"
"man"
];
strictDeps = true;

postFixup = let
binPath = lib.makeBinPath [
coreutils
cryptsetup
gnugrep
gnused
jose
libpwquality
luksmeta
tpm2-tools
];
# We wrap the main clevis binary entrypoint - but not the sub-command
# binaries
in ''
patchShebangs --host $out/bin/clevis
wrapProgram $out/bin/clevis \
--prefix PATH ':' "${binPath}:${placeholder "out"}/bin"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't placeholder "out" be added to makeBinPath, too?

'';

passthru.tests = {
inherit (nixosTests.installer) clevisBcachefs clevisBcachefsFallback clevisLuks clevisLuksFallback clevisZfs clevisZfsFallback;
inherit (nixosTests.installer)
clevisBcachefs clevisBcachefsFallback clevisLuks clevisLuksFallback
clevisZfs clevisZfsFallback;
clevisLuksSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisLuks;
clevisLuksFallbackSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisLuksFallback;
clevisZfsSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisZfs;
clevisZfsFallbackSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisZfsFallback;
};

meta = with lib; {
meta = {
description = "Automated Encryption Framework";
homepage = "https://github.com/latchset/clevis";
changelog = "https://github.com/latchset/clevis/releases/tag/v${version}";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ];
changelog = "https://github.com/latchset/clevis/releases/tag/v${finalAttrs.version}";
license = with lib.licenses; [ gpl3Plus ];
mainProgram = "clevis";
maintainers = with lib.maintainers; [ AndersonTorres ];
};
}
})
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Expand Up @@ -4644,7 +4644,7 @@ with pkgs;

clevercsv = with python3Packages; toPythonApplication clevercsv;

clevis = callPackage ../tools/security/clevis {
clevis = callPackage ../by-name/cl/clevis/package.nix {
asciidoc = asciidoc-full;
};
Comment on lines +4647 to 4649
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably inline this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @infinisil recommended, changes on the override interface should not happen at will.
At least I should test if asciidoc works fine before trying to inline it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'd prefer to not inline these, since it would break .override { asciidoc = ...; }, which should be considered a relatively stable interface.


Expand Down