Add activation script to clean up old NFS automount unit
This commit is contained in:
10
default.nix
10
default.nix
@@ -256,6 +256,16 @@ in
|
|||||||
# Enable NFS client support
|
# Enable NFS client support
|
||||||
services.rpcbind.enable = true;
|
services.rpcbind.enable = true;
|
||||||
|
|
||||||
|
# Clean up old automount unit during activation
|
||||||
|
system.activationScripts.cleanupOldNfsAutomount = ''
|
||||||
|
if systemctl is-active mnt-nfs_share.automount &>/dev/null; then
|
||||||
|
systemctl stop mnt-nfs_share.automount || true
|
||||||
|
fi
|
||||||
|
if systemctl is-active mnt-nfs_share.mount &>/dev/null; then
|
||||||
|
systemctl stop mnt-nfs_share.mount || true
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
# NFS mount for shared storage
|
# NFS mount for shared storage
|
||||||
fileSystems."/mnt/nfs_share" = {
|
fileSystems."/mnt/nfs_share" = {
|
||||||
device = "192.168.1.249:/mnt/nfs_share";
|
device = "192.168.1.249:/mnt/nfs_share";
|
||||||
|
|||||||
Reference in New Issue
Block a user