Unverified Commit f4a76ebd authored by Adam C. Stephens's avatar Adam C. Stephens Committed by GitHub
Browse files

waylock: 1.2.1 -> 1.3.0 (#354685)

parents 6eafb43c a4e29863
Loading
Loading
Loading
Loading
+94 −7
Original line number Diff line number Diff line
# generated by zon2nix (https://github.com/nix-community/zon2nix)
# generated by zon2nix (https://github.com/Cloudef/zig2nix)

{ linkFarm, fetchzip }:
{
  lib,
  linkFarm,
  fetchurl,
  fetchgit,
  runCommandLocal,
  zig,
  name ? "zig-packages",
}:

with builtins;
with lib;

let
  unpackZigArtifact =
    { name, artifact }:
    runCommandLocal name
      {
        nativeBuildInputs = [ zig ];
      }
      ''
        hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
        mv "$TMPDIR/p/$hash" "$out"
        chmod 755 "$out"
      '';

  fetchZig =
    {
      name,
      url,
      hash,
    }:
    let
      artifact = fetchurl { inherit url hash; };
    in
    unpackZigArtifact { inherit name artifact; };

  fetchGitZig =
    {
      name,
      url,
      hash,
    }:
    let
      parts = splitString "#" url;
      url_base = elemAt parts 0;
      url_without_query = elemAt (splitString "?" url_base) 0;
      rev_base = elemAt parts 1;
      rev = if match "^[a-fA-F0-9]{40}$" rev_base != null then rev_base else "refs/heads/${rev_base}";
    in
    fetchgit {
      inherit name rev hash;
      url = url_without_query;
      deepClone = false;
    };

linkFarm "zig-packages" [
  fetchZigArtifact =
    {
      name,
      url,
      hash,
    }:
    let
      parts = splitString "://" url;
      proto = elemAt parts 0;
      path = elemAt parts 1;
      fetcher = {
        "git+http" = fetchGitZig {
          inherit name hash;
          url = "http://${path}";
        };
        "git+https" = fetchGitZig {
          inherit name hash;
          url = "https://${path}";
        };
        http = fetchZig {
          inherit name hash;
          url = "http://${path}";
        };
        https = fetchZig {
          inherit name hash;
          url = "https://${path}";
        };
      };
    in
    fetcher.${proto};
in
linkFarm name [
  {
    name = "1220687c8c47a48ba285d26a05600f8700d37fc637e223ced3aa8324f3650bf52242";
    path = fetchzip {
    path = fetchZigArtifact {
      name = "zig-wayland";
      url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.2.0.tar.gz";
      hash = "sha256-dvit+yvc0MnipqWjxJdfIsA6fJaJZOaIpx4w4woCxbE=";
      hash = "sha256-gxzkHLCq2NqX3l4nEly92ARU5dqP1SqnjpGMDgx4TXA=";
    };
  }
  {
    name = "1220c90b2228d65fd8427a837d31b0add83e9fade1dcfa539bb56fd06f1f8461605f";
    path = fetchzip {
    path = fetchZigArtifact {
      name = "zig-xkbcommon";
      url = "https://codeberg.org/ifreund/zig-xkbcommon/archive/v0.2.0.tar.gz";
      hash = "sha256-T+EZiStBfmxFUjaX05WhYkFJ8tRok/UQtpc9QY9NxZk=";
      hash = "sha256-f5oEJU5i2qeVN3GBrnQcqzEJCiOT7l4ak7GQ6gw5cH0=";
    };
  }
]
+3 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "waylock";
  version = "1.2.1";
  version = "1.3.0";

  src = fetchFromGitea {
    domain = "codeberg.org";
@@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
    repo = "waylock";
    rev = "v${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-i1Nd39666xrkzi7r08ZRIXJXvK9wmzb8zdmvmWEQaHE=";
    hash = "sha256-jfMSar+Y3inu1Cly6rIDw+akBJIQ6huL0smAstgQmEo=";
  };

  deps = callPackage ./build.zig.zon.nix { };
@@ -52,7 +52,7 @@ stdenv.mkDerivation (finalAttrs: {
    substituteInPlace pam.d/waylock --replace-fail "system-auth" "login"
  '';

  passthru.updateScript = ./update.nu;
  passthru.updateScript = ./update.sh;

  meta = {
    homepage = "https://codeberg.org/ifreund/waylock";

pkgs/by-name/wa/waylock/update.nu

deleted100755 → 0
+0 −8
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -i nu -p nushell common-updater-scripts zon2nix

let latest_tag = list-git-tags --url=https://codeberg.org/ifreund/waylock | lines | sort --natural | str replace v '' | last
update-source-version waylock $latest_tag

http get $"https://codeberg.org/ifreund/waylock/raw/tag/v($latest_tag)/build.zig.zon" | save build.zig.zon
zon2nix > pkgs/by-name/wa/waylock/build.zig.zon.nix
+14 −0
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash common-updater-scripts gnused nixfmt-rfc-style zon2nix

latest_tag=$(list-git-tags --url=https://codeberg.org/ifreund/waylock | sed 's/^v//' | tail -n 1)

update-source-version waylock "$latest_tag"

wget "https://codeberg.org/ifreund/waylock/raw/tag/v${latest_tag}/build.zig.zon"
nix --extra-experimental-features 'nix-command flakes' run github:Cloudef/zig2nix#zon2nix -- build.zig.zon >pkgs/by-name/wa/waylock/build.zig.zon.nix
# strip file protocol
sed -i '\|file = unpackZigArtifact { inherit name; artifact = /. + path; };|d' pkgs/by-name/wa/waylock/build.zig.zon.nix
nixfmt pkgs/by-name/wa/waylock/build.zig.zon.nix

rm -f build.zig.zon build.zig.zon2json-lock