Unverified Commit 173c62d2 authored by Denilson dos Santos Ebling's avatar Denilson dos Santos Ebling
Browse files

river-ultitile: init at 1.3.0

parent 3e81a31a
Loading
Loading
Loading
Loading
+99 −0
Original line number Diff line number Diff line
# generated by zon2nix (https://github.com/Cloudef/zig2nix)

{
  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,
      rev ? throw "rev is required, remove and regenerate the zon2json-lock file",
    }:
    let
      parts = splitString "#" url;
      url_base = elemAt parts 0;
      url_without_query = elemAt (splitString "?" url_base) 0;
    in
    fetchgit {
      inherit name rev hash;
      url = url_without_query;
      deepClone = false;
    };

  fetchZigArtifact =
    {
      name,
      url,
      hash,
      ...
    }@args:
    let
      parts = splitString "://" url;
      proto = elemAt parts 0;
      path = elemAt parts 1;
      fetcher = {
        "git+http" = fetchGitZig (
          args
          // {
            url = "http://${path}";
          }
        );
        "git+https" = fetchGitZig (
          args
          // {
            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 = "wayland-0.3.0-lQa1kjPIAQDmhGYpY-zxiRzQJFHQ2VqhJkQLbKKdt5wl";
    path = fetchZigArtifact {
      name = "wayland";
      url = "https://codeberg.org/ifreund/zig-wayland/archive/v0.3.0.tar.gz";
      hash = "sha256-xU8IrETSFOKKQQMgwVyRKLwGaek4USaKXg49S9oHSTQ=";
    };
  }
]
+69 −0
Original line number Diff line number Diff line
{
  callPackage,
  fetchFromSourcehut,
  lib,
  pandoc,
  pkg-config,
  stdenv,
  wayland,
  wayland-protocols,
  wayland-scanner,
  zig_0_14,
}:

let
  zig = zig_0_14;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "river-ultitile";
  version = "1.3.0";

  src = fetchFromSourcehut {
    owner = "~midgard";
    repo = "river-ultitile";
    rev = "v${finalAttrs.version}";
    hash = "sha256-whzJZLgd51kXOVq9YVqcADTOyGmHmwJZWzbrZGZx3Ak=";
  };

  nativeBuildInputs = [
    zig.hook
    pkg-config
    wayland
    wayland-scanner
  ];

  buildInputs = [
    wayland-protocols
    pandoc # used for building documentation
  ];

  deps = callPackage ./build.zig.zon.nix { };

  zigBuildFlags = [
    "--system"
    "${finalAttrs.deps}"
  ];

  meta = {
    description = "Configurable layout generator for the River compositor";
    longDescription = ''
      A layout generator for **river**. Features include:
      - **configurable** layouts employing nested tiles (no juggling with coordinates),
      - **widescreen** support by default,
      - default layouts, switchable at run time with a command or key binding:
          - dwm-like main/stack layout,
              - main on the left on normal screens,
              - **main in the center and stacks on both sides** on widescreens,
          - a vertical stack,
          - a horizontal stack, and
          - a monocle layout,
      - optional per-tag-per-output state.
    '';
    changelog = "https://git.sr.ht/~midgard/river-ultitile/tree/v${finalAttrs.version}/item/CHANGELOG.md";
    homepage = "https://git.sr.ht/~midgard/river-ultitile";
    license = lib.licenses.gpl3Plus;
    mainProgram = "river-ultitile";
    maintainers = with lib.maintainers; [ debling ];
    platforms = lib.platforms.linux;
  };
})