diff options
author | K900 <me@0upti.me> | 2023-10-29 20:08:48 +0300 |
---|---|---|
committer | K900 <me@0upti.me> | 2023-10-29 20:08:48 +0300 |
commit | 7ea67d7cb6d25ba4dbc2899bf2f09fe80861cd29 (patch) | |
tree | 7c69de1859950a298ca0b3fcb4f87555010e35eb /nixos/modules/system | |
parent | 9f689d42a7bb21f28fb2189f4c566f203ab009ad (diff) |
Revert "nixos/activation: remove specialfs activationScript"
This reverts commit a8f50f991948b91d1a191d1348bfff860a39b5a2. Broke installer tests, need to figure out how to fix nixos-enter before attempting this again.
Diffstat (limited to 'nixos/modules/system')
-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 95b0c7bbd6817..bc0b7266ce959 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"; |