Compare commits

..

3 commits

Author SHA1 Message Date
675b8c7b85 Machines/WinMax2: enable hhd and hhd-ui 2024-07-11 12:29:33 +02:00
cae5c4f036 Flake: add nixpkgs patches 2024-07-11 12:29:18 +02:00
a700fc64b7 Switch to lix 2024-07-07 17:56:27 +02:00
5 changed files with 342 additions and 1 deletions

161
flake.lock generated
View file

@ -91,6 +91,72 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flakey-profile": {
"locked": {
"lastModified": 1712898590,
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
"owner": "lf-",
"repo": "flakey-profile",
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
"type": "github"
},
"original": {
"owner": "lf-",
"repo": "flakey-profile",
"type": "github"
}
},
"flakey-profile_2": {
"locked": {
"lastModified": 1712898590,
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
"owner": "lf-",
"repo": "flakey-profile",
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
"type": "github"
},
"original": {
"owner": "lf-",
"repo": "flakey-profile",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -174,6 +240,66 @@
"type": "github" "type": "github"
} }
}, },
"lix": {
"flake": false,
"locked": {
"lastModified": 1720132382,
"narHash": "sha256-9+TCNMnynp+OzMhsUiVTZXJKGH3QkXWdmC3SNUOY2z4=",
"rev": "d00edfb28d0a52d9acd392c582a43f98e773cf4c",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/d00edfb28d0a52d9acd392c582a43f98e773cf4c.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"
}
},
"lix-module": {
"inputs": {
"flake-utils": "flake-utils",
"flakey-profile": "flakey-profile",
"lix": [
"lix"
],
"nixpkgs": [
"nixpkgs-raw"
]
},
"locked": {
"lastModified": 1719353937,
"narHash": "sha256-86NBqDxAP20ET/UoKX0WvSItblNQ97czXb2q7lkMrwk=",
"rev": "5d9d94089fb1ca96222a34bfe245ef5c5ebefd37",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/5d9d94089fb1ca96222a34bfe245ef5c5ebefd37.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"
}
},
"lix-module-unstable": {
"inputs": {
"flake-utils": "flake-utils_2",
"flakey-profile": "flakey-profile_2",
"lix": [
"lix"
],
"nixpkgs": [
"nixpkgs-unstable-raw"
]
},
"locked": {
"lastModified": 1719353937,
"narHash": "sha256-86NBqDxAP20ET/UoKX0WvSItblNQ97czXb2q7lkMrwk=",
"rev": "5d9d94089fb1ca96222a34bfe245ef5c5ebefd37",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/5d9d94089fb1ca96222a34bfe245ef5c5ebefd37.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"
}
},
"nix-flatpak": { "nix-flatpak": {
"locked": { "locked": {
"lastModified": 1711997375, "lastModified": 1711997375,
@ -376,6 +502,9 @@
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"home-manager-unstable": "home-manager-unstable", "home-manager-unstable": "home-manager-unstable",
"jovian": "jovian", "jovian": "jovian",
"lix": "lix",
"lix-module": "lix-module",
"lix-module-unstable": "lix-module-unstable",
"nix-flatpak": "nix-flatpak", "nix-flatpak": "nix-flatpak",
"nix-impermanence": "nix-impermanence", "nix-impermanence": "nix-impermanence",
"nix-index-db": "nix-index-db", "nix-index-db": "nix-index-db",
@ -435,10 +564,40 @@
"type": "github" "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"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"vscode-extensions": { "vscode-extensions": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils_3",
"nixpkgs": [ "nixpkgs": [
"nixpkgs-unstable-raw" "nixpkgs-unstable-raw"
] ]

View file

@ -68,6 +68,21 @@
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
catppuccin.url = "github:catppuccin/nix"; catppuccin.url = "github:catppuccin/nix";
lix = {
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
flake = false;
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs-raw";
inputs.lix.follows = "lix";
};
lix-module-unstable = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs-unstable-raw";
inputs.lix.follows = "lix";
};
}; };
outputs = {...} @ inputs: outputs = {...} @ inputs:
@ -79,6 +94,8 @@
name = "patched-nixpkgs-unstable"; name = "patched-nixpkgs-unstable";
src = nixpkgs-unstable-raw; src = nixpkgs-unstable-raw;
patches = [ patches = [
./nixpkgs-patches/handheld-daemon-ui-init.patch
./nixpkgs-patches/update-hhd.patch
]; ];
}; };
nixpkgs-patched = nixpkgs-raw.legacyPackages.x86_64-linux.applyPatches { nixpkgs-patched = nixpkgs-raw.legacyPackages.x86_64-linux.applyPatches {
@ -132,6 +149,7 @@
nix-index-db-unstable.nixosModules.nix-index nix-index-db-unstable.nixosModules.nix-index
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
nixos-hardware.nixosModules.common-cpu-amd-zenpower nixos-hardware.nixosModules.common-cpu-amd-zenpower
lix-module-unstable.nixosModules.default
./roles/common ./roles/common
./roles/desktop ./roles/desktop
./roles/kde ./roles/kde
@ -153,6 +171,7 @@
nixos-hardware.nixosModules.microsoft-surface-go nixos-hardware.nixosModules.microsoft-surface-go
nix-index-db-unstable.nixosModules.nix-index nix-index-db-unstable.nixosModules.nix-index
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
lix-module-unstable.nixosModules.default
./roles/common ./roles/common
./roles/desktop ./roles/desktop
./roles/kde ./roles/kde
@ -172,6 +191,7 @@
home-manager-unstable.nixosModule home-manager-unstable.nixosModule
nix-index-db-unstable.nixosModules.nix-index nix-index-db-unstable.nixosModules.nix-index
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
lix-module-unstable.nixosModules.default
./roles/common ./roles/common
./roles/desktop ./roles/desktop
./roles/kde ./roles/kde
@ -194,6 +214,7 @@
nix-index-db-unstable.nixosModules.nix-index nix-index-db-unstable.nixosModules.nix-index
nixos-hardware.nixosModules.gpd-win-max-2-2023 nixos-hardware.nixosModules.gpd-win-max-2-2023
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
lix-module-unstable.nixosModules.default
./roles/common ./roles/common
./roles/desktop ./roles/desktop
./roles/kde ./roles/kde
@ -214,6 +235,7 @@
home-manager.nixosModule home-manager.nixosModule
nix-index-db.nixosModules.nix-index nix-index-db.nixosModules.nix-index
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
lix-module.nixosModules.default
./roles/common ./roles/common
./roles/server ./roles/server
./machines/Everest ./machines/Everest

View file

@ -51,6 +51,9 @@
hardware.bolt.enable = true; hardware.bolt.enable = true;
handheld-daemon = { handheld-daemon = {
enable = true; enable = true;
ui = {
enable = true;
};
user = "toast"; user = "toast";
}; };
}; };

