From df8e6f7487dff2f99e4e0bb5d459aac3006d955c Mon Sep 17 00:00:00 2001 From: phaer Date: Tue, 10 Dec 2024 14:17:09 +0100 Subject: [PATCH] system/activation: mention deps attr in activationScripts example As it helps making deps easier to discover - as we don't currently render submodule options in the module correctly - and is arguably more technical correct: When using nixos-install to install nixos into a chroot in i.e. /mnt, there's no gurantee that /mnt/dev exists before the specialfs phase ran. --- .../system/activation/activation-script.nix | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index e052241acfd75..4986a8bf05192 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -110,14 +110,19 @@ in default = {}; example = literalExpression '' - { stdio.text = - ''' - # Needed by some programs. - ln -sfn /proc/self/fd /dev/fd - ln -sfn /proc/self/fd/0 /dev/stdin - ln -sfn /proc/self/fd/1 /dev/stdout - ln -sfn /proc/self/fd/2 /dev/stderr - '''; + { + stdio = { + # Run after /dev has been mounted + deps = [ "specialfs" ]; + text = + ''' + # Needed by some programs. + ln -sfn /proc/self/fd /dev/fd + ln -sfn /proc/self/fd/0 /dev/stdin + ln -sfn /proc/self/fd/1 /dev/stdout + ln -sfn /proc/self/fd/2 /dev/stderr + '''; + }; } '';