Skip to content

Commit f368a8f

Browse files
nixos/prometheus: remove absolute path literals (#511569)
2 parents de24c24 + cf3e31d commit f368a8f

4 files changed

Lines changed: 15 additions & 21 deletions

File tree

nixos/modules/services/monitoring/prometheus/exporters.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ let
374374
after = [ "network.target" ];
375375
serviceConfig.Restart = mkDefault "always";
376376
serviceConfig.PrivateTmp = mkDefault true;
377-
serviceConfig.WorkingDirectory = mkDefault /tmp;
377+
serviceConfig.WorkingDirectory = mkDefault "/tmp";
378378
serviceConfig.DynamicUser = mkDefault enableDynamicUser;
379379
serviceConfig.User = mkDefault conf.user;
380380
serviceConfig.Group = conf.group;

nixos/modules/services/monitoring/prometheus/exporters/blackbox.nix

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ let
2323
if (builtins.isPath file) || (lib.isStorePath file) then
2424
file
2525
else
26-
(
27-
lib.warn ''
28-
${logPrefix}: configuration file "${file}" is being copied to the nix-store.
29-
If you would like to avoid that, please set enableConfigCheck to false.
30-
'' /.
31-
+ file
32-
);
26+
(lib.warn ''
27+
${logPrefix}: configuration file "${file}" is being copied to the nix-store.
28+
If you would like to avoid that, please set enableConfigCheck to false.
29+
'' (builtins.toFile (builtins.baseNameOf file) (builtins.readFile file)));
3330
checkConfigLocation =
3431
file:
3532
if lib.hasPrefix "/tmp/" file then

nixos/modules/services/monitoring/prometheus/exporters/ecoflow.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,39 @@ in
2727
};
2828
ecoflowAccessKeyFile = mkOption {
2929
type = types.path;
30-
default = /etc/ecoflow-access-key;
30+
default = "/etc/ecoflow-access-key";
3131
description = ''
3232
Path to the file with your personal api access string from the Ecoflow development website <https://developer-eu.ecoflow.com>.
3333
Do to share or commit your plaintext scecrets to a public repo use: agenix or soaps.
3434
'';
3535
};
3636
ecoflowSecretKeyFile = mkOption {
3737
type = types.path;
38-
default = /etc/ecoflow-secret-key;
38+
default = "/etc/ecoflow-secret-key";
3939
description = ''
4040
Path to the file with your personal api secret string from the Ecoflow development website <https://developer-eu.ecoflow.com>.
4141
Do to share or commit your plaintext scecrets to a public repo use: agenix or soaps.
4242
'';
4343
};
4444
ecoflowEmailFile = mkOption {
4545
type = types.path;
46-
default = /etc/ecoflow-email;
46+
default = "/etc/ecoflow-email";
4747
description = ''
4848
Path to the file with your personal ecoflow app login email address.
4949
Do to share or commit your plaintext scecrets to a public repo use: agenix or soaps.
5050
'';
5151
};
5252
ecoflowPasswordFile = mkOption {
5353
type = types.path;
54-
default = /etc/ecoflow-password;
54+
default = "/etc/ecoflow-password";
5555
description = ''
5656
Path to the file with your personal ecoflow app login email password.
5757
Do to share or commit your plaintext passwords to a public repo use: agenix or soaps here!
5858
'';
5959
};
6060
ecoflowDevicesFile = mkOption {
6161
type = types.path;
62-
default = /etc/ecoflow-devices;
62+
default = "/etc/ecoflow-devices";
6363
description = ''
6464
File must contain one line, example: R3300000,R3400000,NC430000,....
6565
The list of devices serial numbers separated by comma. For instance: SN1,SN2,SN3.
@@ -69,7 +69,7 @@ in
6969
};
7070
ecoflowDevicesPrettyNamesFile = mkOption {
7171
type = types.path;
72-
default = /etc/ecoflow-devices-pretty-names;
72+
default = "/etc/ecoflow-devices-pretty-names";
7373
description = ''
7474
File must contain one line, example: {"R3300000":"Delta 2","R3400000":"Delta Pro",...}
7575
The key/value map of custom names for your devices. Key is a serial number, value is a device name you want

nixos/modules/services/monitoring/prometheus/exporters/snmp.nix

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,10 @@ let
2424
if (builtins.isPath file) || (lib.isStorePath file) then
2525
file
2626
else
27-
(
28-
lib.warn ''
29-
${logPrefix}: configuration file "${file}" is being copied to the nix-store.
30-
If you would like to avoid that, please set enableConfigCheck to false.
31-
'' /.
32-
+ file
33-
);
27+
(lib.warn ''
28+
${logPrefix}: configuration file "${file}" is being copied to the nix-store.
29+
If you would like to avoid that, please set enableConfigCheck to false.
30+
'' (builtins.toFile (builtins.baseNameOf file) (builtins.readFile file)));
3431

3532
checkConfig =
3633
file:

0 commit comments

Comments
 (0)