diff --git a/flake.lock b/flake.lock index 50643ad..fbc938c 100644 --- a/flake.lock +++ b/flake.lock @@ -124,11 +124,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1599941320, - "narHash": "sha256-xe0WZVLuWQ3goCnlh1VDDykwdUSOyikXoaclhH+xqVU=", + "lastModified": 1600170522, + "narHash": "sha256-rY7p7K5djPHvuRHNrRRS80j0BlbH2rp9w0F4uQbZYbs=", "owner": "NixOS", "repo": "nix", - "rev": "7cb5f643a6ee5b8ffee2e0bb9159a677ff76d17c", + "rev": "733d2e9402807e54d503c3113e854bfddb3d44e0", "type": "github" }, "original": { @@ -333,17 +333,17 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1600036524, - "narHash": "sha256-Xyb2qLHhqgW+oyl2qQAh1Zcoj5Y69IHRkaGd9htEEC0=", + "lastModified": 1600420679, + "narHash": "sha256-3bolSr1u1xfvk/fZw9yk7iKeLI1R0Uu7UXcloysl5c8=", "ref": "master", - "rev": "ee4bf80484acbf18ab7d9f2da83ee3dfc9c1f722", - "revCount": 3, + "rev": "449a3912bd090011e538504b4daae6e61dc7523b", + "revCount": 15, "type": "git", - "url": "https://code.balsoft.ru/balsoft/simple-osd-daemons" + "url": "ssh://gitea@code.balsoft.ru/balsoft/simple-osd-daemons" }, "original": { "type": "git", - "url": "https://code.balsoft.ru/balsoft/simple-osd-daemons" + "url": "ssh://gitea@code.balsoft.ru/balsoft/simple-osd-daemons" } }, "weechat-notify-send": { diff --git a/flake.nix b/flake.nix index e3bea0e..d241f34 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,7 @@ ref = "flake"; }; nixos-fhs-compat.url = github:balsoft/nixos-fhs-compat; - simple-osd-daemons.url = git+https://code.balsoft.ru/balsoft/simple-osd-daemons; + simple-osd-daemons.url = git+ssh://gitea@code.balsoft.ru/balsoft/simple-osd-daemons; }; outputs = { nixpkgs, nix, self, ... }@inputs: { diff --git a/modules/packages.nix b/modules/packages.nix index 2ccab91..88630fe 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -27,7 +27,7 @@ in { inherit (inputs.lambda-launcher.packages.x86_64-linux) lambda-launcher; - simple-osd = { inherit (inputs.simple-osd-daemons.packages.x86_64-linux) battery bluetooth brightness pulseaudio; }; + simple-osd = inputs.simple-osd-daemons.packages.x86_64-linux; inherit old; diff --git a/modules/simple-osd-daemons.nix b/modules/simple-osd-daemons.nix index 6f43e05..57025e7 100644 --- a/modules/simple-osd-daemons.nix +++ b/modules/simple-osd-daemons.nix @@ -1,29 +1,26 @@ -{ config, pkgs, lib, ... }: { - home-manager.users.balsoft.systemd.user.services = { - simple-osd-pulseaudio = { - Install.WantedBy = [ "default.target" ]; - Service = { - ExecStart = "${pkgs.simple-osd.pulseaudio}/bin/simple-osd-pulseaudio"; - }; +{ config, pkgs, lib, ... }: +let + simple-osd-daemon = name: { + Install.WantedBy = [ "default.target" ]; + Service = { + ExecStart = "${pkgs.simple-osd.${name}}/bin/simple-osd-${name}"; }; - simple-osd-bluetooth = { - Install.WantedBy = [ "default.target" ]; - Service = { - ExecStart = "${pkgs.simple-osd.bluetooth}/bin/simple-osd-bluetooth"; - }; - }; - } // pkgs.lib.optionalAttrs (config.deviceSpecific.isLaptop) { - simple-osd-battery = { - Install.WantedBy = [ "default.target" ]; - Service = { - ExecStart = "${pkgs.simple-osd.battery}/bin/simple-osd-battery"; - }; - }; - simple-osd-brightness = { - Install.WantedBy = [ "default.target" ]; - Service = { - ExecStart = "${pkgs.simple-osd.brightness}/bin/simple-osd-brightness"; - }; + }; + inherit (import ../support.nix { inherit lib config; }) genIni; + 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; }; }; }