summaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2026-03-10 17:05:14 +0100
committerDennis Kobert <dennis@kobert.dev>2026-03-10 17:05:14 +0100
commit334625d069b0adf9d046703daf20215bbc83bc4e (patch)
tree99d59322897f6a59d7ba32f953f33473ac86cdba /default.nix
Initial pam-any flake with NixOS module
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..fa9d521
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,45 @@
+{
+ lib,
+ rustPlatform,
+ fetchFromGitHub,
+ pam,
+}:
+
+rustPlatform.buildRustPackage (finalAttrs: {
+ pname = "pam-any";
+ version = "0-unstable-2024-11-20";
+
+ src = fetchFromGitHub {
+ owner = "ChocolateLoverRaj";
+ repo = "pam-any";
+ rev = "e77687709d092a6bb77e57a444403798855075c0";
+ hash = "sha256-em/vifkse1Qp3iX/oE1vHQK6UAoJvbhBOowhFhgQ+qw=";
+ };
+
+ 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;
+ };
+})