From 43ec95f54a4fba7813e914a5248763839ccd5873 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 18 May 2023 01:31:06 +0000 Subject: [PATCH] begin packaging for bonsai (incomplete) --- flake.nix | 6 +++++ pkgs/additional/bonsai/default.nix | 41 ++++++++++++++++++++++++++++++ pkgs/default.nix | 1 + templates/pkgs/make/default.nix | 35 +++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 pkgs/additional/bonsai/default.nix create mode 100644 templates/pkgs/make/default.nix diff --git a/flake.nix b/flake.nix index 5b97a221..b150df91 100644 --- a/flake.nix +++ b/flake.nix @@ -307,6 +307,12 @@ path = ./templates/pkgs/rust; description = "rust package fit to ship in nixpkgs"; }; + pkgs.make = { + # initialize with: + # - `nix flake init -t '/home/colin/dev/nixos/#pkgs.make'` + path = ./templates/pkgs/make; + description = "default Makefile-based derivation"; + }; }; }; } diff --git a/pkgs/additional/bonsai/default.nix b/pkgs/additional/bonsai/default.nix new file mode 100644 index 00000000..d34da6d5 --- /dev/null +++ b/pkgs/additional/bonsai/default.nix @@ -0,0 +1,41 @@ +{ stdenv +, lib +, fetchFromSourcehut +, gitUpdater +, hare +}: + +stdenv.mkDerivation rec { + pname = "bonsai"; + version = "1.0.0"; + + src = fetchFromSourcehut { + owner = "~stacyharper"; + repo = pname; + rev = "v${version}"; + hash = "sha256-jOtFUpl2/Aa7f8JMZf6g63ayFOi+Ci+i7Ac63k63znc="; + }; + + nativeBuildInputs = [ + hare + ]; + + preConfigure = '' + export HARECACHE=$(mktemp -d) + ''; + + installFlags = [ "PREFIX=" "DESTDIR=$(out)" ]; + + passthru.updateScript = gitUpdater { + rev-prefix = "v"; + }; + + meta = with lib; { + description = "Bonsai is a Finite State Machine structured as a tree"; + homepage = "https://git.sr.ht/~stacyharper/bonsai"; + license = licenses.agpl3; + maintainers = with maintainers; [ colinsane ]; + platforms = platforms.linux; + broken = true; # needs hare-json. see: + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index b1b04390..73145615 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -11,6 +11,7 @@ let sane-lib = import ../modules/lib pkgs; ### ADDITIONAL PACKAGES + bonsai = callPackage ./additional/bonsai { }; bootpart-uefi-x86_64 = callPackage ./additional/bootpart-uefi-x86_64 { }; browserpass-extension = callPackage ./additional/browserpass-extension { }; cargoDocsetHook = callPackage ./additional/cargo-docset/hook.nix { }; diff --git a/templates/pkgs/make/default.nix b/templates/pkgs/make/default.nix new file mode 100644 index 00000000..6266c910 --- /dev/null +++ b/templates/pkgs/make/default.nix @@ -0,0 +1,35 @@ +{ stdenv +, lib +, fetchFromGitHub +, gitUpdater +}: + +stdenv.mkDerivation rec { + pname = "TODO"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "TODO"; + repo = pname; + rev = "v${version}"; + hash = "sha256-TODO"; + }; + + nativeBuildInputs = [ + ]; + + buildInputs = [ + ]; + + passthru.updateScript = gitUpdater { + rev-prefix = "v"; + }; + + meta = with lib; { + description = "TODO (don't end in period)"; + homepage = "TODO"; + license = licenses.TODO; + maintainers = with maintainers; [ colinsane ]; + platforms = platforms.linux; + }; +}