From d6d253568689d9f754e03138b5c5e6b5817e5c8a Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sun, 23 Apr 2023 05:12:47 +0200 Subject: [PATCH] Start to add new package SAML Jackson --- hosts/bicep/configuration.nix | 1 + hosts/bicep/services/jackson.nix | 15 +++++++++++++++ pkgs/jackson/default.nix | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 hosts/bicep/services/jackson.nix create mode 100644 pkgs/jackson/default.nix diff --git a/hosts/bicep/configuration.nix b/hosts/bicep/configuration.nix index a43f256..eea7aec 100644 --- a/hosts/bicep/configuration.nix +++ b/hosts/bicep/configuration.nix @@ -7,6 +7,7 @@ ./services/postgres.nix ./services/jokum.nix + ./services/jackson.nix ]; sops.defaultSopsFile = ../../secrets/bicep/bicep.yaml; diff --git a/hosts/bicep/services/jackson.nix b/hosts/bicep/services/jackson.nix new file mode 100644 index 0000000..a0cc7ba --- /dev/null +++ b/hosts/bicep/services/jackson.nix @@ -0,0 +1,15 @@ +{ pkgs, config, secrets, inputs, ... }: +let + jackson = pkgs.callPackage ../../../pkgs/jackson { }; +in { + systemd.services.jackson = { + description = "Jackson"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + ExecStart = "${jackson}/bin/jackson"; + DynamicUser = true; + Restart = "always"; + }; + }; +} diff --git a/pkgs/jackson/default.nix b/pkgs/jackson/default.nix new file mode 100644 index 0000000..d762f45 --- /dev/null +++ b/pkgs/jackson/default.nix @@ -0,0 +1,32 @@ +{ lib, buildNpmPackage, fetchFromGitHub }: + +buildNpmPackage rec { + pname = "jackson"; + version = "1.9.6"; + + src = fetchFromGitHub { + owner = "boxyhq"; + repo = pname; + rev = "v${version}"; + hash = "sha256-iZKl2dBBEQLemHMSa6rXYAuCo02WhG/BcYKTmCm46hI="; + }; + + prePhase = '' + export HOME=$TMPDIR + ''; + + npmDepsHash = "sha256-pYGdbmfewdvVuNfuWLlj5TmxQGdQfqPZs6TXzttoHYo="; + + # The prepack script runs the build script, which we'd rather do in the build phase. + npmFlags = [ "--loglevel silent" ]; + + + #NODE_OPTIONS = "--openssl-legacy-provider"; + + meta = with lib; { + description = "Enterprise SSO made simple"; + homepage = "https://github.com/boxyhq/jackson"; + license = licenses.asl20; + maintainers = with maintainers; [ felixalbrigtsen ]; + }; +}