fix users in VM again

This commit is contained in:
Jörg Thalheim
2024-08-24 18:31:40 +02:00
parent de34e058f6
commit 969eb2f16e
3 changed files with 9 additions and 6 deletions

View File

@@ -48,7 +48,7 @@ let
boot.initrd.systemd.emergencyAccess = true; boot.initrd.systemd.emergencyAccess = true;
# sysusers would be faster because it doesn't need perl, but it cannot create normal users # sysusers would be faster because it doesn't need perl, but it cannot create normal users
systemd.sysusers.enable = false; systemd.sysusers.enable = true;
users.mutableUsers = false; users.mutableUsers = false;
users.allowNoPasswordLogin = true; users.allowNoPasswordLogin = true;

View File

@@ -45,13 +45,16 @@
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
users.users.user = lib.mkIf (config.clan.services.waypipe.user == "user") { users.users.user = lib.mkIf (config.clan.services.waypipe.user == "user") {
isNormalUser = true; # workaround sysusers
uid = 1000; isSystemUser = true;
password = ""; uid = 998;
group = "users";
initialPassword = "";
extraGroups = [ extraGroups = [
"wheel" "wheel"
"video" "video"
]; ];
home = "/home/user";
shell = "/run/current-system/sw/bin/bash"; shell = "/run/current-system/sw/bin/bash";
}; };

View File

@@ -114,8 +114,8 @@ def test_vm_persistence(
"/var/user-state", "/var/user-state",
] ]
config["my_machine"]["users"]["users"] = { config["my_machine"]["users"]["users"] = {
"test": {"password": "test", "isNormalUser": True}, "test": {"initialPassword": "test", "isSystemUser": True, "group": "users"},
"root": {"password": "root"}, "root": {"initialPassword": "root"},
} }
flake = generate_flake( flake = generate_flake(