From d61b185c3a03c67218a5b09a2e221978f82434ac Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 27 Nov 2019 14:04:15 +0100 Subject: [PATCH] simplify user and group definitions --- modules/bitcoind.nix | 5 +---- modules/clightning.nix | 4 +--- modules/electrs.nix | 5 +---- modules/liquid.nix | 5 +---- modules/lnd.nix | 4 +--- modules/nanopos.nix | 7 ++----- 6 files changed, 7 insertions(+), 23 deletions(-) diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index b3baf19..3903290 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -295,14 +295,11 @@ in { }; users.users.${cfg.user} = { - name = cfg.user; group = cfg.group; extraGroups = [ "keys" ]; description = "Bitcoin daemon user"; home = cfg.dataDir; }; - users.groups.${cfg.group} = { - name = cfg.group; - }; + users.groups.${cfg.group} = {}; }; } diff --git a/modules/clightning.nix b/modules/clightning.nix index 042187b..4fc1e89 100644 --- a/modules/clightning.nix +++ b/modules/clightning.nix @@ -67,9 +67,7 @@ in { extraGroups = [ "bitcoinrpc" "keys" ]; home = cfg.dataDir; }; - users.groups.clightning = { - name = "clightning"; - }; + users.groups.clightning = {}; systemd.services.clightning = { description = "Run clightningd"; diff --git a/modules/electrs.nix b/modules/electrs.nix index b29ae3c..2d6ee20 100644 --- a/modules/electrs.nix +++ b/modules/electrs.nix @@ -58,15 +58,12 @@ in { config = mkIf cfg.enable { users.users.${cfg.user} = { - name = cfg.user; description = "electrs User"; group = cfg.group; extraGroups = [ "bitcoinrpc" "keys" "bitcoin"]; home = cfg.dataDir; }; - users.groups.electrs = { - name = cfg.group; - }; + users.groups.${cfg.group} = {}; systemd.services.electrs = { description = "Run electrs"; diff --git a/modules/liquid.nix b/modules/liquid.nix index 968618d..c558a6a 100644 --- a/modules/liquid.nix +++ b/modules/liquid.nix @@ -214,14 +214,11 @@ in { ); }; users.users.${cfg.user} = { - name = cfg.user; group = cfg.group; extraGroups = [ "keys" ]; description = "Liquid sidechain user"; home = cfg.dataDir; }; - users.groups.${cfg.group} = { - name = cfg.group; - }; + users.groups.${cfg.group} = {}; }; } diff --git a/modules/lnd.nix b/modules/lnd.nix index 5131834..496eb11 100644 --- a/modules/lnd.nix +++ b/modules/lnd.nix @@ -98,9 +98,7 @@ in { extraGroups = [ "bitcoinrpc" "keys" ]; home = cfg.dataDir; }; - users.groups.lnd = { - name = "lnd"; - }; + users.groups.lnd = {}; systemd.services.lnd = { description = "Run LND"; diff --git a/modules/nanopos.nix b/modules/nanopos.nix index 300da4b..2dc7364 100644 --- a/modules/nanopos.nix +++ b/modules/nanopos.nix @@ -52,15 +52,12 @@ in { }; config = mkIf cfg.enable { - users.users.nanopos = - { + users.users.nanopos = { description = "nanopos User"; group = "nanopos"; extraGroups = [ "keys" ]; }; - users.groups.nanopos = { - name = "nanopos"; - }; + users.groups.nanopos = {}; systemd.services.nanopos = { description = "Run nanopos";