From 5bf102f18f0d94aecd6ed247b765fd16ea8afb87 Mon Sep 17 00:00:00 2001 From: xunuwu Date: Sat, 22 Mar 2025 21:18:13 +0100 Subject: [PATCH] add wayland-appusage --- flake.lock | 73 ++++++++++++++++++++++++++++- flake.nix | 3 ++ home/profiles/services/appusage.nix | 23 +++++++++ home/suites/nixdesk/default.nix | 1 + 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 home/profiles/services/appusage.nix diff --git a/flake.lock b/flake.lock index 211f7cc..fa51b5b 100644 --- a/flake.lock +++ b/flake.lock @@ -109,6 +109,21 @@ "type": "github" } }, + "crane": { + "locked": { + "lastModified": 1742394900, + "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", + "owner": "ipetkov", + "repo": "crane", + "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "firefox-addons": { "inputs": { "flake-utils": "flake-utils_2", @@ -388,6 +403,24 @@ "type": "github" } }, + "flake-utils_4": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -874,7 +907,8 @@ "sobercookie": "sobercookie", "sops-nix": "sops-nix", "stylix": "stylix", - "vpn-confinement": "vpn-confinement" + "vpn-confinement": "vpn-confinement", + "wayland-appusage": "wayland-appusage" } }, "sobercookie": { @@ -984,6 +1018,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -1146,6 +1195,28 @@ "repo": "VPN-Confinement", "type": "github" } + }, + "wayland-appusage": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742675355, + "narHash": "sha256-cx/CEd6nx1PDtdMJWX/juRPR7XJiUK0UX/13x/eK7CE=", + "owner": "xunuwu", + "repo": "wayland-appusage", + "rev": "2ecc400910f519a9e404596ed89f4e790d579800", + "type": "github" + }, + "original": { + "owner": "xunuwu", + "repo": "wayland-appusage", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 08c9a73..3e61de1 100644 --- a/flake.nix +++ b/flake.nix @@ -66,5 +66,8 @@ sobercookie.url = "github:xunuwu/sobercookie"; sobercookie.inputs.nixpkgs.follows = "nixpkgs"; + + wayland-appusage.url = "github:xunuwu/wayland-appusage"; + wayland-appusage.inputs.nixpkgs.follows = "nixpkgs"; }; } diff --git a/home/profiles/services/appusage.nix b/home/profiles/services/appusage.nix new file mode 100644 index 0000000..1c76c1d --- /dev/null +++ b/home/profiles/services/appusage.nix @@ -0,0 +1,23 @@ +{ + inputs, + lib, + pkgs, + ... +}: { + home.packages = [inputs.wayland-appusage.packages.${pkgs.system}.appusage]; + + systemd.user.services.appusage = { + Unit = { + Description = "Appusage daemon"; + }; + + Install.WantedBy = ["sway-session.target"]; + + Service = { + Type = "simple"; + Restart = "on-failure"; + ExecStart = "${inputs.wayland-appusage.packages.${pkgs.system}.appusage-daemon}/bin/appusage-daemon"; + RestartSec = "5s"; + }; + }; +} diff --git a/home/suites/nixdesk/default.nix b/home/suites/nixdesk/default.nix index c7ef718..50a297e 100644 --- a/home/suites/nixdesk/default.nix +++ b/home/suites/nixdesk/default.nix @@ -94,5 +94,6 @@ services.playerctl services.polkit-agent services.udiskie # although i dont need this for usb memory, it is quite convenient for flashing qmk + services.appusage ]; }