-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
32 lines (30 loc) · 954 Bytes
/
flake.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
{
description = "YorikSar's resume";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {self, nixpkgs, flake-utils}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
makeScripts = attrs: builtins.mapAttrs (name: value: {
type = "app";
program = "${pkgs.writeShellScriptBin name value}/bin/${name}";
}) attrs;
git = "${pkgs.git}/bin/git";
in rec {
defaultApp = apps.page;
apps = makeScripts rec {
worktree = "[ -d .html ] || ${git} worktree add .html gh-pages";
page = "${worktree}; ${pkgs.docutils}/bin/rst2html.py resume.rst .html/index.html";
commit-page = ''
${page}
cd .html
if [ "$$(${git} status -s)" ]; then
${git} commit -am "Update to master branch"
fi
'';
};
});
}