From f8bcbb144fc4acb6cd20ecb49e7ebb1b871d3272 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Sat, 17 Jun 2023 16:29:55 -0400 Subject: [PATCH] Package pyprland --- flake.nix | 1 + packages/pyprland/default.nix | 15 +++++++++++++++ packages/pyprland/poetry.lock | 7 +++++++ sources/pyprland.json | 4 ++++ sources/update-sources.sh | 13 ++++++++++++- 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 packages/pyprland/default.nix create mode 100644 packages/pyprland/poetry.lock create mode 100644 sources/pyprland.json diff --git a/flake.nix b/flake.nix index 6310432..d6248ff 100644 --- a/flake.nix +++ b/flake.nix @@ -301,6 +301,7 @@ swayimg = pkgs.callPackage ./packages/swayimg/default.nix { }; hyprland-autoname-workspaces = pkgs.callPackage ./packages/workspace-renamer/default.nix { }; + pyprland = pkgs.callPackage ./packages/pyprland { }; shortcuts = let script = writePython311Script "shortcuts" { } (builtins.readFile ./scripts/shortcuts/shortcuts.py); diff --git a/packages/pyprland/default.nix b/packages/pyprland/default.nix new file mode 100644 index 0000000..7a4ff34 --- /dev/null +++ b/packages/pyprland/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, poetry2nix, ... }: +let + vals = builtins.fromJSON (builtins.readFile ../../sources/pyprland.json); + rev = vals.rev; + hash = vals.hash; + src = pkgs.fetchFromGitHub { + owner = "hyprland-community"; + repo = "pyprland"; + inherit rev hash; + }; +in poetry2nix.mkPoetryApplication { + inherit src; + poetrylock = ./poetry.lock; + pyproject = "${src}/pyproject.toml"; +} diff --git a/packages/pyprland/poetry.lock b/packages/pyprland/poetry.lock new file mode 100644 index 0000000..022bbde --- /dev/null +++ b/packages/pyprland/poetry.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. +package = [] + +[metadata] +lock-version = "2.0" +python-versions = "^3.10" +content-hash = "53f2eabc9c26446fbcc00d348c47878e118afc2054778c3c803a0a8028af27d9" diff --git a/sources/pyprland.json b/sources/pyprland.json new file mode 100644 index 0000000..dece421 --- /dev/null +++ b/sources/pyprland.json @@ -0,0 +1,4 @@ +{ + "rev": "8b42c1dec296854241e024f731e5707cf997b9d5", + "hash": "sha256-InwPUPNVW0fYrwrvmc3PhzLm2tK8IDM4CHpgfft/WJM=" +} diff --git a/sources/update-sources.sh b/sources/update-sources.sh index 500604a..976eb93 100755 --- a/sources/update-sources.sh +++ b/sources/update-sources.sh @@ -28,6 +28,18 @@ echo "swayimg now at $SWAYIMG_VERSION" # > $DIRECTORY/autoname.json # echo "autoname now at $AUTONAME_REV" +# Update pyprland +PYPRLAND_BRANCH=$(curl https://api.github.com/repos/hyprland-community/pyprland | jq -r '.default_branch') +PYPRLAND_REV=$(curl https://api.github.com/repos/hyprland-community/pyprland/git/refs/heads/$PYPRLAND_BRANCH | \ + jq -r '.object.sha') +PYPRLAND_HASH=$(nix-prefetch fetchFromGitHub --owner hyprland-community --repo pyprland --rev $PYPRLAND_REV) +jq --null-input \ + --arg rev "$PYPRLAND_REV" \ + --arg hash "$PYPRLAND_HASH" \ + '{"rev": $rev, "hash": $hash}' \ + > $DIRECTORY/pyprland.json +echo "pyprland now at $PYPRLAND_REV" + # Update gamescope GAMESCOPE_BRANCH=$(curl https://api.github.com/repos/ValveSoftware/gamescope | jq -r '.default_branch') GAMESCOPE_REV=$(curl https://api.github.com/repos/ValveSoftware/gamescope/git/refs/heads/$GAMESCOPE_BRANCH | \ @@ -39,4 +51,3 @@ jq --null-input \ '{"rev": $rev, "hash": $hash}' \ > $DIRECTORY/gamescope.json echo "gamescope now at $GAMESCOPE_REV" -