From 61e63c10dc275ea696b392f239f4a3eaca467326 Mon Sep 17 00:00:00 2001 From: Nick Hu Date: Tue, 13 Oct 2020 17:08:08 +0100 Subject: [PATCH] parcellite: make package configurable --- modules/services/parcellite.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/services/parcellite.nix b/modules/services/parcellite.nix index ce042386..cf1a7fe8 100644 --- a/modules/services/parcellite.nix +++ b/modules/services/parcellite.nix @@ -5,17 +5,24 @@ with lib; let cfg = config.services.parcellite; - package = pkgs.parcellite; in { meta.maintainers = [ maintainers.gleber ]; - options = { - services.parcellite = { enable = mkEnableOption "Parcellite"; }; + 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 = [ package ]; + home.packages = [ cfg.package ]; systemd.user.services.parcellite = { Unit = { @@ -27,7 +34,7 @@ in { Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { - ExecStart = "${package}/bin/parcellite"; + ExecStart = "${cfg.package}/bin/${cfg.package.pname}"; Restart = "on-abort"; }; };