-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
33 lines (32 loc) · 1.09 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv.url = "github:cachix/devenv";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.devenv.flakeModule ];
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = { config, lib, pkgs, ... }:
let
cfg = config.devenv.shells.default.languages.go;
goVersion = (lib.versions.major cfg.package.version)
+ (lib.versions.minor cfg.package.version);
buildWithSpecificGo = pkg:
pkg.override {
buildGoModule =
pkgs."buildGo${goVersion}Module".override { go = cfg.package; };
};
in {
devenv.shells.default = {
languages.go.enable = true;
languages.go.package = pkgs.go_1_23;
packages = [
(buildWithSpecificGo pkgs.golangci-lint)
(buildWithSpecificGo pkgs.gofumpt)
];
};
};
};
}