summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2025-09-06 15:06:48 -0700
committerIrene Knapp <ireneista@irenes.space>2025-09-06 15:25:26 -0700
commite331e95e3f3607bd1707b60f61e209e4aeac05f6 (patch)
tree05eb02197f870ac99c62af71e3364dda3c013a83
initial package of kaylee
Force-Push: working CI? that's unpossible
Change-Id: I03dfbbcff92f2166616d26d4c3d556261a327d8b
-rw-r--r--.envrc1
-rw-r--r--.gitignore4
-rw-r--r--data-location.patch31
-rw-r--r--flake.lock27
-rw-r--r--flake.nix59
5 files changed, 122 insertions, 0 deletions
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..3550a30
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use flake
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..794c189
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/result
+/result-*
+/.direnv
+*.swp
diff --git a/data-location.patch b/data-location.patch
new file mode 100644
index 0000000..8c0dd65
--- /dev/null
+++ b/data-location.patch
@@ -0,0 +1,31 @@
+diff --git a/kayleevc/kaylee.py b/kayleevc/kaylee.py
+index 4e99d1a..7cc927f 100644
+--- a/kayleevc/kaylee.py
++++ b/kayleevc/kaylee.py
+@@ -178,7 +178,8 @@ class Kaylee:
+ 
+     def load_resource(self, string):
+         # TODO: Use the Config object for this path management
+-        local_data = os.path.join(os.path.dirname(__file__), '..', 'data')
++        local_data = os.path.join(os.path.dirname(__file__), '..',
++                                  'usr', 'share', 'kaylee')
+         paths = ["/usr/share/kaylee/", "/usr/local/share/kaylee", local_data]
+         for path in paths:
+             resource = os.path.join(path, string)
+diff --git a/setup.py b/setup.py
+index 34ba60c..b4c32c8 100644
+--- a/setup.py
++++ b/setup.py
+@@ -27,8 +27,10 @@ setup(
+     ],
+     install_requires=["requests"],
+     data_files = [
+-        ("/usr/share/kaylee", ["data/icon_inactive.png", "data/icon.png",
+-            "options.json.tmp"]),
++        ("/usr/share/kaylee",
++         ["data/icon.png", "data/icon_small.png",
++          "data/icon_inactive.png", "data/icon_inactive_small.png",
++          "options.json.tmp"]),
+         ("/usr/lib/systemd/user", ["systemd/kaylee.service"])
+     ],
+     entry_points = {
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..b2fc0a7
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1756886854,
+        "narHash": "sha256-6tooT142NLcFjt24Gi4B0G1pgWLvfw7y93sYEfSHlLI=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "0e6684e6c5755325f801bda1751a8a4038145d7d",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "ref": "nixos-25.05",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..d81cb77
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,59 @@
+{
+  inputs = {
+    nixpkgs = {
+      type = "github";
+      owner = "NixOS";
+      repo = "nixpkgs";
+      ref = "nixos-25.05";
+    };
+  };
+
+  outputs = { self, nixpkgs }:
+  let supportedSystems = [ "aarch64-linux" "x86_64-linux" ];
+      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
+      nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
+  in {
+    packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in rec {
+      kaylee = pkgs.python3Packages.buildPythonPackage rec {
+        pname = "KayleeVC";
+        version = "0.1.1";
+
+        src = pkgs.fetchFromGitHub {
+          owner = "Ratfink";
+          repo = "kaylee";
+          rev = "baeb0e1fa08fb6b21e4a22458de16b4948d1f2d0";
+          hash = "sha256-ghZnmdtXme0g+nsi/dSGxQ6UqGB48lUhYaTSLF94KIo=";
+        };
+
+        patches = [
+          ./data-location.patch
+        ];
+
+        nativeBuildInputs = with pkgs; [
+          gobject-introspection
+          wrapGAppsHook4
+        ];
+
+        propagatedBuildInputs = (with pkgs; [
+          gtk3
+          pocketsphinx.lib
+        ]) ++ (with pkgs.gst_all_1; [
+          gstreamer
+          gst-plugins-base
+          gst-plugins-good
+        ]) ++ (with pkgs.python3Packages; [
+          requests
+          pygobject3
+        ]);
+      };
+    });
+
+    devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in {
+      default = pkgs.mkShell {
+        nativeBuildInputs = with pkgs; [
+        ];
+      };
+    });
+  };
+}
+