1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00
home-manager/modules/services/parcellite.nix
Naïm Favier bd11e2c5e6
Replace usage of literalExample
Instead use the new function `literalExpression`. See

  https://github.com/NixOS/nixpkgs/pull/136909
2021-10-13 00:16:10 +02:00

48 lines
1.1 KiB
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 = literalExpression "pkgs.parcellite";
example = literalExpression "pkgs.clipit";
description = "Parcellite derivation to use.";
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.parcellite" pkgs
lib.platforms.linux)
];
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" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
Restart = "on-abort";
};
};
};
}