2022-04-01 02:41:31 +00:00
|
|
|
import ./make-test-python.nix (
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
name = "maestral";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
|
|
|
maintainers = [ peterhoeg ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes =
|
|
|
|
let
|
|
|
|
common =
|
|
|
|
attrs:
|
|
|
|
pkgs.lib.recursiveUpdate {
|
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
systemd.user.services.maestral = {
|
|
|
|
description = "Maestral Dropbox Client";
|
|
|
|
serviceConfig.Type = "exec";
|
|
|
|
};
|
|
|
|
} attrs;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
cli =
|
|
|
|
{ ... }:
|
|
|
|
common {
|
|
|
|
systemd.user.services.maestral = {
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
serviceConfig.ExecStart = "${pkgs.maestral}/bin/maestral start --foreground";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
gui =
|
|
|
|
{ ... }:
|
|
|
|
common {
|
|
|
|
services.xserver = {
|
|
|
|
enable = true;
|
|
|
|
desktopManager.plasma5.enable = true;
|
|
|
|
desktopManager.plasma5.runUsingSystemd = true;
|
2024-02-27 20:28:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
services.displayManager = {
|
|
|
|
sddm.enable = true;
|
|
|
|
defaultSession = "plasma";
|
|
|
|
autoLogin = {
|
2022-04-01 02:41:31 +00:00
|
|
|
enable = true;
|
|
|
|
user = "alice";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services = {
|
|
|
|
maestral = {
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
|
|
serviceConfig.ExecStart = "${pkgs.maestral-gui}/bin/maestral_qt";
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2022-04-01 02:41:31 +00:00
|
|
|
# PowerDevil doesn't like our VM
|
|
|
|
plasma-powerdevil.enable = false;
|
2024-12-10 19:26:33 +00:00
|
|
|
};
|
2022-04-01 02:41:31 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
{ nodes, ... }:
|
|
|
|
let
|
2023-07-09 15:12:27 +00:00
|
|
|
user = nodes.cli.users.users.alice;
|
2022-04-01 02:41:31 +00:00
|
|
|
in
|
|
|
|
''
|
|
|
|
start_all()
|
|
|
|
|
|
|
|
with subtest("CLI"):
|
|
|
|
# we need SOME way to give the user an active login session
|
|
|
|
cli.execute("loginctl enable-linger ${user.name}")
|
|
|
|
cli.systemctl("start user@${toString user.uid}")
|
|
|
|
cli.wait_for_unit("maestral.service", "${user.name}")
|
|
|
|
|
|
|
|
with subtest("GUI"):
|
|
|
|
gui.wait_for_x()
|
2023-07-09 15:12:27 +00:00
|
|
|
gui.wait_for_file("/tmp/xauth_*")
|
|
|
|
gui.succeed("xauth merge /tmp/xauth_*")
|
2022-04-01 02:41:31 +00:00
|
|
|
gui.wait_for_window("^Desktop ")
|
|
|
|
gui.wait_for_unit("maestral.service", "${user.name}")
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
)
|