From d3c568e16a5e4e0f4620eea46e14ae9a13a590ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrkan=20G=C3=BCr?= Date: Tue, 20 Jul 2021 21:37:49 +0200 Subject: [PATCH] nixos/clipcat: add user service module --- .../from_md/release-notes/rl-2111.section.xml | 7 +++++ .../manual/release-notes/rl-2111.section.md | 3 ++ nixos/modules/module-list.nix | 1 + nixos/modules/services/misc/clipcat.nix | 31 +++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 nixos/modules/services/misc/clipcat.nix diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml index fc1cec16ef90..e69b8ccad30a 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml @@ -40,6 +40,13 @@ services.btrbk. + + + clipcat, + an X11 clipboard manager written in Rust. Available at + [services.clipcat](options.html#o pt-services.clipcat.enable). + + geoipupdate, diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index 9303393aba34..44a63cb9b860 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -13,6 +13,9 @@ In addition to numerous new and upgraded packages, this release has the followin - [btrbk](https://digint.ch/btrbk/index.html), a backup tool for btrfs subvolumes, taking advantage of btrfs specific capabilities to create atomic snapshots and transfer them incrementally to your backup locations. Available as [services.btrbk](options.html#opt-services.brtbk.instances). +- [clipcat](https://github.com/xrelkd/clipcat/), an X11 clipboard manager written in Rust. Available at [services.clipcat](options.html#o +pt-services.clipcat.enable). + - [geoipupdate](https://github.com/maxmind/geoipupdate), a GeoIP database updater from MaxMind. Available as [services.geoipupdate](options.html#opt-services.geoipupdate.enable). - [Kea](https://www.isc.org/kea/), ISCs 2nd generation DHCP and DDNS server suite. Available at [services.kea](options.html#opt-services.kea). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 13463359a66e..4d1700ed99af 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -475,6 +475,7 @@ ./services/misc/calibre-server.nix ./services/misc/cfdyndns.nix ./services/misc/clipmenu.nix + ./services/misc/clipcat.nix ./services/misc/cpuminer-cryptonight.nix ./services/misc/cgminer.nix ./services/misc/confd.nix diff --git a/nixos/modules/services/misc/clipcat.nix b/nixos/modules/services/misc/clipcat.nix new file mode 100644 index 000000000000..128bb9a89d69 --- /dev/null +++ b/nixos/modules/services/misc/clipcat.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.clipcat; +in { + + options.services.clipcat= { + enable = mkEnableOption "Clipcat clipboard daemon"; + + package = mkOption { + type = types.package; + default = pkgs.clipcat; + defaultText = "pkgs.clipcat"; + description = "clipcat derivation to use."; + }; + }; + + config = mkIf cfg.enable { + systemd.user.services.clipcat = { + enable = true; + description = "clipcat daemon"; + wantedBy = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig.ExecStart = "${cfg.package}/bin/clipcatd --no-daemon"; + }; + + environment.systemPackages = [ cfg.package ]; + }; +}