summaryrefslogtreecommitdiff
path: root/default.nix
blob: b9bd421c9c33edfbd5468259e12f6b0218e6234f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  lib,
  rustPlatform,
  pam,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "pam-any";
  version = "0.2.0";

  src = ./src-repo;

  cargoLock = {
    lockFile = ./Cargo.lock;
  };

  nativeBuildInputs = [
    rustPlatform.bindgenHook
  ];

  buildInputs = [
    pam
  ];

  # cdylib produces no binaries, only libpam_any.so
  installPhase = ''
    runHook preInstall
    mkdir -p $out/lib/security
    cp target/*/release/libpam_any.so $out/lib/security/pam_any.so
    runHook postInstall
  '';

  meta = {
    description = "A PAM module that runs multiple other PAM modules in parallel, succeeding as long as one of them succeeds";
    homepage = "https://github.com/ChocolateLoverRaj/pam-any";
    license = lib.licenses.asl20;
    platforms = lib.platforms.linux;
  };
})