mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 13:13:26 +00:00
42 lines
955 B
Nix
42 lines
955 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.parcellite;
|
|
|
|
in {
|
|
meta.maintainers = [ maintainers.gleber ];
|
|
|
|
options.services.parcellite = {
|
|
enable = mkEnableOption "Parcellite";
|
|
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.parcellite;
|
|
defaultText = literalExample "pkgs.parcellite";
|
|
example = literalExample "pkgs.clipit";
|
|
description = "Parcellite derivation to use.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ cfg.package ];
|
|
|
|
systemd.user.services.parcellite = {
|
|
Unit = {
|
|
Description = "Lightweight GTK+ clipboard manager";
|
|
After = [ "graphical-session-pre.target" ];
|
|
PartOf = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
|
|
|
Service = {
|
|
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
|
|
Restart = "on-abort";
|
|
};
|
|
};
|
|
};
|
|
}
|