From c64eb9f14637e0cc8f7dcb1db07515390c25ef38 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 19 Jul 2022 02:31:38 +0200 Subject: update flake inputs (also remove some broken things / reduce closure size for chaski) --- chaski/services/tracktrain.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'chaski/services') diff --git a/chaski/services/tracktrain.nix b/chaski/services/tracktrain.nix index bd99abf..ade9b68 100644 --- a/chaski/services/tracktrain.nix +++ b/chaski/services/tracktrain.nix @@ -1,5 +1,17 @@ { config, lib, pkgs, inputs, ... }: +let + # this gets rid of the implicit dependency on ghc, reducing closure size + stripLib = drv: pkgs.stdenv.mkDerivation { + name = drv.name + "-without-lib"; + src = drv.outPath; + buildPhase = '' + mkdir -p $out + cp -r $src/bin $out + ''; + phases = [ "buildPhase" ]; + }; +in { services.nginx.virtualHosts."tracktrain.stuebinm.eu" = { locations."/" = { @@ -36,13 +48,13 @@ script = '' cd /tmp wget "https://ilztalbahn.eu/wp-content/uploads/2020/07/gtfs.zip" - ${((import inputs.tracktrain {nixpkgs = pkgs;})) + ${stripLib (((import inputs.tracktrain {nixpkgs = pkgs;})) # have to remove version constraints because some aren't in 22.05 .overrideAttrs (old: { patchPhase = '' sed -i "s/base.*/base/g" *.cabal sed -i "s/^>=.*//g" *.cabal sed -i "s/>=.*//g" *.cabal - ''; }) + ''; })) }/bin/tracktrain "dbname=tracktrain user=tracktrain" ''; startAt = "daily"; -- cgit v1.2.3