-
Notifications
You must be signed in to change notification settings - Fork 44
/
flake.nix
74 lines (65 loc) · 2.19 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
emanote.url = "github:srid/emanote";
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
flake-parts.follows = "hercules-ci-effects/flake-parts";
flake-compat-ci.url = "github:hercules-ci/flake-compat-ci";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = inputs @ { self, flake-parts, hercules-ci-effects, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ ... }: {
imports = [
hercules-ci-effects.flakeModule
];
systems = [ "x86_64-linux" ];
# { self, hercules-ci-effects, emanote, nixpkgs }
perSystem = { self', inputs', pkgs, system, ... }:
let
emanote = inputs.emanote.defaultPackage.${system};
in
{
apps = {
default = self'.apps.live;
live =
let
script = pkgs.writers.writeBash "emanotePlutonomiconLiveReload.sh" ''
set -xe
export PORT="''${EMANOTE_PORT:-7071}"
${emanote}/bin/emanote run --port $PORT
'';
in
{
type = "app";
program = script.outPath;
};
};
packages = {
default = self'.packages.website;
website =
let
configFile = (pkgs.formats.yaml {}).generate "plutonomicon-configFile" {
template.baseUrl = "/plutonomicon/";
};
configDir = pkgs.runCommand "plutonomicon-configDir" {} ''
mkdir -p $out
cp ${configFile} $out/index.yaml
'';
in
pkgs.runCommand "plutonomicon-website" {}
''
mkdir $out
${emanote}/bin/emanote \
--layers "${self};${configDir}" \
gen $out
'';
};
hercules-ci.github-pages.settings.contents = self'.packages.website;
};
hercules-ci.github-pages.branch = "main";
herculesCI.ciSystems = [ "x86_64-linux" ];
});
}