View file

@ -0,0 +1,127 @@
From 18cd88064d152491d5ba19602db5c5d65bc2d685 Mon Sep 17 00:00:00 2001
From: Toast <39011842+toast003@users.noreply.github.com>
Date: Thu, 18 Apr 2024 11:22:24 +0200
Subject: [PATCH 1/3] handheld-daemon-ui: init at 3.1.1
---
.../by-name/ha/handheld-daemon-ui/package.nix | 39 +++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 pkgs/by-name/ha/handheld-daemon-ui/package.nix
diff --git a/pkgs/by-name/ha/handheld-daemon-ui/package.nix b/pkgs/by-name/ha/handheld-daemon-ui/package.nix
new file mode 100644
index 00000000000000..81d318d88b5abd
--- /dev/null
+++ b/pkgs/by-name/ha/handheld-daemon-ui/package.nix
@@ -0,0 +1,39 @@
+{
+ lib,
+ appimageTools,
+ fetchurl,
+}:
+let
+ pname = "handheld-daemon-ui";
+ version = "3.1.1";
+
+ src = fetchurl {
+ url = "https://github.com/hhd-dev/hhd-ui/releases/download/v${version}/hhd-ui.Appimage";
+ hash = "sha256-KH01MvcCbvCqjp1UZHnwfh9G3Yh50CO9Ecjl1Y8VY9E=";
+ };
+ extractedFiles = appimageTools.extractType2 { inherit pname version src; };
+in
+appimageTools.wrapType2 {
+ inherit pname version src;
+
+ extraInstallCommands = ''
+ # Handheld-daemon expects the UI binary to be called hhd-ui
+ mv $out/bin/${pname} $out/bin/hhd-ui
+
+ mkdir -p $out/share/applications
+ substitute ${extractedFiles}/hhd-ui.desktop \
+ $out/share/applications/hhd-ui.desktop \
+ --replace-fail "Exec=AppRun" "Exec=hhd-ui"
+ cp ${extractedFiles}/usr/share/icons $out/share -r
+ '';
+
+ meta = with lib; {
+ description = "The main UI for the Handheld Daemon";
+ homepage = "https://github.com/hhd-dev/hhd-ui";
+ license = licenses.gpl3Only;
+ maintainers = with maintainers; [ toast ];
+ mainProgram = "hhd-ui";
+ platforms = [ "x86_64-linux" ];
+ sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+ };
+}
From 8ebb1f0976c79c74eb0cea3975c348e36d86a7d1 Mon Sep 17 00:00:00 2001
From: Toast <39011842+toast003@users.noreply.github.com>
Date: Wed, 10 Jul 2024 12:59:01 +0200
Subject: [PATCH 2/3] handheld-daemon: add options for handheld-daemon-ui
---
.../modules/services/hardware/handheld-daemon.nix | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/nixos/modules/services/hardware/handheld-daemon.nix b/nixos/modules/services/hardware/handheld-daemon.nix
index 6c9d5aa3e22c86..e8e283bca89413 100644
--- a/nixos/modules/services/hardware/handheld-daemon.nix
+++ b/nixos/modules/services/hardware/handheld-daemon.nix
@@ -11,6 +11,11 @@ in
enable = mkEnableOption "Enable Handheld Daemon";
package = mkPackageOption pkgs "handheld-daemon" { };
+ ui = {
+ enable = mkEnableOption "Handheld Daemon UI";
+ package = mkPackageOption pkgs "handheld-daemon-ui" { };
+ };
+
user = mkOption {
type = types.str;
description = ''
@@ -20,7 +25,10 @@ in
};
config = mkIf cfg.enable {
- environment.systemPackages = [ cfg.package ];
+ environment.systemPackages = [
+ cfg.package
+ (mkIf cfg.ui.enable cfg.ui.package)
+ ];
services.udev.packages = [ cfg.package ];
systemd.packages = [ cfg.package ];
@@ -31,6 +39,11 @@ in
restartIfChanged = true;
+ path = mkIf cfg.ui.enable [
+ pkgs.handheld-daemon-ui
+ pkgs.lsof
+ ];
+
serviceConfig = {
ExecStart = "${ lib.getExe cfg.package } --user ${ cfg.user }";
Nice = "-12";
From 1b034ab22605b29195dabce893282b05077d0fe7 Mon Sep 17 00:00:00 2001
From: Toast <39011842+toast003@users.noreply.github.com>
Date: Thu, 11 Jul 2024 12:11:00 +0200
Subject: [PATCH 3/3] handheld-daemon: enable ui when enabling handheld-daemon
---
nixos/modules/services/hardware/handheld-daemon.nix | 1 +
1 file changed, 1 insertion(+)
diff --git a/nixos/modules/services/hardware/handheld-daemon.nix b/nixos/modules/services/hardware/handheld-daemon.nix
index e8e283bca89413..d78bae5e9bc483 100644
--- a/nixos/modules/services/hardware/handheld-daemon.nix
+++ b/nixos/modules/services/hardware/handheld-daemon.nix
@@ -25,6 +25,7 @@ in
};
config = mkIf cfg.enable {
+ services.handheld-daemon.ui.enable = mkDefault true;
environment.systemPackages = [
cfg.package
(mkIf cfg.ui.enable cfg.ui.package)

View file

@ -0,0 +1,30 @@
From 77380945dd829e737533359e0eba9fc965c1bdb6 Mon Sep 17 00:00:00 2001
From: Toast <39011842+toast003@users.noreply.github.com>
Date: Mon, 1 Jul 2024 16:41:48 +0200
Subject: [PATCH] handheld-daemon: 2.7.2 -> 3.1.1
---
pkgs/by-name/ha/handheld-daemon/package.nix | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix
index ec24637dde3f70..d670fdc8b11e72 100644
--- a/pkgs/by-name/ha/handheld-daemon/package.nix
+++ b/pkgs/by-name/ha/handheld-daemon/package.nix
@@ -9,14 +9,14 @@
}:
python3.pkgs.buildPythonApplication rec {
pname = "handheld-daemon";
- version = "2.7.2";
+ version = "3.1.1";
pyproject = true;
src = fetchFromGitHub {
owner = "hhd-dev";
repo = "hhd";
rev = "v${version}";
- hash = "sha256-jWLL1nmKam1iJ1R1l/OuIp+isgZ7toRhVamx1nOID/8=";
+ hash = "sha256-XUnAgQWnBb8Xsu88UVpdVXbFPxG13TNJFX1xgY06HT8=";
};
propagatedBuildInputs = with python3.pkgs; [