2024-08-05 14:34:56 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
|
|
|
makeBinaryWrapper,
|
|
|
|
mkpasswd,
|
2024-09-04 08:14:13 +00:00
|
|
|
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" ];
|
|
|
|
|
2024-09-04 08:14:13 +00:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
}
|