server: prepare initrd changes for systemd 257

This commit is contained in:
chayleaf 2024-07-16 02:09:35 +07:00
parent 8acba4620b
commit 5ef36a7b93
Signed by: chayleaf
GPG key ID: 78171AD46227E68E

View file

@ -1,4 +1,5 @@
{ config { config
, lib
, pkgs , pkgs
, router-config , router-config
, hardware , hardware
@ -126,14 +127,16 @@ in
options = [ "defaults" "size=2G" "mode=755" ]; }; options = [ "defaults" "size=2G" "mode=755" ]; };
"/persist" = "/persist" =
{ device = "UUID=${uuids.bch}"; fsType = "bcachefs"; inherit neededForBoot; { device = "UUID=${uuids.bch}"; fsType = "bcachefs"; inherit neededForBoot;
# TODO: https://github.com/systemd/systemd/pull/33720/files # TODO: remove the if when systemd >= 257
options = [ options = let
dep = if lib.versionAtLeast config.boot.initrd.systemd.package.version "257" then "wants" else "requires";
in [
"degraded" "degraded"
"errors=ro" "errors=ro"
"x-systemd.device-timeout=0" "x-systemd.device-timeout=0"
"x-systemd.requires=dev-mapper-bch0.device" "x-systemd.${dep}=dev-mapper-bch0.device"
"x-systemd.requires=dev-mapper-bch1.device" "x-systemd.${dep}=dev-mapper-bch1.device"
"x-systemd.requires=dev-mapper-bch2.device" "x-systemd.${dep}=dev-mapper-bch2.device"
]; }; ]; };
"/boot" = { device = parts.boot; fsType = "vfat"; inherit neededForBoot; }; "/boot" = { device = parts.boot; fsType = "vfat"; inherit neededForBoot; };
}; };