diff --git a/flake.nix b/flake.nix index 39bffdee..49bb7a32 100644 --- a/flake.nix +++ b/flake.nix @@ -70,15 +70,11 @@ }); checks = forAllSystems (system: - let - test = path: import path { - pkgs = nixpkgsFor.${system}; - home-manager = inputs.home-manager; - module = self.homeManagerModules.plasma-manager; - }; - in { - default = test ./test/basic.nix; + default = nixpkgsFor.${system}.callPackage ./test/basic.nix { + home-manager-module = inputs.home-manager.nixosModules.home-manager; + plasma-module = self.homeManagerModules.plasma-manager; + }; }); devShells = forAllSystems (system: { diff --git a/test/basic.nix b/test/basic.nix index 50c64029..4c5b8cca 100644 --- a/test/basic.nix +++ b/test/basic.nix @@ -1,12 +1,10 @@ -{ pkgs, home-manager, module }: - +{ testers, home-manager-module, plasma-module, writeShellScriptBin, libsForQt5 }: let - script = pkgs.writeShellScriptBin "plasma-basic-test" '' - set -e - set -u + script = writeShellScriptBin "plasma-basic-test" '' + set -eu export XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config} - export PATH=${pkgs.libsForQt5.kconfig}/bin:$PATH + export PATH=${libsForQt5.kconfig}/bin:$PATH kread_global() { kreadconfig5 --file $XDG_CONFIG_HOME/kdeglobals --group $1 --key $2 @@ -24,25 +22,27 @@ let assert_eq KDE SingleClick false assert_eq General AllowKDEAppsToRememberWindowPositions true ''; +in +testers.nixosTest { + name = "plasma-basic"; - homeConfig = { - home.packages = [ script ]; + nodes.machine = { + environment.systemPackages = [ script ]; + imports = [ home-manager-module ]; - programs.plasma = { - enable = true; - workspace.clickItemTo = "select"; + users.users.fake = { + createHome = true; + isNormalUser = true; }; - }; - user = import ./user.nix { - inherit module home-manager homeConfig; - }; -in -pkgs.nixosTest { - name = "plasma-basic"; - - nodes.machine = { ... }: { - imports = [ user ]; + home-manager.users.fake = { + home.stateVersion = "23.11"; + imports = [ plasma-module ]; + programs.plasma = { + enable = true; + workspace.clickItemTo = "select"; + }; + }; }; testScript = '' diff --git a/test/user.nix b/test/user.nix index a5a1992d..4940e8c1 100644 --- a/test/user.nix +++ b/test/user.nix @@ -20,6 +20,7 @@ users.fake = { ... }: { imports = [ module homeConfig ]; + home.stateVersion = "23.11"; }; }; }