Use uid not username

This commit is contained in:
Ana Hobden 2024-01-08 13:02:38 -08:00
parent 0e5b724979
commit 161c1f6904
2 changed files with 2 additions and 2 deletions

2
dist/index.js generated vendored
View file

@ -489,7 +489,7 @@ class NixInstallerAction {
} }
async setup_kvm() { async setup_kvm() {
const current_user = (0,node_os__WEBPACK_IMPORTED_MODULE_8__.userInfo)(); const current_user = (0,node_os__WEBPACK_IMPORTED_MODULE_8__.userInfo)();
const is_root = current_user.username === "root"; const is_root = current_user.uid === 0;
const maybe_sudo = is_root ? "sudo" : ""; const maybe_sudo = is_root ? "sudo" : "";
const kvm_rules = "/etc/udev/rules.d/99-determinate-nix-installer-kvm.rules"; const kvm_rules = "/etc/udev/rules.d/99-determinate-nix-installer-kvm.rules";
try { try {

View file

@ -631,7 +631,7 @@ class NixInstallerAction {
private async setup_kvm(): Promise<boolean> { private async setup_kvm(): Promise<boolean> {
const current_user = userInfo(); const current_user = userInfo();
const is_root = current_user.username === "root"; const is_root = current_user.uid === 0;
const maybe_sudo = is_root ? "sudo" : ""; const maybe_sudo = is_root ? "sudo" : "";
const kvm_rules = const kvm_rules =