Nitrokey: Difference between revisions

imported>Neutrocyte
Created page with "This article describes how you can use your [https://www.nitrokey.com Nitrokey] Nitrokey with NixOS ==Installation== Either install the Nitrokey-app Ad..."
 
Lilly (talk | contribs)
add cli applications for nitrokey storage and nitrokey pro
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This article describes how you can use your [https://www.nitrokey.com Nitrokey] [[Wikipedia:Nitrokey|Nitrokey]] with NixOS
<languages/>


<translate>
This article describes how you can use your [[Wikipedia:Nitrokey|Nitrokey]] with NixOS.
There are multiple variants of Nitrokeys, with the newest being the "Nitrokey 3". Different products support different security operations like FIDO2, One-Time-Passwords and S/MIME and OpenPGP key handling <ref>https://en.wikipedia.org/wiki/Nitrokey#Technical_features</ref>.
</translate>
<translate>
==Installation==
==Installation==
Either install the Nitrokey-app Ad-hoc with  
 
<syntaxHighlight lang=bash>$ nix-env -iA nixos.nitrokey-app</syntaxHighlight>
While Nitrokey devices operate via USB (a standard port & protocol), to use it in a meaningful way, udev rules need to be added to the system to make the USB device available to regular users.
or declarative by adding it to your configuration.nix.
</translate>
You also want to enable the udev rules and the PCSC-Lite daemon with
 
<translate>
===Shell===
 
Depending on your Nitrokey device, there are different CLI applications to interact with it.
 
* {{nixos:package|nitrocli}} (CLI) and {{nixos:package|nitrokey-app}} (GUI) for ''Nitrokey Pro'' and ''Nitrokey Storage''
* {{nixos:package|pynitrokey}} (CLI) and {{nixos:package|nitrokey-app2}} (GUI) for ''Nitrokey 3''.
 
{{info|You will not be able to interact with Nitrokey devices unless you include appropriate udev rules on your system or have elevated privileges.}}
 
</translate>
 
<translate>
===System Setup===
 
To make Nitrokey devices usable by regular users, enable the appropriate hardware option.
This will set up correct udev rules.
</translate>
 
{{code|lang=nix|1=hardware.nitrokey.enable = true;}}
 
<translate>
== Tips and Tricks ==
 
=== GPG Support ===
 
{{expand|scope=Section|What exactly do these options do and which functionality does that enable for your nitrokey device?}}
 
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
services.udev.packages = [ pkgs.nitrokey-udev-rules ];
programs = {
  ssh.startAgent = false;
  gnupg.agent = {
    enable = true;
    enableSSHSupport = true;
  };
};
</syntaxHighlight>
</translate>
 
<translate>
=== KeePassXC ===
 
[https://keepassxc.org/ KeePassXC] supports securing a password database with Nitrokey hardware tokens. The [https://docs.nitrokey.com/software/nk-app2/keepassxc official Nitrokey documentation] has details on how a Nitrokey device must be set up to work with KeePassXC.
 
However, some NixOS Options should be set to make it work:
</translate>
 
{{code|lang=nix|1=
services.pcscd.enable = true;
services.pcscd.enable = true;
</syntaxHighlight>
environment.systemPackages = [ pkgs.nitrokey-app2 ];
}}
 
<translate>
==References==
 
<references/>
</translate>
 
<translate>
<!--T:4-->
[[Category:Hardware]]
</translate>