Skip to content

Commit

Permalink
Merge pull request #546 from no-mood/main
Browse files Browse the repository at this point in the history
ags: added systemd to run in NixOs
  • Loading branch information
Aylur authored Sep 8, 2024
2 parents 344ea72 + 9c4ae76 commit 473d052
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand All @@ -60,13 +70,34 @@ 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 = {
Description = "AGS - A library built for GJS to allow defining GTK widgets in a declarative way.";
Documentation = "https://github.com/Aylur/ags";
PartOf = ["graphical-session.target"];
After = ["graphical-session-pre.target"];
};

Service = {
ExecStart = "${config.programs.ags.package}/bin/ags -b hypr";
Restart = "on-failure";
KillMode = "mixed";
};

Install = {
WantedBy = ["graphical-session.target"];
};
};
}))
]);
}

0 comments on commit 473d052

Please sign in to comment.