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 = [
|
||||
#"L /etc/nixos - - - - /persist/etc/nixos"
|
||||
"L /root - - - - /persist/root"
|
||||
"d /var/lib/libvirt 0755 root - - -"
|
||||
];
|
||||
systemd.mounts = [{
|
||||
bindsTo = ["libvirtd.service"];
|
||||
partOf = ["libvirtd.service"];
|
||||
unitConfig.RequiresMountsFor = "/var/lib/libvirt";
|
||||
systemd.mounts = let
|
||||
bindMount' = dir: {
|
||||
unitConfig.RequiresMountsFor = dir;
|
||||
options = "bind";
|
||||
what = "/persist/var/lib/libvirt";
|
||||
where = "/var/lib/libvirt";
|
||||
}];
|
||||
what = "/persist${dir}";
|
||||
where = dir;
|
||||
};
|
||||
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.
|
||||
services.hardware.bolt.enable = true;
|
||||
|
|
Loading…
Reference in a new issue