···110110111111- `services.ntpd-rs` now performs configuration validation.
112112113113+- `services.monero` now includes the `environmentFile` option for adding secrets to the Monero daemon config.
114114+113115- `amdgpu` kernel driver overdrive mode can now be enabled by setting [hardware.amdgpu.overdrive.enable](#opt-hardware.amdgpu.overdrive.enable) and customized through [hardware.amdgpu.overdrive.ppfeaturemask](#opt-hardware.amdgpu.overdrive.ppfeaturemask).
114116 This allows for fine-grained control over the GPU's performance and maybe required by overclocking softwares like Corectrl and Lact. These new options replace old options such as {option}`programs.corectrl.gpuOverclock.enable` and {option}`programs.tuxclocker.enableAMD`.
115117
+33-1
nixos/modules/services/networking/monero.nix
···226226 '';
227227 };
228228229229+ environmentFile = lib.mkOption {
230230+ type = lib.types.nullOr lib.types.path;
231231+ default = null;
232232+ example = "/var/lib/monero/monerod.env";
233233+ description = ''
234234+ Path to an EnvironmentFile for the monero service as defined in {manpage}`systemd.exec(5)`.
235235+236236+ Secrets may be passed to the service by specifying placeholder variables in the Nix config
237237+ and setting values in the environment file.
238238+239239+ Example:
240240+241241+ ```
242242+ # In environment file:
243243+ MINING_ADDRESS=888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H
244244+ ```
245245+246246+ ```
247247+ # Service config
248248+ services.monero.mining.address = "$MINING_ADDRESS";
249249+ ```
250250+ '';
251251+ };
252252+229253 extraConfig = lib.mkOption {
230254 type = lib.types.lines;
231255 default = "";
···257281 after = [ "network.target" ];
258282 wantedBy = [ "multi-user.target" ];
259283284284+ preStart = ''
285285+ umask 077
286286+ ${pkgs.envsubst}/bin/envsubst \
287287+ -i ${configFile} \
288288+ -o ${cfg.dataDir}/monerod.conf
289289+ '';
290290+260291 serviceConfig = {
261292 User = "monero";
262293 Group = "monero";
263263- ExecStart = "${lib.getExe' pkgs.monero-cli "monerod"} --config-file=${configFile} --non-interactive";
294294+ EnvironmentFile = lib.mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
295295+ ExecStart = "${lib.getExe' pkgs.monero-cli "monerod"} --config-file=${cfg.dataDir}/monerod.conf --non-interactive";
264296 Restart = "always";
265297 SuccessExitStatus = [
266298 0