-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
75 lines (67 loc) · 2.22 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
75
{
description = "Development environment for BanterBus";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
playwright.url = "github:pietdevries94/playwright-web-flake/1.49.1";
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, gomod2nix, pre-commit-hooks
, playwright, ... }:
(flake-utils.lib.eachDefaultSystem (system:
let
overlay = final: prev: {
inherit (playwright.packages.${system})
playwright-test playwright-driver;
};
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
myPackages = with pkgs; [
go_1_22
goose
air
golangci-lint
gotools
gotestsum
gocover-cobertura
go-task
go-mockery
goreleaser
golines
# playwright-test
# test
playwright-driver
tailwindcss
templ
sqlc
];
devShellPackages = with pkgs; myPackages ++ [ gitlab-ci-local ];
# The current default sdk for macOS fails to compile go projects, so we use a newer one for now.
# This has no effect on other platforms.
callPackage =
pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage;
in rec {
packages.default = callPackage ./. {
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
};
devShells.default = callPackage ./shell.nix {
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
inherit pre-commit-hooks;
inherit devShellPackages;
};
packages.container = pkgs.callPackage ./containers/service.nix {
package = packages.default;
};
packages.container-ci = pkgs.callPackage ./containers/ci.nix {
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
inherit myPackages;
};
}));
}