nixos/bcachefs: handle / (root filesystem) in autoScrub service

Without this, the service and timer name become like this:

❯  systemctl status bcachefs-scrub--.service
○ bcachefs-scrub--.service - bcachefs scrub on /
     Loaded: loaded (/etc/systemd/system/bcachefs-scrub--.service; linked; preset: ignored)
     Active: inactive (dead)
TriggeredBy: ● bcachefs-scrub--.timer
This commit is contained in:
John Titor
2025-08-17 18:24:50 +05:30
committed by Masum Reza
parent 22bca6d349
commit 74d1da02aa

View File

@@ -316,7 +316,7 @@ in
scrubTimer =
fs:
let
fs' = utils.escapeSystemdPath fs;
fs' = if fs == "/" then "root" else utils.escapeSystemdPath fs;
in
lib.nameValuePair "bcachefs-scrub-${fs'}" {
description = "regular bcachefs scrub timer on ${fs}";
@@ -336,7 +336,7 @@ in
scrubService =
fs:
let
fs' = utils.escapeSystemdPath fs;
fs' = if fs == "/" then "root" else utils.escapeSystemdPath fs;
in
lib.nameValuePair "bcachefs-scrub-${fs'}" {
description = "bcachefs scrub on ${fs}";