add deskflow
Charlotte Som charlotte@som.codes
Thu, 10 Oct 2024 10:00:20 +0100
6 files changed,
292 insertions(+),
6 deletions(-)
M
flake.nix
→
flake.nix
@@ -23,7 +23,7 @@ runestone = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; specialArgs = { - user-pkgs = self.packages; + user-pkgs = self.packages."x86_64-linux"; unstable-pkgs = nixpkgs-unstable.legacyPackages."x86_64-linux"; };@@ -67,7 +67,7 @@ opal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; specialArgs = { - user-pkgs = self.packages; + user-pkgs = self.packages."x86_64-linux"; unstable-pkgs = nixpkgs-unstable.legacyPackages."x86_64-linux"; };@@ -93,6 +93,10 @@ ];
}; }; - packages = import ./packages/default.nix { pkgs = import nixpkgs { system = "x86_64-linux"; }; }; + packages = { + x86_64-linux = import ./packages/default.nix { + pkgs = import nixpkgs { system = "x86_64-linux"; }; + }; + }; }; }
M
packages/default.nix
→
packages/default.nix
@@ -1,4 +1,19 @@
{ pkgs }: { berkeley-mono = pkgs.callPackage ./berkeley-mono/package.nix { }; + + /* + deskflow = + let + deskflow = pkgs.callPackage ./deskflow/package.nix { }; + libei = pkgs.callPackage ./libs/libei.nix { }; + libportal = pkgs.callPackage ./libs/libportal.nix { }; + in + deskflow.override (oldDeps: { + libei = libei; + libportal = libportal; + }); + */ + + deskflow = pkgs.callPackage ./deskflow/package.nix { }; }
A
packages/deskflow/libs/libei.nix
@@ -0,0 +1,72 @@
+{ + lib, + stdenv, + fetchFromGitHub, + fetchFromGitLab, + libevdev, + libxkbcommon, + meson, + ninja, + pkg-config, + protobuf, + protobufc, + systemd, + buildPackages, +}: +let + munit = fetchFromGitHub { + owner = "nemequ"; + repo = "munit"; + rev = "fbbdf1467eb0d04a6ee465def2e529e4c87f2118"; + hash = "sha256-qm30C++rpLtxBhOABBzo+6WILSpKz2ibvUvoe8ku4ow="; + }; +in +stdenv.mkDerivation rec { + pname = "libei"; + version = "1.3.0"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "libinput"; + repo = "libei"; + rev = version; + hash = "sha256-yKeMHgR3s83xwoXgLW28ewF2tvs6l0Hq0cCAroCgq0U="; + }; + + buildInputs = [ + libevdev + libxkbcommon + protobuf + protobufc + systemd + ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + (buildPackages.python3.withPackages ( + ps: with ps; [ + attrs + jinja2 + pytest + python-dbusmock + strenum + structlog + ] + )) + ]; + + postPatch = '' + ln -s "${munit}" ./subprojects/munit + patchShebangs ./proto/ei-scanner + ''; + + meta = with lib; { + description = "Library for Emulated Input"; + mainProgram = "ei-debug-events"; + homepage = "https://gitlab.freedesktop.org/libinput/libei"; + license = licenses.mit; + maintainers = [ maintainers.pedrohlc ]; + platforms = platforms.linux; + }; +}
A
packages/deskflow/libs/libportal.nix
@@ -0,0 +1,97 @@
+{ + stdenv, + lib, + fetchFromGitHub, + meson, + ninja, + pkg-config, + gobject-introspection, + vala, + gi-docgen, + glib, + gtk3, + gtk4, + libsForQt5, + qt6Packages, + variant ? null, +}: + +assert + variant == null || variant == "gtk3" || variant == "gtk4" || variant == "qt5" || variant == "qt6"; + +stdenv.mkDerivation rec { + pname = "libportal" + lib.optionalString (variant != null) "-${variant}"; + version = "0.8.1"; + + outputs = [ + "out" + "dev" + ] ++ lib.optional (variant != "qt5") "devdoc"; + + src = fetchFromGitHub { + owner = "flatpak"; + repo = "libportal"; + rev = version; + sha256 = "sha256-NAkD5pAQpmAtVxsFZt74PwURv+RbGBfqENIwyxEEUSc="; + }; + + depsBuildBuild = [ + pkg-config + ]; + + nativeBuildInputs = + [ + meson + ninja + pkg-config + gi-docgen + ] + ++ lib.optionals (variant != "qt5") [ + gobject-introspection + vala + ]; + + propagatedBuildInputs = + [ + glib + ] + ++ lib.optionals (variant == "gtk3") [ + gtk3 + ] + ++ lib.optionals (variant == "gtk4") [ + gtk4 + ] + ++ lib.optionals (variant == "qt5") [ + libsForQt5.qtbase + libsForQt5.qtx11extras + ] + ++ lib.optionals (variant == "qt6") [ + qt6Packages.qtbase + ]; + + mesonFlags = [ + (lib.mesonEnable "backend-gtk3" (variant == "gtk3")) + (lib.mesonEnable "backend-gtk4" (variant == "gtk4")) + (lib.mesonEnable "backend-qt5" (variant == "qt5")) + (lib.mesonEnable "backend-qt6" (variant == "qt6")) + (lib.mesonBool "vapi" (variant != "qt5")) + (lib.mesonBool "introspection" (variant != "qt5")) + (lib.mesonBool "docs" (variant != "qt5")) # requires introspection=true + ]; + + postFixup = '' + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. + moveToOutput "share/doc" "$devdoc" + ''; + + # we don't have any binaries + dontWrapQtApps = true; + + meta = with lib; { + description = "Flatpak portal library"; + homepage = "https://github.com/flatpak/libportal"; + license = licenses.lgpl3Plus; + maintainers = with maintainers; [ jtojnar ]; + platforms = platforms.unix; + }; +}
A
packages/deskflow/package.nix
@@ -0,0 +1,97 @@
+# i got this from a nixpkgs pr and i will delete it when the pr lands but thank u pr person + +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + ninja, + pkg-config, + tomlplusplus, + cli11, + gtest, + libX11, + libxkbfile, + libXtst, + libXinerama, + libXi, + libXrandr, + libxkbcommon, + pugixml, + python3, + gdk-pixbuf, + libnotify, + qt6, + callPackage, +}: + +let + libei = callPackage ./libs/libei.nix { }; + libportal = callPackage ./libs/libportal.nix { }; +in +stdenv.mkDerivation rec { + pname = "deskflow"; + + version = "1.17.0"; + + src = fetchFromGitHub { + owner = "deskflow"; + repo = "deskflow"; + rev = "${version}+r1"; + hash = "sha256-OXgL3AmN5s38tlp3yYcMc6y9y8Gf48FuaD0ilKnoKiE="; + }; + + nativeBuildInputs = [ + cmake + ninja + pkg-config + qt6.wrapQtAppsHook + ]; + + postPatch = '' + substituteInPlace cmake/Packaging.cmake --replace-warn "set(CMAKE_INSTALL_PREFIX /usr)" "" + ''; + + cmakeFlags = [ + "-DCMAKE_SKIP_RPATH=ON" + ]; + + buildInputs = [ + tomlplusplus + cli11 + gtest + libei + libportal + libX11 + libxkbfile + libXinerama + libXi + libXrandr + libXtst + libxkbcommon + pugixml + gdk-pixbuf + libnotify + python3 + qt6.qtbase + ]; + + postInstall = '' + substituteInPlace $out/share/applications/deskflow.desktop \ + --replace-fail "Path=/usr/bin" "Path=$out/bin" \ + --replace-fail "Exec=/usr/bin/deskflow" "Exec=deskflow" + ''; + + meta = { + homepage = "https://github.com/deskflow/deskflow"; + description = "Deskflow lets you share one mouse and keyboard between multiple computers on Windows, macOS and Linux"; + mainProgram = "deskflow"; + maintainers = with lib.maintainers; [ aucub ]; + license = lib.licenses.gpl2Plus; + platforms = [ + "x86_64-linux" + "aarch64-darwin" + ]; + broken = stdenv.hostPlatform.isDarwin; + }; +}
M
profiles/runestone/base.nix
→
profiles/runestone/base.nix
@@ -49,7 +49,8 @@ users.users.charlotte.packages =
(with pkgs; [ stow ]) - ++ (with unstable-pkgs; [ - lan-mouse - ]); + ++ [ + unstable-pkgs.lan-mouse + user-pkgs.deskflow + ]; }