1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-30 13:49:47 +01:00
home-manager/modules/services/parcellite.nix

49 lines
1.1 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.parcellite;
2020-02-02 00:39:17 +01:00
in {
meta.maintainers = [ maintainers.gleber ];
2020-10-13 18:08:08 +02:00
options.services.parcellite = {
enable = mkEnableOption "Parcellite";
package = mkOption {
type = types.package;
default = pkgs.parcellite;
defaultText = literalExpression "pkgs.parcellite";
example = literalExpression "pkgs.clipit";
2020-10-13 18:08:08 +02:00
description = "Parcellite derivation to use.";
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.parcellite" pkgs
lib.platforms.linux)
];
2020-10-13 18:08:08 +02:00
home.packages = [ cfg.package ];
systemd.user.services.parcellite = {
Unit = {
Description = "Lightweight GTK+ clipboard manager";
Requires = [ "tray.target" ];
After = [ "graphical-session-pre.target" "tray.target" ];
PartOf = [ "graphical-session.target" ];
};
2020-02-02 00:39:17 +01:00
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
2020-10-13 18:08:08 +02:00
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
Restart = "on-abort";
};
};
};
}