Skip to content

Commit

Permalink
Merge branch 'trunk' into konsole
Browse files Browse the repository at this point in the history
  • Loading branch information
magnouvean authored Feb 26, 2024
2 parents 35857a5 + 59e9b9d commit 641ff07
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 58 deletions.
21 changes: 7 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,10 @@
inherit system;
modules = [
(import test/demo.nix {
pkgs = nixpkgsFor.x86_64-linux;
home-manager = inputs.home-manager;
module = self.homeManagerModules.plasma-manager;
extraPackages = with self.packages.${system}; [
rc2nix
];
home-manager-module = inputs.home-manager.nixosModules.home-manager;
plasma-module = self.homeManagerModules.plasma-manager;
})
(_: {environment.systemPackages = [ self.packages.${system}.rc2nix]; })
];
}).config.system.build.vm;

Expand All @@ -70,15 +67,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: {
Expand Down
42 changes: 21 additions & 21 deletions test/basic.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 = ''
Expand Down
44 changes: 21 additions & 23 deletions test/demo.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
{ pkgs
, home-manager
, module
, extraPackages
{ home-manager-module
, plasma-module
}:

let
homeConfig = {
imports = [ ../example/home.nix ];
};

user = import ./user.nix {
inherit module home-manager homeConfig;
};

in
{ modulesPath, ... }:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
(modulesPath + "/virtualisation/qemu-vm.nix")
user
home-manager-module
];

config = {
Expand All @@ -40,13 +28,11 @@ in
];
};

virtualisation = {
forwardPorts = [{
from = "host";
host.port = 2222;
guest.port = 22;
}];
};
virtualisation.forwardPorts = [{
from = "host";
host.port = 2222;
guest.port = 22;
}];

services.xserver = {
enable = true;
Expand All @@ -57,6 +43,18 @@ in
displayManager.autoLogin.user = "fake";
};

environment.systemPackages = extraPackages;
system.stateVersion = "22.05";

users.users.fake = {
createHome = true;
isNormalUser = true;
password = "password";
group = "users";
};

home-manager.users.fake = {
home.stateVersion = "22.05";
imports = [ plasma-module ];
};
};
}
1 change: 1 addition & 0 deletions test/user.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

users.fake = { ... }: {
imports = [ module homeConfig ];
home.stateVersion = "23.11";
};
};
}

0 comments on commit 641ff07

Please sign in to comment.