remove hard-coded username

This commit is contained in:
LordMZTE 2023-01-21 15:14:29 +01:00
parent 28df534c5f
commit 5d5f4dd6d1
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
3 changed files with 13 additions and 3 deletions

View File

@ -2,6 +2,7 @@ cg.addPath ".config"
cg.addPath ".local"
cg.addPath ".ssh"
cg.addPath ".cargo"
cg.addPath "etc"
for k, v in pairs(require "cg_opts") do
cg.opt[k] = v
@ -18,3 +19,12 @@ cg.opt.getDeviceConf = function(id)
return file:read "*a"
end
-- Get the output of a system command
cg.opt.system = function(cmd)
local handle = io.popen(cmd)
if handle == nil then
error("Failed to spawn process" .. cmd)
end
return handle:read("*a"):gsub("%s+", "")
end

View File

@ -1,3 +0,0 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -- lordmzte' --noclear --skip-login - $TERM

View File

@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -- <% opt.system "whoami" %>' --noclear --skip-login - $TERM