diff --git a/confgen.lua b/confgen.lua index cbd5015..2e832b1 100644 --- a/confgen.lua +++ b/confgen.lua @@ -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 diff --git a/etc/systemd/system/getty@tty1.service.d/skip-username.conf b/etc/systemd/system/getty@tty1.service.d/skip-username.conf deleted file mode 100644 index 7993d27..0000000 --- a/etc/systemd/system/getty@tty1.service.d/skip-username.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -ExecStart= -ExecStart=-/sbin/agetty -o '-p -- lordmzte' --noclear --skip-login - $TERM diff --git a/etc/systemd/system/getty@tty1.service.d/skip-username.conf.cgt b/etc/systemd/system/getty@tty1.service.d/skip-username.conf.cgt new file mode 100644 index 0000000..5eb4cf5 --- /dev/null +++ b/etc/systemd/system/getty@tty1.service.d/skip-username.conf.cgt @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/sbin/agetty -o '-p -- <% opt.system "whoami" %>' --noclear --skip-login - $TERM