From cd9463e572f31b82a73cdab6db6b53f3a1237b3e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 12 Apr 2019 22:35:13 +0200 Subject: Use Nix to fetch ATOM feed Fetching external resources during the actual build became problematic after the last major Nix update (build purity was improved). The sensible way of doing things in Nix seems to be to declare ALL build dependencies prior to the actual build -- this includes e.g. ATOM feeds to be aggregated. I am probably not going to do the same for the individual repository feeds as this feature is going to be replaced with a more general _microblog_-like subpage. --- default.nix | 16 +++++++++------- source/01_raw/article_feed.xsl | 10 ++++------ utility/fetch_feed.sh | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/default.nix b/default.nix index d2c031d..36edbe9 100644 --- a/default.nix +++ b/default.nix @@ -1,10 +1,6 @@ -{ system ? builtins.currentSystem }: +{ pkgs ? import { }, mypkgs ? import { }, ... }: -let - pkgs = import { inherit system; }; - mypkgs = import (fetchTarball "https://pkgs.kummerlaender.eu/nixexprs.tar.gz") { }; - -in pkgs.stdenv.mkDerivation { +pkgs.stdenv.mkDerivation { name = "Overview"; src = ./.; @@ -18,7 +14,13 @@ in pkgs.stdenv.mkDerivation { mypkgs.make-xslt ]; - installPhase = '' + installPhase = let + blog_feed = builtins.fetchurl { + url = "https://blog.kummerlaender.eu/atom.xml"; + }; + in '' + cp ${blog_feed} source/00_content/article_feed.xml + make-xslt mkdir $out cp -Lr target/99_result/* $out diff --git a/source/01_raw/article_feed.xsl b/source/01_raw/article_feed.xsl index 96f918d..18c8d51 100644 --- a/source/01_raw/article_feed.xsl +++ b/source/01_raw/article_feed.xsl @@ -2,7 +2,6 @@ @@ -11,14 +10,13 @@ - + + - - + + diff --git a/utility/fetch_feed.sh b/utility/fetch_feed.sh index 45dbc6c..37393f6 100755 --- a/utility/fetch_feed.sh +++ b/utility/fetch_feed.sh @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env sh curl $1 | sed -e 's~^\([\*]\)\{3\}~\t\t\*~g' -e 's~^\([\*]\)\{2\}~\t\*~g' -- cgit v1.2.3