lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 24.11-pre 75 lines 2.0 kB view raw
1{ 2 lib, 3 rustPlatform, 4 fetchFromGitHub, 5 coreutils, 6 pkg-config, 7 openssl, 8 pam, 9 openssh, 10}: 11 12rustPlatform.buildRustPackage rec { 13 pname = "pam_rssh"; 14 version = "1.1.0"; 15 16 src = fetchFromGitHub { 17 owner = "z4yx"; 18 repo = "pam_rssh"; 19 rev = "v${version}"; 20 hash = "sha256-SDtMqGy2zhq9jEQVwSEl4EwRp2jgXfTVLrCX7k/kBeU="; 21 fetchSubmodules = true; 22 }; 23 24 cargoHash = "sha256-gNy1tcHDUOG1XduGAIMapvx5dlq+U1LitUQkccGfb9o="; 25 26 postPatch = '' 27 substituteInPlace src/auth_keys.rs \ 28 --replace '/bin/echo' '${coreutils}/bin/echo' \ 29 --replace '/bin/false' '${coreutils}/bin/false' 30 ''; 31 32 nativeBuildInputs = [ pkg-config ]; 33 34 buildInputs = [ 35 openssl 36 pam 37 ]; 38 39 checkFlags = [ 40 # Fails because it tries finding authorized_keys in /home/$USER. 41 "--skip=tests::parse_user_authorized_keys" 42 ]; 43 44 nativeCheckInputs = [ (openssh.override { dsaKeysSupport = true; }) ]; 45 46 env.USER = "nixbld"; 47 48 # Copied from https://github.com/z4yx/pam_rssh/blob/main/.github/workflows/rust.yml. 49 preCheck = '' 50 export HOME=$(mktemp -d) 51 mkdir $HOME/.ssh 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 66 ''; 67 68 meta = with lib; { 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 ]; 74 }; 75}