diff options
author | K900 <me@0upti.me> | 2023-10-29 20:18:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-29 20:18:05 +0300 |
commit | b9d8a730e36e688df855c40c39498b658b46955f (patch) | |
tree | 7be18f97e80b02caddbe46e6f08f7e8aa9c4314e | |
parent | 173c9a5f725f2f9f31a7fb8233af34d4dbcee330 (diff) | |
parent | 7ea67d7cb6d25ba4dbc2899bf2f09fe80861cd29 (diff) | |
download | nixlib-b9d8a730e36e688df855c40c39498b658b46955f.tar nixlib-b9d8a730e36e688df855c40c39498b658b46955f.tar.gz nixlib-b9d8a730e36e688df855c40c39498b658b46955f.tar.bz2 nixlib-b9d8a730e36e688df855c40c39498b658b46955f.tar.lz nixlib-b9d8a730e36e688df855c40c39498b658b46955f.tar.xz nixlib-b9d8a730e36e688df855c40c39498b658b46955f.tar.zst nixlib-b9d8a730e36e688df855c40c39498b658b46955f.zip |
Merge pull request #264200 from K900/revert-specialfs
Revert "nixos/activation: remove specialfs activationScript"
-rw-r--r-- | nixos/modules/system/activation/activation-script.nix | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index 95b0c7bbd681..bc0b7266ce95 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -230,7 +230,6 @@ in system.activationScripts.stdio = ""; # obsolete system.activationScripts.var = ""; # obsolete - system.activationScripts.specialfs = ""; # obsolete systemd.tmpfiles.rules = [ # Prevent the current configuration from being garbage-collected. @@ -252,6 +251,25 @@ in 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 = { services.nixos-activation = { description = "Run user-specific NixOS activation"; |