From 68373dcfb5948e036ffeabdb3d2cd6093a2da596 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Mon, 14 Sep 2020 01:47:04 +0300 Subject: [PATCH] Add simple-osd-daemons --- flake.lock | 36 +++++++++++++++++++++++++++++++++- flake.nix | 1 + modules/default.nix | 1 + modules/packages.nix | 2 ++ modules/simple-osd-daemons.nix | 29 +++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 modules/simple-osd-daemons.nix diff --git a/flake.lock b/flake.lock index 9cb0f36..c4d26d9 100644 --- a/flake.lock +++ b/flake.lock @@ -244,6 +244,21 @@ } }, "nixpkgs_5": { + "locked": { + "lastModified": 1599773960, + "narHash": "sha256-5bL52aaUOOyOBjgKh9/6jQlFbeE+WfVX7dpvjohmD+w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5916b9637048446755629c84ae6f13361f623d13", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1587390417, "narHash": "sha256-dLQebnBviLNiN2Ei3Iqyxm73EFwz77YcvitvMYwRNA8=", @@ -272,6 +287,7 @@ "nixpkgs-old": "nixpkgs-old", "nixpkgs-wayland": "nixpkgs-wayland", "simple-nixos-mailserver": "simple-nixos-mailserver", + "simple-osd-daemons": "simple-osd-daemons", "weechat-notify-send": "weechat-notify-send", "weechat-scripts": "weechat-scripts", "yt-utilities": "yt-utilities" @@ -294,6 +310,24 @@ "url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver" } }, + "simple-osd-daemons": { + "inputs": { + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1600036524, + "narHash": "sha256-Xyb2qLHhqgW+oyl2qQAh1Zcoj5Y69IHRkaGd9htEEC0=", + "ref": "master", + "rev": "ee4bf80484acbf18ab7d9f2da83ee3dfc9c1f722", + "revCount": 3, + "type": "git", + "url": "https://code.balsoft.ru/balsoft/simple-osd-daemons" + }, + "original": { + "type": "git", + "url": "https://code.balsoft.ru/balsoft/simple-osd-daemons" + } + }, "weechat-notify-send": { "flake": false, "locked": { @@ -329,7 +363,7 @@ "yt-utilities": { "inputs": { "haskell-nix": "haskell-nix", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1588006875, diff --git a/flake.nix b/flake.nix index 9443ae6..e3bea0e 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +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; }; outputs = { nixpkgs, nix, self, ... }@inputs: { diff --git a/modules/default.nix b/modules/default.nix index bc23c17..5326d11 100755 --- a/modules/default.nix +++ b/modules/default.nix @@ -35,6 +35,7 @@ device: ./services.nix ./power.nix ./network.nix + ./simple-osd-daemons.nix ] ++ lib.optionals (device == "AMD-Workstation") [ ./nextcloud.nix ./mailserver.nix diff --git a/modules/packages.nix b/modules/packages.nix index 48eae43..2ccab91 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -27,6 +27,8 @@ 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; }; + inherit old; yt-utilities = inputs.yt-utilities.defaultPackage.x86_64-linux; diff --git a/modules/simple-osd-daemons.nix b/modules/simple-osd-daemons.nix new file mode 100644 index 0000000..6f43e05 --- /dev/null +++ b/modules/simple-osd-daemons.nix @@ -0,0 +1,29 @@ +{ 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"; + }; + }; + 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"; + }; + }; + }; +}