summaryrefslogtreecommitdiff
path: root/chaski/services
diff options
context:
space:
mode:
Diffstat (limited to 'chaski/services')
-rw-r--r--chaski/services/tracktrain.nix16
1 files changed, 14 insertions, 2 deletions
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";