simplify user and group definitions

This commit is contained in:
Erik Arvstedt 2019-11-27 14:04:15 +01:00
parent 6c69eb8576
commit d61b185c3a
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
6 changed files with 7 additions and 23 deletions

View File

@ -295,14 +295,11 @@ in {
}; };
users.users.${cfg.user} = { users.users.${cfg.user} = {
name = cfg.user;
group = cfg.group; group = cfg.group;
extraGroups = [ "keys" ]; extraGroups = [ "keys" ];
description = "Bitcoin daemon user"; description = "Bitcoin daemon user";
home = cfg.dataDir; home = cfg.dataDir;
}; };
users.groups.${cfg.group} = { users.groups.${cfg.group} = {};
name = cfg.group;
};
}; };
} }

View File

@ -67,9 +67,7 @@ in {
extraGroups = [ "bitcoinrpc" "keys" ]; extraGroups = [ "bitcoinrpc" "keys" ];
home = cfg.dataDir; home = cfg.dataDir;
}; };
users.groups.clightning = { users.groups.clightning = {};
name = "clightning";
};
systemd.services.clightning = { systemd.services.clightning = {
description = "Run clightningd"; description = "Run clightningd";

View File

@ -58,15 +58,12 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
users.users.${cfg.user} = { users.users.${cfg.user} = {
name = cfg.user;
description = "electrs User"; description = "electrs User";
group = cfg.group; group = cfg.group;
extraGroups = [ "bitcoinrpc" "keys" "bitcoin"]; extraGroups = [ "bitcoinrpc" "keys" "bitcoin"];
home = cfg.dataDir; home = cfg.dataDir;
}; };
users.groups.electrs = { users.groups.${cfg.group} = {};
name = cfg.group;
};
systemd.services.electrs = { systemd.services.electrs = {
description = "Run electrs"; description = "Run electrs";

View File

@ -214,14 +214,11 @@ in {
); );
}; };
users.users.${cfg.user} = { users.users.${cfg.user} = {
name = cfg.user;
group = cfg.group; group = cfg.group;
extraGroups = [ "keys" ]; extraGroups = [ "keys" ];
description = "Liquid sidechain user"; description = "Liquid sidechain user";
home = cfg.dataDir; home = cfg.dataDir;
}; };
users.groups.${cfg.group} = { users.groups.${cfg.group} = {};
name = cfg.group;
};
}; };
} }

View File

@ -98,9 +98,7 @@ in {
extraGroups = [ "bitcoinrpc" "keys" ]; extraGroups = [ "bitcoinrpc" "keys" ];
home = cfg.dataDir; home = cfg.dataDir;
}; };
users.groups.lnd = { users.groups.lnd = {};
name = "lnd";
};
systemd.services.lnd = { systemd.services.lnd = {
description = "Run LND"; description = "Run LND";

View File

@ -52,15 +52,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
users.users.nanopos = users.users.nanopos = {
{
description = "nanopos User"; description = "nanopos User";
group = "nanopos"; group = "nanopos";
extraGroups = [ "keys" ]; extraGroups = [ "keys" ];
}; };
users.groups.nanopos = { users.groups.nanopos = {};
name = "nanopos";
};
systemd.services.nanopos = { systemd.services.nanopos = {
description = "Run nanopos"; description = "Run nanopos";