From d87ea11ddad434052fae1eaf30ae70bf2f66a494 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 24 Sep 2018 10:08:43 +0200 Subject: Port blog build, host custom Nix repository on automatix --- host/automatix.nix | 2 + .../blog.kummerlaender.eu-change-domain.patch | 11 ++++++ host/software/blog.kummerlaender.eu.nix | 43 ++++++++++++++++++++++ host/software/pkgs.kummerlaender.eu.nix | 13 +++++++ 4 files changed, 69 insertions(+) create mode 100644 host/software/asset/blog.kummerlaender.eu-change-domain.patch create mode 100644 host/software/blog.kummerlaender.eu.nix create mode 100644 host/software/pkgs.kummerlaender.eu.nix (limited to 'host') diff --git a/host/automatix.nix b/host/automatix.nix index cbd0aeb..75e28bb 100644 --- a/host/automatix.nix +++ b/host/automatix.nix @@ -4,6 +4,8 @@ imports = [ ./hardware/automatix.nix ./software/code.kummerlaender.eu.nix + ./software/pkgs.kummerlaender.eu.nix + ./software/blog.kummerlaender.eu.nix ]; boot.loader.grub = { diff --git a/host/software/asset/blog.kummerlaender.eu-change-domain.patch b/host/software/asset/blog.kummerlaender.eu-change-domain.patch new file mode 100644 index 0000000..2a7c864 --- /dev/null +++ b/host/software/asset/blog.kummerlaender.eu-change-domain.patch @@ -0,0 +1,11 @@ +diff --git a/source/00_content/meta.xml b/source/00_content/meta.xml +index 159ed2b..2debf84 100644 +--- a/source/00_content/meta.xml ++++ b/source/00_content/meta.xml +@@ -2,5 +2,5 @@ + + /home/adrian + Adrian Kummerländer +- http://localhost:8080 ++ https://blog.kummerlaender.eu + diff --git a/host/software/blog.kummerlaender.eu.nix b/host/software/blog.kummerlaender.eu.nix new file mode 100644 index 0000000..0b111ad --- /dev/null +++ b/host/software/blog.kummerlaender.eu.nix @@ -0,0 +1,43 @@ +{ pkgs, ... }: + +let + mypkgs = import { }; + + content = pkgs.stdenv.mkDerivation { + name = "blog.kummerlaender.eu"; + + src = pkgs.fetchFromGitHub { + owner = "KnairdA"; + repo = "blog.kummerlaender.eu"; + rev = "218123bcc40a82ec10bf4f1de372f72557aa0064"; + sha256 = "1yhpvc0z7v5crvmyszzp9jcf23fd0pri6mrvn3k3bbycndmbs4gx"; + }; + + LANG = "en_US.UTF-8"; + + buildInputs = [ + pkgs.pandoc + pkgs.highlight + mypkgs.KaTeX + mypkgs.makeweb + ]; + + patches = [ ./asset/blog.kummerlaender.eu-change-domain.patch ]; + + installPhase = '' + makeweb + mkdir $out + cp -Lr target/99_result/* $out + ''; + }; +in { + services.nginx.virtualHosts."blog.kummerlaender.eu" = { + addSSL = true; + enableACME = true; + locations = { + "/" = { + root = "${content}"; + }; + }; + }; +} diff --git a/host/software/pkgs.kummerlaender.eu.nix b/host/software/pkgs.kummerlaender.eu.nix new file mode 100644 index 0000000..a41f55e --- /dev/null +++ b/host/software/pkgs.kummerlaender.eu.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: + +{ + services.nginx.virtualHosts."pkgs.kummerlaender.eu" = { + addSSL = true; + enableACME = true; + locations = { + "/nixexprs.tar.gz" = { + proxyPass = "http://localhost:3000/adrian/pkgs/archive/master.tar.gz"; + }; + }; + }; +} -- cgit v1.2.3