Package pyprland

This commit is contained in:
Nathan McCarty 2023-06-17 16:29:55 -04:00
parent 98633f798c
commit f8bcbb144f
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
5 changed files with 39 additions and 1 deletions

View File

@ -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);

View File

@ -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";
}

7
packages/pyprland/poetry.lock generated Normal file
View File

@ -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"

4
sources/pyprland.json Normal file
View File

@ -0,0 +1,4 @@
{
"rev": "8b42c1dec296854241e024f731e5707cf997b9d5",
"hash": "sha256-InwPUPNVW0fYrwrvmc3PhzLm2tK8IDM4CHpgfft/WJM="
}

View File

@ -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"