-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
71 lines (60 loc) · 1.6 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
gomod2nix.url = "github:nix-community/gomod2nix";
gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
gomod2nix.inputs.flake-utils.follows = "flake-utils";
prettier-gohtml-nix.url = "github:diamondburned/prettier-gohtml-nix";
prettier-gohtml-nix.inputs.nixpkgs.follows = "nixpkgs";
prettier-gohtml-nix.inputs.flake-utils.follows = "flake-utils";
prettier-gohtml-nix.inputs.flake-compat.follows = "flake-compat";
};
outputs =
{
self,
nixpkgs,
flake-utils,
flake-compat,
gomod2nix,
prettier-gohtml-nix,
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system}.extend (self: super: {
go = super.go_1_22;
prettier-gohtml-nix = prettier-gohtml-nix.packages.${system}.default;
});
buildGoApplication = gomod2nix.legacyPackages.${system}.buildGoApplication;
gomod2nixTool = gomod2nix.packages.${system}.default.override {
inherit (pkgs) go;
};
in
with pkgs; {
packages.default = buildGoApplication {
inherit (pkgs) go;
name = "fullyhacks-qrms";
pwd = ./.;
src = ./.;
modules = ./gomod2nix.toml;
subPackages = [ "." ];
preBuild = "go generate ./...";
nativeBuildInputs = [
sqlc
gomod2nixTool
];
};
devShell = mkShell {
packages = [
go
gopls
go-tools
sqlc
gomod2nixTool
pkgs.prettier-gohtml-nix
];
};
}
);
}