36 lines
705 B
Nix
36 lines
705 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.streamcontroller;
|
|
in
|
|
{
|
|
options.streamcontroller = {
|
|
enable = mkEnableOption "streamcontroller service";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.user.services.streamcontroller = {
|
|
Unit = {
|
|
Description = "Streamcontroller service";
|
|
PartOf = [ "graphical-session.target" ];
|
|
After = [ "graphical-session.target" ];
|
|
Requisite = [ "graphical-session.target" ];
|
|
};
|
|
|
|
Service = {
|
|
ExecStart = "${pkgs.streamcontroller}/bin/streamcontroller -b";
|
|
Restart = "on-failure";
|
|
};
|
|
|
|
Install = {
|
|
WantedBy = [ "graphical-session.target" ];
|
|
};
|
|
};
|
|
};
|
|
}
|