Compare commits

...

1 commit

Author SHA1 Message Date
Robert Helgesson dc1e9d1bc6
qt: add option qt.systemdServicePath
This option contains a string suitable as value for the PATH
environment variable in systemd services that run Qt 5 applications.

Qt applications need this special treatment because they use PATH to
locate plugins that sometimes are necessary for proper functioning.

For now the option is not visible in the manual since the default
value is expected to work in most, if not all, cases.
2018-06-03 17:32:57 +02:00
4 changed files with 19 additions and 3 deletions

View file

@ -24,6 +24,22 @@ in
settings.
'';
};
systemdServicePath = mkOption {
type = types.envVar;
default = lib.makeSearchPath "bin" [
"/etc/profiles/per-user/%u"
"%h/.nix-profile"
"/nix/var/nix/profiles/default"
"/run/current-system/sw"
];
visible = false;
description = ''
Path to use for systemd services that run Qt 5 applications.
This is to ensure that the application is able to locate any
necessary Qt plugins.
'';
};
};
};

View file

@ -33,7 +33,7 @@ in
};
Service = {
Environment = "PATH=%h/.nix-profile/bin";
Environment = "PATH=${config.qt.systemdServicePath}";
ExecStart = "${package}/bin/flameshot";
Restart = "on-abort";
};

View file

@ -18,7 +18,7 @@ with lib;
};
Service = {
Environment = "PATH=%h/.nix-profile/bin";
Environment = "PATH=${config.qt.systemdServicePath}";
ExecStart = "${pkgs.owncloud-client}/bin/owncloud";
};

View file

@ -54,7 +54,7 @@ with lib;
};
Service = {
Environment = "PATH=%h/.nix-profile/bin";
Environment = "PATH=${config.qt.systemdServicePath}";
ExecStart = "${pkgs.qsyncthingtray}/bin/QSyncthingTray";
};