-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
59 lines (55 loc) · 1.53 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
{
description = "Star Sailor";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
gomod2nix.url = "github:nix-community/gomod2nix";
};
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
flake-utils.lib.eachSystem ["x86_64-linux"] (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlays.default ];
};
in rec {
packages.starsail = pkgs.buildGoApplication {
pname = "wanderer.starsail";
version = "0.1.0";
pwd = ./starsail/.;
src = ./starsail/.;
subPackages = [ "." ];
allowGoReference = true;
modules = ./starsail/gomod2nix.toml;
};
packages.containerStarsail = pkgs.dockerTools.buildImage {
name = "wanderer.starsail";
tag = "0.1.0";
created = "now";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [packages.wanderer];
pathsToLink = ["/bin"];
};
config = {
Cmd = ["${packages.wanderer}/bin/wanderer.starsail"];
ExposedPorts = {"80/tcp" = { }; "443/tcp" = { }; };
};
};
devShell = pkgs.mkShell {
packages = with pkgs; [
git
jq
nixpkgs-fmt
go
pkgs.gomod2nix
gopls
delve
];
shellHook = ''
export DEV=1
'';
};
}
);
}