nixpkgs/pkgs/by-name/us/userborn/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.2 KiB
Nix
Raw Normal View History

2024-08-05 14:34:56 +00:00
{
lib,
rustPlatform,
fetchFromGitHub,
makeBinaryWrapper,
mkpasswd,
nixosTests,
2024-08-05 14:34:56 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "userborn";
version = "0.1.0";
src = fetchFromGitHub {
owner = "nikstur";
repo = "userborn";
rev = version;
hash = "sha256-aptFDrL9RPPTu4wp2ee3LVaEruRdCWtLGIKdOgsR+/s=";
};
sourceRoot = "${src.name}/rust/userborn";
cargoHash = "sha256-m39AC26E0Pxu1E/ap2kSwr5uznJNgExf5QUrZ+zTNX0=";
nativeBuildInputs = [ makeBinaryWrapper ];
buildInputs = [ mkpasswd ];
nativeCheckInputs = [ mkpasswd ];
postInstall = ''
wrapProgram $out/bin/userborn --prefix PATH : ${lib.makeBinPath [ mkpasswd ]}
'';
stripAllList = [ "bin" ];
passthru = {
tests = {
inherit (nixosTests)
userborn
userborn-mutable-users
userborn-mutable-etc
userborn-immutable-users
userborn-immutable-etc
;
};
};
2024-08-05 14:34:56 +00:00
meta = with lib; {
homepage = "https://github.com/nikstur/userborn";
description = "Declaratively bear (manage) Linux users and groups";
license = licenses.mit;
maintainers = with lib.maintainers; [ nikstur ];
mainProgram = "userborn";
};
}