From 7cf3ffbddd72aa76ef3a4058f1a03e68c7f1035f Mon Sep 17 00:00:00 2001 From: Johannes Arnold Date: Tue, 4 May 2021 21:12:54 +0000 Subject: [PATCH 1/3] nixos/monero: add dataDir option --- nixos/modules/services/networking/monero.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/monero.nix b/nixos/modules/services/networking/monero.nix index fde3293fc13..1119218a4ab 100644 --- a/nixos/modules/services/networking/monero.nix +++ b/nixos/modules/services/networking/monero.nix @@ -4,7 +4,6 @@ with lib; let cfg = config.services.monero; - dataDir = "/var/lib/monero"; listToConf = option: list: concatMapStrings (value: "${option}=${value}\n") list; @@ -53,6 +52,14 @@ in enable = mkEnableOption "Monero node daemon"; + dataDir = mkOption { + type = types.str; + default = "/var/lib/monero"; + description = '' + The directory where Monero stores its data files. + ''; + }; + mining.enable = mkOption { type = types.bool; default = false; @@ -200,7 +207,7 @@ in users.users.monero = { uid = config.ids.uids.monero; description = "Monero daemon user"; - home = dataDir; + home = cfg.dataDir; createHome = true; }; From ff65166f447e9db95f79670d2a0618ccb246748b Mon Sep 17 00:00:00 2001 From: Johannes Arnold Date: Tue, 4 May 2021 21:13:31 +0000 Subject: [PATCH 2/3] nixos/monero: fix typo --- nixos/modules/services/networking/monero.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/monero.nix b/nixos/modules/services/networking/monero.nix index 1119218a4ab..7a43d351768 100644 --- a/nixos/modules/services/networking/monero.nix +++ b/nixos/modules/services/networking/monero.nix @@ -64,7 +64,7 @@ in type = types.bool; default = false; description = '' - Whether to mine moneroj. + Whether to mine monero. ''; }; From c0853b6e2c673b774ed846cbd16c5abea7c6b085 Mon Sep 17 00:00:00 2001 From: Johannes Arnold Date: Wed, 5 May 2021 14:47:46 +0200 Subject: [PATCH 3/3] nixos/monero: use isSystemUser = true --- nixos/modules/misc/ids.nix | 4 ++-- nixos/modules/services/networking/monero.nix | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 1fd56adfe10..05cc5002aaf 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -315,7 +315,7 @@ in restya-board = 284; mighttpd2 = 285; hass = 286; - monero = 287; + #monero = 287; # dynamically allocated as of 2021-05-08 ceph = 288; duplicati = 289; monetdb = 290; @@ -617,7 +617,7 @@ in restya-board = 284; mighttpd2 = 285; hass = 286; - monero = 287; + # monero = 287; # dynamically allocated as of 2021-05-08 ceph = 288; duplicati = 289; monetdb = 290; diff --git a/nixos/modules/services/networking/monero.nix b/nixos/modules/services/networking/monero.nix index 7a43d351768..952d1d47ca6 100644 --- a/nixos/modules/services/networking/monero.nix +++ b/nixos/modules/services/networking/monero.nix @@ -205,15 +205,14 @@ in config = mkIf cfg.enable { users.users.monero = { - uid = config.ids.uids.monero; + isSystemUser = true; + group = "monero"; description = "Monero daemon user"; home = cfg.dataDir; createHome = true; }; - users.groups.monero = { - gid = config.ids.gids.monero; - }; + users.groups.monero = { }; systemd.services.monero = { description = "monero daemon";