nixos-config/modules/workspace/simple-osd-daemons.nix

38 lines
1.0 KiB
Nix
Raw Normal View History

2020-09-18 22:31:26 +04:00
{ config, pkgs, lib, ... }:
let
simple-osd-daemon = name: {
Install.WantedBy = [ "default.target" ];
Service = {
ExecStart = "${pkgs.simple-osd.${name}}/bin/simple-osd-${name}";
2020-10-26 15:04:44 +04:00
Restart = "always";
2020-09-14 02:47:04 +04:00
};
2020-09-18 22:31:26 +04:00
};
2021-01-21 22:13:53 +04:00
inherit (import ../../support.nix { inherit lib config; }) genIni;
2020-09-18 22:31:26 +04:00
daemons = names:
builtins.listToAttrs (builtins.map (name:
{
name = "simple-osd-${name}";
value = simple-osd-daemon name;
}) names);
in {
home-manager.users.balsoft = {
systemd.user.services =
daemons [ "pulseaudio" "mpris" ]
// pkgs.lib.optionalAttrs (config.deviceSpecific.isLaptop)
(daemons [ "battery" "brightness" ]);
xdg.configFile."simple-osd/common".text = genIni {
progressbar.length = 25;
2020-09-14 02:47:04 +04:00
};
2021-02-28 20:03:06 +04:00
xdg.configFile."simple-osd/battery".text = lib.mkIf (config.deviceSpecific.isLaptop) (genIni {
default = {
"refresh interval" = 1;
"show battery charge" = true;
};
threshold = {
low = "20%";
critical = "10%";
};
});
2020-09-14 02:47:04 +04:00
};
}