porcorosso: swap /root for a bindmount instead
This commit is contained in:
parent
63c8b98893
commit
0f86867d05
1 changed files with 18 additions and 9 deletions
|
@ -201,17 +201,26 @@ in {
|
||||||
};
|
};
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
#"L /etc/nixos - - - - /persist/etc/nixos"
|
#"L /etc/nixos - - - - /persist/etc/nixos"
|
||||||
"L /root - - - - /persist/root"
|
|
||||||
"d /var/lib/libvirt 0755 root - - -"
|
"d /var/lib/libvirt 0755 root - - -"
|
||||||
];
|
];
|
||||||
systemd.mounts = [{
|
systemd.mounts = let
|
||||||
bindsTo = ["libvirtd.service"];
|
bindMount' = dir: {
|
||||||
partOf = ["libvirtd.service"];
|
unitConfig.RequiresMountsFor = dir;
|
||||||
unitConfig.RequiresMountsFor = "/var/lib/libvirt";
|
options = "bind";
|
||||||
options = "bind";
|
what = "/persist${dir}";
|
||||||
what = "/persist/var/lib/libvirt";
|
where = dir;
|
||||||
where = "/var/lib/libvirt";
|
};
|
||||||
}];
|
bindMountSvc = dir: svc: (bindMount' dir) // {
|
||||||
|
bindsTo = [svc];
|
||||||
|
partOf = [svc];
|
||||||
|
};
|
||||||
|
bindMount = dir: (bindMount' dir) // {
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
};
|
||||||
|
in [
|
||||||
|
(bindMountSvc "/var/lib/libvirt" "libvirtd.service")
|
||||||
|
(bindMount "/root")
|
||||||
|
];
|
||||||
|
|
||||||
# Enable Thunderbolt device management.
|
# Enable Thunderbolt device management.
|
||||||
services.hardware.bolt.enable = true;
|
services.hardware.bolt.enable = true;
|
||||||
|
|
Loading…
Reference in a new issue