Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "nixos/activation: remove specialfs activationScript" #264200

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion nixos/modules/system/activation/activation-script.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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";
Expand Down