This repository was archived by the owner on Aug 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathflake.nix
More file actions
80 lines (75 loc) · 1.9 KB
/
flake.nix
File metadata and controls
80 lines (75 loc) · 1.9 KB
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
75
76
77
78
79
80
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
chaostreff-scheduler.url = "github:section77/chaostreff-scheduler?rev=f60231f0a8f01b2752a7f8c445fd180e803c66ff";
chaostreff-scheduler.flake = false;
};
outputs = { self, nixpkgs, chaostreff-scheduler }:
let
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
pkgsFor = forAllSystems (
system:
import nixpkgs {
inherit system;
}
);
in
rec
{
packages = forAllSystems (system:
let
pkgs = pkgsFor.${system};
in
{
scheduler = pkgs.haskellPackages.developPackage {
root = chaostreff-scheduler;
};
site = pkgs.stdenvNoCC.mkDerivation {
name = "website";
src = self;
nativeBuildInputs = with pkgs; [
imagemagick
lektor
];
installPhase = ''
mkdir -p $out
lektor build -O $out
'';
};
});
apps = forAllSystems (system:
let
pkgs = pkgsFor.${system};
scheduler = packages.${system}.scheduler;
in
rec
{
schedule = {
type = "app";
program = "${pkgs.writeShellScript "schedule" ''
export HOME=$TEMP
${pkgs.git}/bin/git config --global user.name "chaostreff-scheduler"
${pkgs.git}/bin/git config --global user.email "chaostreff-scheduler@section77.de"
${scheduler}/bin/chaostreff-scheduler --no-push -r . -w . -c 2
''}";
};
default = schedule;
});
devShells = forAllSystems (system:
let
pkgs = pkgsFor.${system};
in
{
default = pkgs.mkShellNoCC {
nativeBuildInputs = packages.${system}.site.nativeBuildInputs;
shellHook = ''
${pkgs.lektor}/bin/lektor server -h 0.0.0.0 -p 5001
'';
};
});
};
}