-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (64 loc) · 1.79 KB
/
flake.nix
File metadata and controls
70 lines (64 loc) · 1.79 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
{
description = "Greenlight - GitHub Actions workflow visualizer";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
# Per-system outputs: packages + devShells
(flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
erlang = pkgs.beam.packages.erlang_28;
elixir = erlang.elixir;
in
{
packages = {
default = pkgs.callPackage ./nix/package.nix {
beamPackages = erlang;
};
} // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
dockerImage = import ./nix/docker.nix {
inherit pkgs;
greenlight = self.packages.${system}.default;
};
};
devShells.default = pkgs.mkShell {
buildInputs = [
elixir
erlang.erlang
pkgs.postgresql
pkgs.tailwindcss_4
pkgs.nodejs
pkgs.inotify-tools
pkgs.watchman
];
env = {
MIX_TAILWIND_PATH = "${pkgs.tailwindcss_4}/bin/tailwindcss";
LANG = "en_US.UTF-8";
ERL_AFLAGS = "-kernel shell_history enabled";
};
shellHook = ''
mix local.hex --if-missing --force
mix local.rebar --if-missing --force
if [ ! -f _build/.setup_done ]; then
echo "First-time setup: running mix setup..."
mix setup
mkdir -p _build && touch _build/.setup_done
fi
'';
};
}
))
//
# System-agnostic outputs: NixOS module
{
nixosModules.default = import ./nix/module.nix self;
};
}