#!/nix/store/8favl12dxjfxwzgqq5jh53k2kjn19nn9-bash-5.3p9/bin/bash export PATH="$PATH" source /nix/store/mhxn5kwnri3z9hdzi3x0980id65p0icn-lib.sh systemConfig='/nix/store/46d2hd00aamgbfpxhszgw1fqxm8cm1k1-nixos-system-tjmaxxer-26.05.20261115.b349185' export PATH=/empty for i in /nix/store/p7ip75rls2g87d1yy4568djpa244c7ww-coreutils-9.11 /nix/store/hi1zxw2mg94cwrpbq1s8bbjm1k5y3vci-gnugrep-3.12 /nix/store/8kxpzdb09cbn252h8wl14zds9jgbw2q0-findutils-4.10.0 /nix/store/ihxzqah0kw2gs16d29bp47if242ifcfp-getent-glibc-2.42-103 /nix/store/63q6d44vsh55d3scq8fg5lrbyxwc5x13-glibc-2.42-103-bin /nix/store/5v9mnw4iwps50scgnycji3jkf8qgryqd-shadow-4.19.4 /nix/store/kcihriicx768wp1g5mn06rnqjylidj46-util-linux-2.42.4-bin; do PATH=$PATH:$i/bin:$i/sbin done _status=0 trap "_status=1 _localstatus=\$?" ERR # Ensure a consistent umask. umask 0022 #### Activation script snippet binsh: _localstatus=0 # Create the required /bin/sh symlink; otherwise lots of things # (notably the system() function) won't work. mkdir -p /bin chmod 0755 /bin ln -sfn "/nix/store/9g53s4a9kv7k5xbfjhyaxjymgw62di6r-bash-interactive-5.3p9/bin/sh" /bin/.sh.tmp mv /bin/.sh.tmp /bin/sh # atomically replace /bin/sh if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "binsh" "$_localstatus" fi #### Activation script snippet users: _localstatus=0 install -m 0700 -d /root install -m 0755 -d /home /nix/store/f45gxnyxlnc0alzml4vr6z1pbabj0qg6-perl-5.42.3-env/bin/perl \ -w /nix/store/dyx8qsmgnsz2csfzwn723gbd2jvp0j7g-update-users-groups.pl /nix/store/vjawdm8xi5yndvw6pi29kqcbk8vl71hr-users-groups.json if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "users" "$_localstatus" fi #### Activation script snippet specialfs: _localstatus=0 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 /nix/store/2457x44izpnd45pbwgklv73dzjpfcwz3-mounts.sh if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "specialfs" "$_localstatus" fi #### Activation script snippet etc: _localstatus=0 # Set up the statically computed bits of /etc. echo "setting up /etc..." /nix/store/xk8j5j5h6700sskl5nrp8ap7ds4zj817-perl-5.42.3-env/bin/perl /nix/store/rg5rf512szdxmnj9qal3wfdnpfsx38qi-setup-etc.pl /nix/store/22f7fp1d7g1y6albx9b6c4k6v611y8xp-etc/etc if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "etc" "$_localstatus" fi #### Activation script snippet generate-age-key: _localstatus=0 if [[ ! -f /var/lib/sops-nix/key.txt ]]; then echo generating machine-specific age key... mkdir -p $(dirname /var/lib/sops-nix/key.txt) # age-keygen sets 0600 by default, no need to chmod. /nix/store/zvyis6ccwbkmzf4n8rfhp31jn7kvwcdn-age-1.3.2/bin/age-keygen -o /var/lib/sops-nix/key.txt fi if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "generate-age-key" "$_localstatus" fi #### Activation script snippet hashes: _localstatus=0 users=() while IFS=: read -r user hash _; do if [[ "$hash" = "$"* && ! "$hash" =~ ^\$(y|gy|sm3y|7|2b|2y|2a|6)\$ ]]; then users+=("$user") fi done 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "hashes" "$_localstatus" fi #### Activation script snippet microvm-update-check: _localstatus=0 if [ -d /var/lib/microvms ]; then _outdated_microvms="" for dir in /var/lib/microvms/*; do if [ -e $dir/current/share/microvm/virtiofs ] && [ ! -e $dir/current/bin/virtiofsd-run ]; then _outdated_microvms="$_outdated_microvms $(basename $dir)" elif [ -e $dir/current/share/microvm/tap-interfaces ] && [ ! -e $dir/current/bin/tap-up ]; then _outdated_microvms="$_outdated_microvms $(basename $dir)" elif [ -e $dir/current/share/microvm/macvtap-interfaces ] && [ ! -e $dir/current/bin/macvtap-up ]; then _outdated_microvms="$_outdated_microvms $(basename $dir)" elif [ -e $dir/current/share/microvm/pci-devices ] && [ ! -e $dir/current/bin/pci-setup ]; then _outdated_microvms="$_outdated_microvms $(basename $dir)" fi done if [ "$_outdated_microvms" != "" ]; then echo "The following MicroVMs must be updated to follow the new virtiofsd/tap/macvtap/pci setup scheme: $_outdated_microvms" fi fi if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "microvm-update-check" "$_localstatus" fi #### Activation script snippet modprobe: _localstatus=0 # Allow the kernel to find our wrapped modprobe (which searches # in the right location in the Nix store for kernel modules). # We need this when the kernel (or some module) auto-loads a # module. echo /nix/store/nrvqr3nnif28v4nnkh5ilrld6fx772qi-kmod-31/bin/modprobe > /proc/sys/kernel/modprobe if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "modprobe" "$_localstatus" fi #### Activation script snippet setupSecrets: _localstatus=0 [ -e /run/current-system ] || echo setting up secrets... ( export HOME='/var/empty' export PATH='' export SOPS_GPG_EXEC='/nix/store/np3rbdn2m0dshnvfb8wq6wvxykb57niq-gnupg-2.4.9/bin/gpg' /nix/store/52sf529wg7kjlv4i3f885ygb1snqbpyn-sops-install-secrets-0.0.1/bin/sops-install-secrets /nix/store/m2yrqk3jav05pkd0gbz2vk0s68x79h49-manifest.json ) if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "setupSecrets" "$_localstatus" fi #### Activation script snippet udevd: _localstatus=0 # The deprecated hotplug uevent helper is not used anymore if [ -e /proc/sys/kernel/hotplug ]; then echo "" > /proc/sys/kernel/hotplug fi # Allow the kernel to find our firmware. if [ -e /sys/module/firmware_class/parameters/path ]; then echo -n "/nix/store/271820ryrflymigf1bj38ziaskdv09i1-firmware/lib/firmware" > /sys/module/firmware_class/parameters/path fi if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "udevd" "$_localstatus" fi #### Activation script snippet usrbinenv: _localstatus=0 mkdir -p /usr/bin chmod 0755 /usr/bin ln -sfn /nix/store/p7ip75rls2g87d1yy4568djpa244c7ww-coreutils-9.11/bin/env /usr/bin/.env.tmp mv /usr/bin/.env.tmp /usr/bin/env # atomically replace /usr/bin/env if (( _localstatus > 0 )); then printf "Activation script snippet '%s' failed (%s)\n" "usrbinenv" "$_localstatus" fi # Make this configuration the current configuration. # The readlink is there to ensure that when $systemConfig = /system # (which is a symlink to the store), /run/current-system is still # used as a garbage collection root. ln -sfn "$(readlink -f "$systemConfig")" /run/current-system exit $_status