mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
Some files don't need nesting and can be root level again to reduce conflicts with other PRs. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
55 lines
1 KiB
Nix
55 lines
1 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.services.blanket;
|
|
|
|
inherit (lib)
|
|
mkIf
|
|
mkEnableOption
|
|
mkPackageOption
|
|
hm
|
|
platforms
|
|
;
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.daru-san ];
|
|
|
|
options.services.blanket = {
|
|
enable = mkEnableOption "blanket";
|
|
|
|
package = mkPackageOption pkgs "blanket" { };
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
assertions = [
|
|
(hm.assertions.assertPlatform "services.blanket" pkgs platforms.linux)
|
|
];
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
systemd.user.services.blanket = {
|
|
Unit = {
|
|
Description = "Blanket daemon";
|
|
Requires = [ "dbus.service" ];
|
|
After = [ "graphical-session.target" ];
|
|
PartOf = [
|
|
"graphical-session.target"
|
|
"pipewire.service"
|
|
];
|
|
};
|
|
|
|
Install.WantedBy = [ "graphical-session.target" ];
|
|
|
|
Service = {
|
|
ExecStart = "${cfg.package}/bin/blanket --gapplication-service";
|
|
Restart = "on-failure";
|
|
RestartSec = 5;
|
|
};
|
|
};
|
|
};
|
|
}
|