Merge pull request #108319 from KaiHa/pr/nitrokey-app-1.4.2

This commit is contained in:
Sandro 2021-01-19 19:20:35 +01:00 committed by GitHub
commit f591395492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 29 deletions

View File

@ -19,23 +19,9 @@ in
nitrokey-app package, depending on your device and needs.
'';
};
group = mkOption {
type = types.str;
default = "nitrokey";
example = "wheel";
description = ''
Grant access to Nitrokey devices to users in this group.
'';
};
};
config = mkIf cfg.enable {
services.udev.packages = [
(pkgs.nitrokey-udev-rules.override (attrs:
{ inherit (cfg) group; }
))
];
users.groups.${cfg.group} = {};
services.udev.packages = [ pkgs.nitrokey-udev-rules ];
};
}

View File

@ -3,21 +3,16 @@
stdenv.mkDerivation rec {
pname = "nitrokey-app";
version = "1.3.2";
version = "1.4.2";
src = fetchFromGitHub {
owner = "Nitrokey";
repo = "nitrokey-app";
rev = "v${version}";
sha256 = "193kzlz3qn9il56h78faiqkgv749hdils1nn1iw6g3wphgx5fjs2";
sha256 = "1k0w921hfrya4q2r7bqn7kgmwvwb7c15k9ymlbnksmfc9yyjyfcv";
fetchSubmodules = true;
};
postPatch = ''
substituteInPlace libnitrokey/CMakeLists.txt \
--replace '/data/41-nitrokey.rules' '/libnitrokey/data/41-nitrokey.rules'
'';
buildInputs = [
bash-completion
hidapi

View File

@ -1,6 +1,5 @@
{ lib, stdenv, nitrokey-app
, group ? "nitrokey"
}:
{ lib, stdenv, nitrokey-app }:
stdenv.mkDerivation {
name = "nitrokey-udev-rules-${lib.getVersion nitrokey-app}";
@ -9,10 +8,6 @@ stdenv.mkDerivation {
dontBuild = true;
patchPhase = ''
substituteInPlace libnitrokey/data/41-nitrokey.rules --replace plugdev "${group}"
'';
installPhase = ''
mkdir -p $out/etc/udev/rules.d
cp libnitrokey/data/41-nitrokey.rules $out/etc/udev/rules.d