summaryrefslogtreecommitdiff
path: root/chaski
diff options
context:
space:
mode:
authorstuebinm2022-07-19 02:31:38 +0200
committerstuebinm2022-07-19 02:31:38 +0200
commitc64eb9f14637e0cc8f7dcb1db07515390c25ef38 (patch)
treebd8bc50575f0d3e089376cf342a2f88fa92ba72b /chaski
parentbdf36207b30da84573a4ca40923b066be6bcfab6 (diff)
update flake inputs
(also remove some broken things / reduce closure size for chaski)
Diffstat (limited to 'chaski')
-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";