mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
parcellite: make package configurable
This commit is contained in:
parent
5125fc0a47
commit
61e63c10dc
1 changed files with 12 additions and 5 deletions
|
@ -5,17 +5,24 @@ with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.services.parcellite;
|
cfg = config.services.parcellite;
|
||||||
package = pkgs.parcellite;
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.gleber ];
|
meta.maintainers = [ maintainers.gleber ];
|
||||||
|
|
||||||
options = {
|
options.services.parcellite = {
|
||||||
services.parcellite = { enable = mkEnableOption "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 {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.user.services.parcellite = {
|
systemd.user.services.parcellite = {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
@ -27,7 +34,7 @@ in {
|
||||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${package}/bin/parcellite";
|
ExecStart = "${cfg.package}/bin/${cfg.package.pname}";
|
||||||
Restart = "on-abort";
|
Restart = "on-abort";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue