diff --git a/tests/common.nix b/tests/common.nix index 08f10d79..8bce8fee 100644 --- a/tests/common.nix +++ b/tests/common.nix @@ -1,4 +1,5 @@ { pkgs, ... }: + { catppuccin = { enable = true; diff --git a/tests/darwin.nix b/tests/darwin.nix index 90797322..f40d8d5f 100644 --- a/tests/darwin.nix +++ b/tests/darwin.nix @@ -10,41 +10,45 @@ modules = [ ./home.nix - { - home = { - homeDirectory = "/Users/test"; - }; - - i18n.inputMethod.enabled = lib.mkVMOverride null; - - programs = { - cava.enable = lib.mkVMOverride false; # NOTE: this may actually work on darwin, but the package is currently not supported - foot.enable = lib.mkVMOverride false; - fuzzel.enable = lib.mkVMOverride false; - hyprlock.enable = lib.mkVMOverride false; - imv.enable = lib.mkVMOverride false; - mpv.enable = lib.mkVMOverride false; # NOTE: same as cava, but `mpv` fails to build currently - obs-studio.enable = lib.mkVMOverride false; - rio.enable = lib.mkVMOverride false; # marked as broken - rofi.enable = lib.mkVMOverride false; - spotify-player.enable = lib.mkVMOverride false; # NOTE: same as mpv - swaylock.enable = lib.mkVMOverride false; - tofi.enable = lib.mkVMOverride false; - waybar.enable = lib.mkVMOverride false; - }; - - qt.enable = lib.mkVMOverride false; # NOTE: same as cava - - services = { - dunst.enable = lib.mkVMOverride false; - mako.enable = lib.mkVMOverride false; - polybar.enable = lib.mkVMOverride false; - }; - - wayland.windowManager = { - hyprland.enable = lib.mkVMOverride false; - sway.enable = lib.mkVMOverride false; - }; - } + ( + { config, ... }: + + { + home = { + homeDirectory = "/Users/${config.home.username}"; + }; + + i18n.inputMethod.enabled = lib.mkVMOverride null; + + programs = { + cava.enable = lib.mkVMOverride false; # NOTE: this may actually work on darwin, but the package is currently not supported + foot.enable = lib.mkVMOverride false; + fuzzel.enable = lib.mkVMOverride false; + hyprlock.enable = lib.mkVMOverride false; + imv.enable = lib.mkVMOverride false; + mpv.enable = lib.mkVMOverride false; # NOTE: same as cava, but `mpv` fails to build currently + obs-studio.enable = lib.mkVMOverride false; + rio.enable = lib.mkVMOverride false; # marked as broken + rofi.enable = lib.mkVMOverride false; + spotify-player.enable = lib.mkVMOverride false; # NOTE: same as mpv + swaylock.enable = lib.mkVMOverride false; + tofi.enable = lib.mkVMOverride false; + waybar.enable = lib.mkVMOverride false; + }; + + qt.enable = lib.mkVMOverride false; # NOTE: same as cava + + services = { + dunst.enable = lib.mkVMOverride false; + mako.enable = lib.mkVMOverride false; + polybar.enable = lib.mkVMOverride false; + }; + + wayland.windowManager = { + hyprland.enable = lib.mkVMOverride false; + sway.enable = lib.mkVMOverride false; + }; + } + ) ]; }).activationPackage diff --git a/tests/home.nix b/tests/home.nix index e2b86102..dd4dd22f 100644 --- a/tests/home.nix +++ b/tests/home.nix @@ -1,4 +1,5 @@ { lib, ... }: + { imports = [ ../modules/home-manager @@ -8,7 +9,7 @@ xdg.enable = true; home = { - username = "test"; + username = lib.fileContents ./username.txt; stateVersion = lib.mkDefault "23.11"; }; diff --git a/tests/nixos.nix b/tests/nixos.nix index 4ff076da..3f45f998 100644 --- a/tests/nixos.nix +++ b/tests/nixos.nix @@ -1,10 +1,19 @@ -{ testers, home-manager }: +{ + lib, + testers, + home-manager, +}: + +let + userName = lib.fileContents ./username.txt; +in testers.runNixOSTest { - name = "module-test"; + name = "catppuccin-nix"; nodes.machine = { lib, pkgs, ... }: + { imports = [ home-manager.nixosModules.default @@ -32,9 +41,8 @@ testers.runNixOSTest { type = "fcitx5"; }; - users.users.test = { + users.users.${userName} = { isNormalUser = true; - home = "/home/test"; uid = 1000; }; @@ -43,16 +51,18 @@ testers.runNixOSTest { writableStore = true; }; - home-manager.users.test = { + home-manager.users.${userName} = { imports = [ ./home.nix ]; }; }; testScript = { nodes, ... }: + let - user = nodes.machine.users.users.test; + user = nodes.machine.users.users.${userName}; in + '' start_all() diff --git a/tests/username.txt b/tests/username.txt new file mode 100644 index 00000000..73a42455 --- /dev/null +++ b/tests/username.txt @@ -0,0 +1 @@ +pepperjack