diff --git a/machines/AMD-Workstation/default.nix b/machines/AMD-Workstation/default.nix index ae4b75b..03518ef 100644 --- a/machines/AMD-Workstation/default.nix +++ b/machines/AMD-Workstation/default.nix @@ -4,6 +4,7 @@ inputs.self.nixosRoles.workstation inputs.self.nixosProfiles.stable-diffusion + inputs.self.nixosProfiles.a2ln-server # inputs.self.nixosModules.passthrough ]; diff --git a/profiles/applications/packages.nix b/profiles/applications/packages.nix index 431662d..41b970c 100644 --- a/profiles/applications/packages.nix +++ b/profiles/applications/packages.nix @@ -4,6 +4,7 @@ with config.deviceSpecific; { home-manager.users.alukard.home.packages = with pkgs; [ # cli + a2ln bat comma curl diff --git a/profiles/overlay.nix b/profiles/overlay.nix index e2477dc..d14efdd 100644 --- a/profiles/overlay.nix +++ b/profiles/overlay.nix @@ -5,6 +5,10 @@ let config = config.nixpkgs.config; localSystem = { inherit system; }; }); + stable = import inputs.nixpkgs-stable ({ + config = config.nixpkgs.config; + localSystem = { inherit system; }; + }); roundcube-plugins = import ./packages/roundcube-plugins/default.nix; in with lib; { @@ -21,6 +25,7 @@ with lib; { android-emulator = self.callPackage ./packages/android-emulator.nix { }; arkenfox-userjs = pkgs.callPackage ./packages/arkenfox-userjs.nix { arkenfox-repo = inputs.arkenfox-userjs; }; + a2ln = pkgs.callPackage ./packages/a2ln.nix { }; bibata-cursors-tokyonight = pkgs.callPackage ./packages/bibata-cursors-tokyonight.nix { }; ceserver = pkgs.callPackage ./packages/ceserver.nix { }; hyprpaper = pkgs.callPackage ./packages/hyprpaper.nix { src = inputs.hyprpaper; }; diff --git a/profiles/packages/a2ln.nix b/profiles/packages/a2ln.nix new file mode 100644 index 0000000..805fcc8 --- /dev/null +++ b/profiles/packages/a2ln.nix @@ -0,0 +1,38 @@ +{ lib, python3, fetchFromGitHub, writeText, libnotify, gobject-introspection, wrapGAppsHook }: +let + version = "1.1.4"; + setup-py = writeText "setup.py" '' + from distutils.core import setup + setup( + name='a2ln', + version='${version}', + scripts=['a2ln'], + ) + ''; +in python3.pkgs.buildPythonApplication rec { + inherit version; + pname = "a2ln"; + + src = fetchFromGitHub { + repo = "a2ln-server"; + owner = "patri9ck"; + rev = version; + sha256 = "1lh8wbrhcdaqy1dhg13ay7s4hip7g911fbb5h0v3a99kzgn6vl1m"; + }; + + preBuild = '' + cp ${setup-py} setup.py + ''; + + propagatedBuildInputs = with python3.pkgs; [ + pillow pygobject3 setproctitle pyzmq qrcode + wrapGAppsHook libnotify gobject-introspection + ]; + + strictDeps = false; + + meta = with lib; { + description = "A way to display Android phone notifications on Linux (Server)"; + license = licenses.gpl3; + }; +} \ No newline at end of file diff --git a/profiles/servers/a2ln-server.nix b/profiles/servers/a2ln-server.nix new file mode 100644 index 0000000..bc71a3b --- /dev/null +++ b/profiles/servers/a2ln-server.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: { + systemd.user.services.a2ln-server = rec { + serviceConfig = { + TimeoutStartSec = 0; + TimeoutStopSec = 10; + Type = "simple"; + Restart = "always"; + }; + script = '' + ${pkgs.a2ln}/bin/a2ln --pairing-port 23046 23045 + ''; + after = [ "graphical-session.target" ]; + wants = after; + wantedBy = [ "multi-user.target" ]; + }; + networking.firewall.allowedTCPPorts = [ 23045 23046 ]; +} \ No newline at end of file