forked from Bos55/nix-config
29 lines
758 B
Nix
29 lines
758 B
Nix
{ self, nixpkgs, ... }:
|
|
|
|
let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
pkgs.nixosTest {
|
|
name = "deploy-user-test";
|
|
nodes = {
|
|
machine = { ... }: {
|
|
imports = [
|
|
../modules
|
|
../users
|
|
];
|
|
homelab.users.deploy.enable = true;
|
|
system.stateVersion = "24.11"; # Match the current nixpkgs version
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
machine.wait_for_unit("multi-user.target")
|
|
# Verify user exists
|
|
machine.succeed("id deploy")
|
|
# Verify we can run nix-env as deploy via sudo
|
|
machine.succeed("sudo -u deploy -n nix-env --version")
|
|
# Verify switch-to-configuration is accessible (it's added to path by the module)
|
|
machine.succeed("whereis switch-to-configuration")
|
|
'';
|
|
}
|