From ec9eba6a4901c12a884216c5e7ba0e88d0a19c63 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 13 Sep 2022 21:11:34 -0500 Subject: [PATCH] synit-pid1: init at unstable-2023-02-07 --- flake.nix | 2 ++ packages/synit-pid1/default.nix | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 packages/synit-pid1/default.nix diff --git a/flake.nix b/flake.nix index 83464b4..b40517a 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,8 @@ syndicate-server = final.callPackage ./packages/syndicate-server { rust = rust'; }; + + synit-pid1 = final.callPackage ./packages/synit-pid1 { rust = rust'; }; }; legacyPackages = diff --git a/packages/synit-pid1/default.nix b/packages/synit-pid1/default.nix new file mode 100644 index 0000000..7a8976e --- /dev/null +++ b/packages/synit-pid1/default.nix @@ -0,0 +1,37 @@ +# https://git.syndicate-lang.org/synit/synit/src/branch/main/packaging/packages/synit-pid1/APKBUILD + +{ lib, rustPlatform, rust, fetchFromGitea }: + +rustPlatform.buildRustPackage rec { + pname = "synit-pid1"; + version = "unstable-2023-02-07"; + src = fetchFromGitea { + domain = "git.syndicate-lang.org"; + owner = "synit"; + repo = "synit"; + rev = "69637cb27a1a3a900ff1d647e814206b0ca66ca5"; + hash = "sha256-VVMttlRIiH/aGytC9CutoaT0YDGkCGhO3GbipYXk3dg="; + }; + + patchPhase = + # Patch to take children and configuration from /run/booted-system. + '' + runHook prePatch + substituteInPlace src/main.rs \ + --replace '"/usr/bin/syndicate-server"' '"/run/booted-system/sw/bin/syndicate-server"' \ + --replace '"/sbin/synit-log"' '"/run/booted-system/sw/bin/synit-log"' \ + --replace '"/etc/syndicate/boot"' '"/run/booted-system/etc/syndicate/boot"' \ + + runHook postPatch + ''; + + sourceRoot = "source/${pname}"; + cargoHash = "sha256-57ZUlR+lIwQf3/4pDeeEMUc1juNTddcHpzNQZTUWbtU="; + nativeBuildInputs = [ rust ]; + + meta = src.meta // { + description = "Synit pid 1 program (patched for NixOS)"; + homepage = "https://synit.org/"; + maintainers = with lib.maintainers; [ ehmry ]; + }; +}