From 98aaccb512415be0e5a26e9424fbd62248a4b97b Mon Sep 17 00:00:00 2001 From: Nikita Uvarov Date: Wed, 13 Sep 2017 13:31:10 +0200 Subject: [PATCH] compton: add module --- modules/default.nix | 1 + modules/misc/news.nix | 7 +++++++ modules/services/compton.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 modules/services/compton.nix diff --git a/modules/default.nix b/modules/default.nix index 03ab0764..115a144c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -35,6 +35,7 @@ let ./programs/vim.nix ./programs/zsh.nix ./services/blueman-applet.nix + ./services/compton.nix ./services/dunst.nix ./services/gnome-keyring.nix ./services/gpg-agent.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 43baa1b4..791dc061 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -178,6 +178,13 @@ in A new service is available: 'services.blueman-applet'. ''; } + + { + time = "2017-09-13T11:30:22+00:00"; + message = '' + A new service is available: 'services.compton'. + ''; + } ]; }; } diff --git a/modules/services/compton.nix b/modules/services/compton.nix new file mode 100644 index 00000000..e1c34997 --- /dev/null +++ b/modules/services/compton.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + options = { + services.compton = { + enable = mkEnableOption "Compton X11 compositor"; + }; + }; + + config = mkIf config.services.compton.enable { + systemd.user.services.compton = { + Unit = { + Description = "Compton X11 compositor"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + + Service = { + ExecStart = "${pkgs.compton}/bin/compton"; + }; + }; + }; +}