From 9c4ae76fd543b901a7d0000987eefab0e9fbddb6 Mon Sep 17 00:00:00 2001 From: mood <74420740+no-mood@users.noreply.github.com> Date: Sat, 17 Aug 2024 13:23:48 +0200 Subject: [PATCH] ags: added option to enable systemd integration --- nix/hm-module.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 7ff148e1..142fdeb0 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -51,6 +51,16 @@ in { ''; example = literalExpression "[ pkgs.libsoup_3 ]"; }; + + systemd.enable = mkOption { + type = types.bool; + default = false; + example = true; + description = '' + Enable systemd integration. + ''; + }; + }; config = mkIf cfg.enable (mkMerge [ @@ -60,14 +70,16 @@ in { (mkIf (cfg.package != null) (let path = "/share/com.github.Aylur.ags/types"; pkg = cfg.package.override { - extraPackages = cfg.extraPackages; +extraPackages = cfg.extraPackages; buildTypes = true; }; in { programs.ags.finalPackage = pkg; home.packages = [pkg]; home.file.".local/${path}".source = "${pkg}/${path}"; - })) + }) + ) + (mkIf cfg.systemd.enable ( { systemd.user.services.ags = { Unit = { @@ -87,6 +99,5 @@ in { WantedBy = ["graphical-session.target"]; }; }; - } + })) ]); -}