Compare commits

...

3 commits

4 changed files with 19 additions and 8 deletions

View file

@ -1,6 +1,7 @@
#!/bin/env fish
begin
set -l dir (status dirname)
set -l autologinConfig /etc/systemd/system/getty@tty1.service.d/autologin.conf
source "$dir/../lib/dependencies.fish"
source "$dir/../../Common/OS/setup.fish"
source "$dir/../../lib/settings.fish"
@ -111,17 +112,20 @@ begin
end
end
function autologin -S
function autologin -S -V autologinConfig
set -l mountDir (getOSConfig fileSystems.rootDir)
set -l file "/etc/systemd/system/getty@tty1.service.d/autologin.conf"
arch-chroot "$mountDir" mkdir -p (dirname "$file")
arch-chroot "$mountDir" mkdir -p (dirname "$autologinConfig")
and begin
printf %s\n \
"[Service]" \
"ExecStart=" \
"ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root %I \$TERM"
end | arch-chroot "$mountDir" tee "$file" >/dev/null
end | arch-chroot "$mountDir" tee "$autologinConfig" >/dev/null
end
function getAutologinDisableCommand -V autologinConfig
echo "rm -rf $(string escape (dirname "$autologinConfig"))"
end
if not type -q getInstallerScript

View file

@ -54,7 +54,7 @@ function installAction -V dir
and echo "This machine will reboot in 5 seconds..."
and echo "Press CTRL-C to abort..."
and sleep 5
and systemctl reboot -i
and sudo systemctl reboot -i
end
runSetupUserAction installAction

View file

@ -19,6 +19,12 @@ function runSetup
end
end
if not type -q getAutologinDisableCommand
function getAutologinDisableCommand
echo "true"
end
end
function getCloneFile -S -a path
set -l relativeDir (realpath --relative-to "$projectRoot" "$dir")
set -l relativePath (realpath --relative-to "$dir" "$path")
@ -101,7 +107,8 @@ function runSetup
end
end) \
(string escape $script) "&&")) \
"rm $tmp ||" \
"rm $tmp &&" \
"$(getAutologinDisableCommand) ||" \
"mv $tmp $profile"
end | runChroot "$mountDir" tee "$profile" >/dev/null
end

View file

@ -27,7 +27,7 @@ $null = New-Module {
Value = "$Value";
} `
-User $User `
".alias |= [((. // [])[] | select(.name != env(Name)))] + [{ name: env(Name), value: env(Value) }]";
".alias |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]";
}
<#
@ -53,7 +53,7 @@ $null = New-Module {
Value = "$Value";
} `
-User $User `
".env |= [((. // [])[] | select(.name != env(Name)))] + [{ name: env(Name), value: env(Value) }]";
".env |= [((. // [])[] | select(.name != env.Name))] + [{ name: env.Name, value: env.Value }]";
}
<#