Compare commits

...

3 commits

4 changed files with 19 additions and 8 deletions

View file

@ -1,6 +1,7 @@
#!/bin/env fish #!/bin/env fish
begin begin
set -l dir (status dirname) set -l dir (status dirname)
set -l autologinConfig /etc/systemd/system/getty@tty1.service.d/autologin.conf
source "$dir/../lib/dependencies.fish" source "$dir/../lib/dependencies.fish"
source "$dir/../../Common/OS/setup.fish" source "$dir/../../Common/OS/setup.fish"
source "$dir/../../lib/settings.fish" source "$dir/../../lib/settings.fish"
@ -111,17 +112,20 @@ begin
end end
end end
function autologin -S function autologin -S -V autologinConfig
set -l mountDir (getOSConfig fileSystems.rootDir) set -l mountDir (getOSConfig fileSystems.rootDir)
set -l file "/etc/systemd/system/getty@tty1.service.d/autologin.conf" arch-chroot "$mountDir" mkdir -p (dirname "$autologinConfig")
arch-chroot "$mountDir" mkdir -p (dirname "$file")
and begin and begin
printf %s\n \ printf %s\n \
"[Service]" \ "[Service]" \
"ExecStart=" \ "ExecStart=" \
"ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root %I \$TERM" "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 end
if not type -q getInstallerScript 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 "This machine will reboot in 5 seconds..."
and echo "Press CTRL-C to abort..." and echo "Press CTRL-C to abort..."
and sleep 5 and sleep 5
and systemctl reboot -i and sudo systemctl reboot -i
end end
runSetupUserAction installAction runSetupUserAction installAction

View file

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

View file

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