-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathflake.nix
More file actions
84 lines (80 loc) · 2.18 KB
/
flake.nix
File metadata and controls
84 lines (80 loc) · 2.18 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
83
84
{
description = "DMARC report parser and dashboard";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs =
{ nixpkgs, ... }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
in
{
formatter = forAllSystems (pkgs: pkgs.nixfmt);
packages = forAllSystems (
pkgs:
let
frontend = pkgs.buildNpmPackage {
pname = "parse-dmarc-frontend";
version = "0.0.0-dev";
src = ./.;
npmDepsHash = "sha256-6QQi2bqDx/AqMcBkNghcxYmqdYm+gdLq0YJkyudf7XQ=";
nativeBuildInputs = with pkgs; [ python3 ];
buildPhase = ''
runHook preBuild
npx vite build
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
};
in
{
default = pkgs.buildGoModule {
pname = "parse-dmarc";
version = "0.0.0-dev";
src = ./.;
vendorHash = "sha256-ojwyblK05W0O4GVVzKvsAfMc+EVWWBjn4F7RsT5S0/o=";
env.CGO_ENABLED = 0;
preBuild = ''
cp -r ${frontend} internal/api/dist
'';
meta = {
description = "DMARC report parser and dashboard";
mainProgram = "parse-dmarc";
};
};
}
);
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages =
with pkgs;
[
go
goreleaser
gotools
golangci-lint
just
air
bun
nodejs
]
++ lib.optionals stdenv.isLinux [
stdenv.cc.cc.lib
];
env = pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc.lib ];
};
};
});
};
}