-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
82 lines (79 loc) · 2.19 KB
/
Copy pathflake.nix
File metadata and controls
82 lines (79 loc) · 2.19 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
81
82
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
gleam2nix = {
url = "git+https://git.isincredibly.gay/srxl/gleam2nix?ref=v1.2.0";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
perSystem =
{
inputs',
self',
pkgs,
...
}:
let
gleam = pkgs.gleam;
erlang = pkgs.beamMinimalPackages.erlang;
in
{
packages = {
default = self'.packages.tsvfmt;
tsvfmt = inputs.gleam2nix.lib.${pkgs.system}.buildGleamApplication {
pname = "tsvfmt";
version = "2.0.0";
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
gleamNix = import ./gleam.nix;
gleam = gleam;
erlang = erlang;
};
};
apps = {
default = self'.apps.tsvfmt;
tsvfmt = {
type = "app";
program = pkgs.lib.getExe self'.packages.tsvfmt;
};
};
devShells.default = pkgs.mkShell {
name = "tsvfmt";
packages = [
gleam
pkgs.just
erlang # We need escript installed to run the tests
]
# Pre-commit
++ [
# keep-sorted start
inputs'.gleam2nix.packages.gleam2nix
pkgs.deadnix
pkgs.keep-sorted
pkgs.markdownlint-cli2
pkgs.nixfmt
pkgs.nodePackages.prettier
pkgs.omnix
pkgs.pre-commit
pkgs.python312Packages.pre-commit-hooks
pkgs.ratchet
pkgs.toml-sort
pkgs.typos
pkgs.zizmor
# keep-sorted end
];
shellHook = "pre-commit install --overwrite";
};
formatter = pkgs.nixfmt-tree;
};
};
}