Merge pull request #264200 from K900/revert-specialfs

Revert "nixos/activation: remove specialfs activationScript"

K900 b9d8a730 173c9a5f

Changed files
+19 -1
nixos
modules
system
+19 -1
nixos/modules/system/activation/activation-script.nix
···
system.activationScripts.stdio = ""; # obsolete
system.activationScripts.var = ""; # obsolete
-
system.activationScripts.specialfs = ""; # obsolete
systemd.tmpfiles.rules = [
# Prevent the current configuration from being garbage-collected.
···
else ''
rm -f /usr/bin/env
rmdir --ignore-fail-on-non-empty /usr/bin /usr
+
'';
+
+
system.activationScripts.specialfs =
+
''
+
specialMount() {
+
local device="$1"
+
local mountPoint="$2"
+
local options="$3"
+
local fsType="$4"
+
+
if mountpoint -q "$mountPoint"; then
+
local options="remount,$options"
+
else
+
mkdir -p "$mountPoint"
+
chmod 0755 "$mountPoint"
+
fi
+
mount -t "$fsType" -o "$options" "$device" "$mountPoint"
+
}
+
source ${config.system.build.earlyMountScript}
'';
systemd.user = {