diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f84dc04 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1745868005, + "narHash": "sha256-hZScOyQphT4RUmSEJX+2OxjIlGgLwSd8iW1LNtAWIOs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "330d0a4167924b43f31cc9406df363f71b768a02", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "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..1be2659 --- /dev/null +++ b/flake.nix @@ -0,0 +1,60 @@ +{ + description = "steelseries chatmix support for linux"; + inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; }; + + outputs = { self, nixpkgs, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + lib = nixpkgs.lib; + in { + packages.${system} = { + default = pkgs.python3Packages.buildPythonApplication { + pname = "nova-chatmix"; + version = "1.0"; + + propagatedBuildInputs = + [ pkgs.python3Packages.pyusb pkgs.pulseaudio pkgs.pipewire ]; + + src = ./.; + + postInstall = '' + mkdir -p $out/etc/udev/rules.d + cp ./50-nova-pro-wireless.rules $out/etc/udev/rules.d/ + ''; + + meta = { + homepage = "https://git.dymstro.nl/Dymstro/nova-chatmix-linux"; + description = + "ChatMix for the Steelseries Arctis Nova Pro Wireless"; + license = lib.licenses.bsd0; + }; + }; + }; + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ python3 python3Packages.pyusb ]; + }; + nixosModule = { config, lib, pkgs, ... }: { + options.services.nova-chatmix = { + enable = lib.mkEnableOption "steelseries chatmix support"; + }; + config = lib.mkIf config.services.nova-chatmix.enable { + services.udev.packages = [ self.packages.${system}.default ]; + systemd.user.services.nova-chatmix = { + enable = true; + after = [ "pipewire.service" "pipewire-pulse.service" ]; + wantedBy = [ "default.target" ]; + wants = [ "network-online.target" ]; + description = + "This will enable ChatMix for the Steelseries Arctis Nova Pro Wireless"; + serviceConfig = { + Type = "simple"; + Restart = "always"; + ExecStartPre = "${pkgs.coreutils-full}/bin/sleep 10"; + ExecStart = "${self.packages.${system}.default}/bin/nova.py"; + }; + }; + }; + }; + }; +} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d3a2605 --- /dev/null +++ b/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup, find_packages + +setup(name='nova-chatmix', + version = '1.0', + packages = find_packages(), + scripts = ['nova.py'], + )