-
Notifications
You must be signed in to change notification settings - Fork 10
/
default.nix
32 lines (31 loc) · 950 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- mode: nix; coding: utf-8; -*-
{ nixpkgs-url ?
"https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz"
, system ? builtins.currentSystem
, crossSystem ? null
, config ? {}
, overlays ? []
, pkgs ? import (builtins.fetchTarball nixpkgs-url) {
inherit crossSystem system config overlays;
}
, small ? true
, ...
} @ args:
let
ensure = f: n: if builtins.pathExists f then f
else builtins.fetchurl
"https://matthewbauer.us/bauer/${n}";
in import (pkgs.runCommand "README" {
buildInputs = with pkgs; [ emacs git ];
} (''
install -D ${ensure ./README.org "README.org"} \
$out/README.org
cd $out
'' + pkgs.lib.optionalString (builtins.pathExists ./site-lisp) ''
cp -r ${./site-lisp} site-lisp
'' + ''
emacs --batch --quick \
-l ob-tangle \
--eval "(org-babel-tangle-file \"README.org\")" > /dev/null
cp bauer.nix default.nix
'')) { inherit ensure pkgs small system; }