From 969eb2f16edb5cb63aff7c3bf08acbcd30400198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 24 Aug 2024 18:31:40 +0200 Subject: [PATCH] fix users in VM again --- nixosModules/clanCore/vm.nix | 2 +- nixosModules/clanCore/waypipe.nix | 9 ++++++--- pkgs/clan-cli/tests/test_vms_cli.py | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/nixosModules/clanCore/vm.nix b/nixosModules/clanCore/vm.nix index 88cea4524..e666f7159 100644 --- a/nixosModules/clanCore/vm.nix +++ b/nixosModules/clanCore/vm.nix @@ -48,7 +48,7 @@ let boot.initrd.systemd.emergencyAccess = true; # 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.allowNoPasswordLogin = true; diff --git a/nixosModules/clanCore/waypipe.nix b/nixosModules/clanCore/waypipe.nix index b6c3b11b9..6b590cd9f 100644 --- a/nixosModules/clanCore/waypipe.nix +++ b/nixosModules/clanCore/waypipe.nix @@ -45,13 +45,16 @@ security.sudo.wheelNeedsPassword = false; users.users.user = lib.mkIf (config.clan.services.waypipe.user == "user") { - isNormalUser = true; - uid = 1000; - password = ""; + # workaround sysusers + isSystemUser = true; + uid = 998; + group = "users"; + initialPassword = ""; extraGroups = [ "wheel" "video" ]; + home = "/home/user"; shell = "/run/current-system/sw/bin/bash"; }; diff --git a/pkgs/clan-cli/tests/test_vms_cli.py b/pkgs/clan-cli/tests/test_vms_cli.py index 0c473d854..ac8c90a64 100644 --- a/pkgs/clan-cli/tests/test_vms_cli.py +++ b/pkgs/clan-cli/tests/test_vms_cli.py @@ -114,8 +114,8 @@ def test_vm_persistence( "/var/user-state", ] config["my_machine"]["users"]["users"] = { - "test": {"password": "test", "isNormalUser": True}, - "root": {"password": "root"}, + "test": {"initialPassword": "test", "isSystemUser": True, "group": "users"}, + "root": {"initialPassword": "root"}, } flake = generate_flake(