12 rustPlatform.buildRustPackage rec {
14 version = "1.2.0-rc2";
16 src = fetchFromGitHub {
20 hash = "sha256-sXTSICVYSmwr12kRWuhVcag8kY6VAFdCqbe6LtYs4hU=";
21 fetchSubmodules = true;
24 cargoHash = "sha256-QZ1Cs3TZab9wf8l4Fe95LFZhHB6q1uq7JRzEVUMKQSI=";
27 substituteInPlace src/auth_keys.rs \
28 --replace '/bin/echo' '${coreutils}/bin/echo' \
29 --replace '/bin/false' '${coreutils}/bin/false'
32 nativeBuildInputs = [ pkg-config ];
40 # Fails because it tries finding authorized_keys in /home/$USER.
41 "--skip=tests::parse_user_authorized_keys"
44 nativeCheckInputs = [ (openssh.override { dsaKeysSupport = true; }) ];
48 # Copied from https://github.com/z4yx/pam_rssh/blob/main/.github/workflows/rust.yml.
50 export HOME=$(mktemp -d)
52 ssh-keygen -q -N "" -t ecdsa -b 521 -f $HOME/.ssh/id_ecdsa521
53 ssh-keygen -q -N "" -t ecdsa -b 384 -f $HOME/.ssh/id_ecdsa384
54 ssh-keygen -q -N "" -t ecdsa -b 256 -f $HOME/.ssh/id_ecdsa256
55 ssh-keygen -q -N "" -t ed25519 -f $HOME/.ssh/id_ed25519
56 ssh-keygen -q -N "" -t rsa -f $HOME/.ssh/id_rsa
57 ssh-keygen -q -N "" -t dsa -f $HOME/.ssh/id_dsa
58 export SSH_AUTH_SOCK=$HOME/ssh-agent.sock
59 eval $(ssh-agent -a $SSH_AUTH_SOCK)
60 ssh-add $HOME/.ssh/id_ecdsa521
61 ssh-add $HOME/.ssh/id_ecdsa384
62 ssh-add $HOME/.ssh/id_ecdsa256
63 ssh-add $HOME/.ssh/id_ed25519
64 ssh-add $HOME/.ssh/id_rsa
65 ssh-add $HOME/.ssh/id_dsa
69 description = "PAM module for authenticating via ssh-agent, written in Rust";
70 homepage = "https://github.com/z4yx/pam_rssh";
71 license = licenses.mit;
72 platforms = platforms.linux;
73 maintainers = with maintainers; [ kranzes ];