Skip to content

Commit f91b6f3

Browse files
committed
nixos/rasdaemon: add package option
1 parent 498c2d6 commit f91b6f3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

nixos/modules/services/hardware/rasdaemon.nix

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ in
1414

1515
enable = lib.mkEnableOption "RAS logging daemon";
1616

17+
package = lib.mkPackageOption pkgs "rasdaemon" { };
18+
1719
record = lib.mkOption {
1820
type = lib.types.bool;
1921
default = true;
@@ -99,7 +101,7 @@ in
99101
};
100102
};
101103
environment.systemPackages =
102-
[ pkgs.rasdaemon ]
104+
[ cfg.package ]
103105
++ lib.optionals (cfg.testing) (
104106
with pkgs.error-inject;
105107
[
@@ -151,12 +153,12 @@ in
151153
StateDirectory = lib.optionalString (cfg.record) "rasdaemon";
152154

153155
ExecStart =
154-
"${pkgs.rasdaemon}/bin/rasdaemon --foreground" + lib.optionalString (cfg.record) " --record";
155-
ExecStop = "${pkgs.rasdaemon}/bin/rasdaemon --disable";
156+
"${cfg.package}/bin/rasdaemon --foreground" + lib.optionalString (cfg.record) " --record";
157+
ExecStop = "${cfg.package}/bin/rasdaemon --disable";
156158
Restart = "on-abort";
157159

158160
# src/misc/rasdaemon.service.in shows this:
159-
# ExecStartPost = ${pkgs.rasdaemon}/bin/rasdaemon --enable
161+
# ExecStartPost = ${cfg.package}/bin/rasdaemon --enable
160162
# but that results in unpredictable existence of the database
161163
# and everything seems to be enabled without this...
162164
};
@@ -167,7 +169,7 @@ in
167169
wantedBy = [ "multi-user.target" ];
168170
serviceConfig = {
169171
Type = "oneshot";
170-
ExecStart = "${pkgs.rasdaemon}/bin/ras-mc-ctl --register-labels";
172+
ExecStart = "${cfg.package}/bin/ras-mc-ctl --register-labels";
171173
RemainAfterExit = true;
172174
};
173175
};

0 commit comments

Comments
 (0)