mirror of
https://github.com/nix-community/home-manager
synced 2024-11-05 10:49:44 +01: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";
|
|
};
|
|
};
|
|
};
|
|
}
|