Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ in {
Enable systemd integration.
'';
};

systemd.defines = mkOption {
type = types.attrsOf types.str;
default = {};
description = "defines for the systemd module. Will be passed into the ags service's ExecStart.";
example = {
DEBUG = "true";
RUNTIME = "\\'systemd\\'";
};
};
};

config = mkIf cfg.enable (mkMerge [
Expand Down Expand Up @@ -139,7 +149,12 @@ in {
};

Service = {
ExecStart = "${cfg.finalPackage}/bin/ags run";
ExecStart = let
defines =
lib.concatStringsSep " "
(lib.mapAttrsToList (key: value: "--define ${key}=${toString value}") cfg.systemd.defines);
in
"${cfg.finalPackage}/bin/ags run " + defines;
Restart = "on-failure";
KillMode = "mixed";
};
Expand Down