move systemPackages definitions to services
These are generally useful and shouldn't be limited to secure-node.nix. Also, only add the hardware-wallets group when hardware wallets are enabled.
This commit is contained in:
parent
6c22e13b7f
commit
37b2faf63c
10 changed files with 24 additions and 28 deletions
|
|
@ -32,11 +32,16 @@ in {
|
|||
};
|
||||
|
||||
config = mkMerge [
|
||||
{
|
||||
# Create group
|
||||
(mkIf (cfg.ledger || cfg.trezor) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nix-bitcoin.hwi
|
||||
# Provides lsusb for debugging
|
||||
usbutils
|
||||
];
|
||||
users.groups."${cfg.group}" = {};
|
||||
}
|
||||
})
|
||||
(mkIf cfg.ledger {
|
||||
|
||||
# Ledger Nano S according to https://github.com/LedgerHQ/udev-rules/blob/master/add_udev_rules.sh
|
||||
# Don't use rules from nixpkgs because we want to use our own group.
|
||||
services.udev.packages = lib.singleton (pkgs.writeTextFile {
|
||||
|
|
@ -48,6 +53,7 @@ in {
|
|||
});
|
||||
})
|
||||
(mkIf cfg.trezor {
|
||||
environment.systemPackages = [ pkgs.python3.pkgs.trezor ];
|
||||
# Don't use rules from nixpkgs because we want to use our own group.
|
||||
services.udev.packages = lib.singleton (pkgs.writeTextFile {
|
||||
name = "trezord-udev-rules";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue