about summary refs log tree commit diff
path: root/pkgs/by-name/sc
diff options
context:
space:
mode:
authormatthewcroughan <matt@croughan.sh>2024-06-24 23:12:11 +0100
committerValentin Gagarin <valentin.gagarin@tweag.io>2024-06-27 11:52:34 +0200
commit2076935e3db98f46c6c77a33fc2ad9966cf35097 (patch)
treee5dc6c93f41e10dc5f02a3c5165c0deaa290de74 /pkgs/by-name/sc
parent23c24527dc69f286a2588de99d04edfe2f354bfe (diff)
scion-apps: init at unstable-2024-04-05
Diffstat (limited to 'pkgs/by-name/sc')
-rw-r--r--pkgs/by-name/sc/scion-apps/package.nix53
1 files changed, 53 insertions, 0 deletions
diff --git a/pkgs/by-name/sc/scion-apps/package.nix b/pkgs/by-name/sc/scion-apps/package.nix
new file mode 100644
index 0000000000000..f4dfd933d24f2
--- /dev/null
+++ b/pkgs/by-name/sc/scion-apps/package.nix
@@ -0,0 +1,53 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, openpam
+}:
+
+buildGoModule {
+  pname = "scion-apps";
+  version = "unstable-2024-04-05";
+
+  src = fetchFromGitHub {
+    owner = "netsec-ethz";
+    repo = "scion-apps";
+    rev = "cb0dc365082788bcc896f0b55c4807b72c2ac338";
+    hash = "sha256-RzWtnUpZfwryOfumgXHV5QMceLY51Zv3KI0K6WLz8rs=";
+  };
+
+  vendorHash = "sha256-bz4vtELxrDfebk+00w9AcEiK/4skO1mE3lBDU1GkOrk=";
+
+  postPatch = ''
+    substituteInPlace webapp/web/tests/health/scmpcheck.sh \
+      --replace-fail "hostname -I" "hostname -i"
+  '';
+
+  postInstall = ''
+    # Add `scion-` prefix to all binaries
+    for f in $out/bin/*; do
+      filename="$(basename "$f")"
+      mv -v $f $out/bin/scion-$filename
+    done
+
+    # Fix nested subpackage names
+    mv -v $out/bin/scion-server $out/bin/scion-ssh-server
+    mv -v $out/bin/scion-client $out/bin/scion-ssh-client
+
+    # Include static website for webapp
+    mkdir -p $out/share
+    cp -r webapp/web $out/share/scion-webapp
+  '';
+
+  buildInputs = [
+    openpam
+  ];
+
+  ldflags = [ "-s" "-w" ];
+
+  meta = with lib; {
+    description = "Public repository for SCION applications";
+    homepage = "https://github.com/netsec-ethz/scion-apps";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ matthewcroughan sarcasticadmin ];
+  };
+}