Unverified Commit b9d8a730 authored by K900's avatar K900 Committed by GitHub
Browse files

Merge pull request #264200 from K900/revert-specialfs

Revert "nixos/activation: remove specialfs activationScript"
parents 173c9a5f 7ea67d7c
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -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";