nixpkgs/pkgs/os-specific/linux/usbguard/default.nix

89 lines
1.8 KiB
Nix
Raw Normal View History

2021-01-15 17:26:47 +00:00
{ stdenv
, lib
, fetchFromGitHub
, autoreconfHook
2021-01-21 22:12:29 +00:00
, installShellFiles
2021-01-16 22:15:52 +00:00
, nixosTests
2021-01-15 17:26:47 +00:00
, asciidoc
, pkg-config
2021-01-15 17:26:47 +00:00
, libxslt
, libxml2
, docbook_xml_dtd_45
, docbook_xsl
, dbus-glib
, libcap_ng
, libqb
, libseccomp
, polkit
, protobuf
, audit
, libsodium
}:
stdenv.mkDerivation rec {
2022-09-03 19:58:29 +00:00
version = "1.1.2";
pname = "usbguard";
2021-01-15 17:26:47 +00:00
src = fetchFromGitHub {
owner = "USBGuard";
repo = pname;
rev = "usbguard-${version}";
2022-09-03 19:58:29 +00:00
sha256 = "sha256-uwNoKczmVOMpkU4KcKTOtbcTHiYVGXjk/rVbqMl5pGk=";
2021-01-15 17:26:47 +00:00
fetchSubmodules = true;
};
nativeBuildInputs = [
2021-01-15 17:26:47 +00:00
autoreconfHook
2021-01-21 22:12:29 +00:00
installShellFiles
asciidoc
pkg-config
libxslt # xsltproc
libxml2 # xmllint
docbook_xml_dtd_45
docbook_xsl
2022-09-24 06:41:05 +00:00
dbus-glib # gdbus-codegen
protobuf # protoc
];
buildInputs = [
dbus-glib
libcap_ng
libqb
libseccomp
libsodium
polkit
protobuf
2018-02-27 18:07:43 +00:00
audit
];
configureFlags = [
"--with-bundled-catch"
"--with-bundled-pegtl"
"--with-dbus"
"--with-crypto-library=sodium"
"--with-polkit"
];
enableParallelBuilding = true;
2021-01-21 22:12:29 +00:00
postInstall = ''
installShellCompletion --bash --name usbguard.bash scripts/bash_completion/usbguard
installShellCompletion --zsh --name _usbguard scripts/usbguard-zsh-completion
'';
2021-01-16 22:15:52 +00:00
passthru.tests = nixosTests.usbguard;
2021-01-15 17:26:47 +00:00
meta = with lib; {
description = "The USBGuard software framework helps to protect your computer against BadUSB";
2021-01-15 17:26:47 +00:00
longDescription = ''
USBGuard is a software framework for implementing USB device authorization
policies (what kind of USB devices are authorized) as well as method of
use policies (how a USB device may interact with the system). Simply put,
it is a USB device whitelisting tool.
'';
2018-02-27 18:07:43 +00:00
homepage = "https://usbguard.github.io/";
license = licenses.gpl2Plus;
maintainers = [ maintainers.tnias ];
};
}