From 50704483fd83f5babf840580e3b3a4eb4afdf890 Mon Sep 17 00:00:00 2001 From: KokaKiwi Date: Tue, 16 Apr 2024 13:29:47 +0200 Subject: [PATCH] style: Move stuff --- default.nix | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/default.nix b/default.nix index 873cbfc..1bab94c 100644 --- a/default.nix +++ b/default.nix @@ -34,22 +34,9 @@ hash = "sha256-M+rPJ/Xo2olhqB5ViynGRaesMLLfG/1ltUoLnepMPnM="; }; }; -in buildNpmPackage rec { - pname = "cryptpad"; - version = "2024.3.0"; - - src = fetchFromGitHub { - owner = "cryptpad"; - repo = "cryptpad"; - rev = version; - hash = "sha256-VUW6KvoSatk1/hlzklMQYlSNVH/tdbH+yU4ONUQ0JSQ="; - }; - - npmDepsHash = "sha256-tvTkoxxioPuNoe8KIuXSP7QQbvcpxMnygsMmzKBQIY0="; - - inherit nodejs; - - onlyOffice = if withOnlyOffice then stdenvNoCC.mkDerivation (final: { + mkOnlyOffice = { + pname, version + }: stdenvNoCC.mkDerivation (final: { pname = "${pname}-onlyoffice"; inherit version; @@ -71,7 +58,25 @@ in buildNpmPackage rec { (builtins.attrNames onlyOfficeVersions) )} ''; - }) else null; + }); +in buildNpmPackage rec { + pname = "cryptpad"; + version = "2024.3.0"; + + src = fetchFromGitHub { + owner = "cryptpad"; + repo = "cryptpad"; + rev = version; + hash = "sha256-VUW6KvoSatk1/hlzklMQYlSNVH/tdbH+yU4ONUQ0JSQ="; + }; + + npmDepsHash = "sha256-tvTkoxxioPuNoe8KIuXSP7QQbvcpxMnygsMmzKBQIY0="; + + inherit nodejs; + + onlyOffice = lib.optional withOnlyOffice (mkOnlyOffice { + inherit pname version; + }); makeCacheWritable = true; dontFixup = true;