-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
60 lines (53 loc) · 1.29 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
{
nixConfig = {
extra-substituters = "https://modupdate.cachix.org";
extra-trusted-public-keys = "modupdate.cachix.org-1:1gFM53SV2wsCnKk8nUVnuk23vu6PcXkyeAUN0p4Y4+M=";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: let
# Systems supported
allSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
# Helper to provide system-specific attributes
forAllSystems = f:
nixpkgs.lib.genAttrs allSystems (system:
f {
pkgs = import nixpkgs {inherit system;};
});
in {
# Development environment output
devShells = forAllSystems ({pkgs}: {
default = pkgs.mkShell {
# The Nix packages provided in the environment
packages = with pkgs; [
go_1_21
go-tools
gopls
delve
gomodifytags
];
};
});
packages =
forAllSystems
({pkgs}: rec {
default = pkgs.callPackage ./modupdate.nix {};
modupdate = default;
container = pkgs.callPackage ./container.nix {
modupdate = default;
};
});
overlays.default = final: prev: {
inherit (self.packages.${final.system}) modupdate;
};
};
}