-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
78 lines (74 loc) · 1.88 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
76
77
78
{
description = "DockDNS";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
...
}: let
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
devShells = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
unstable = nixpkgs-unstable.legacyPackages.${system};
in {
default = pkgs.mkShell {
packages = with pkgs;
[
go
golangci-lint
air
gopls
gotools
delve
]
++ (with unstable; [
templ
]);
};
});
packages =
forAllSystems
(system: let
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
in rec {
default = dockdns;
dockdns = pkgs.buildGoModule {
name = "dockdns";
version = toString (self.shortRev or self.dirtyShortRev or self.lastModified or "unknown");
buildInputs = nixpkgs.lib.lists.optionals pkgs.stdenv.isDarwin [pkgs.darwin.apple_sdk.frameworks.AppKit];
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./go.mod
./go.sum
./main.go
./internal
./templates
./static
];
};
vendorHash = "sha256-QFlT4k2cnV6jJzNBtsSS29WIXcEjkB2De2LYu/niOQI=";
meta.mainProgram = "dockdns";
};
dockdns-docker = pkgs.dockerTools.buildImage {
name = "dockdns";
config = {
Cmd = ["${lib.getExe dockdns}"];
};
};
});
};
}