tangled
alpha
login
or
join now
tjh.dev
/
core
forked from
tangled.org/core
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
nix: static builds
anirudh.fi
1 year ago
a7c75c2c
bd4d06e8
+20
-10
2 changed files
expand all
collapse all
unified
split
.gitignore
flake.nix
+1
.gitignore
···
3
3
*.db
4
4
.bin/
5
5
appview/pages/static/*
6
6
+
result
6
7
!.gitkeep
+19
-10
flake.nix
···
45
45
};
46
46
47
47
appview = with final;
48
48
-
final.buildGoModule {
48
48
+
final.pkgsStatic.buildGoModule {
49
49
pname = "appview";
50
50
version = "0.1.0";
51
51
src = gitignoreSource ./.;
···
56
56
subPackages = ["cmd/appview"];
57
57
vendorHash = "sha256-QgUPTOgAdKUTg+ztfs194G7pt3/qDtqTMkDRmMECxSo=";
58
58
env.CGO_ENABLED = 1;
59
59
+
stdenv = pkgsStatic.stdenv;
59
60
};
60
60
-
knotserver = with final;
61
61
-
final.buildGoModule {
62
62
-
pname = "knotserver";
63
63
-
version = "0.1.0";
64
64
-
src = gitignoreSource ./.;
65
65
-
subPackages = ["cmd/knotserver"];
66
66
-
vendorHash = "sha256-QgUPTOgAdKUTg+ztfs194G7pt3/qDtqTMkDRmMECxSo=";
67
67
-
env.CGO_ENABLED = 1;
68
68
-
};
61
61
+
62
62
+
knotserver = with final;
63
63
+
final.pkgsStatic.buildGoModule {
64
64
+
pname = "knotserver";
65
65
+
version = "0.1.0";
66
66
+
src = gitignoreSource ./.;
67
67
+
subPackages = ["cmd/knotserver"];
68
68
+
vendorHash = "sha256-QgUPTOgAdKUTg+ztfs194G7pt3/qDtqTMkDRmMECxSo=";
69
69
+
env.CGO_ENABLED = 1;
70
70
+
nativeBuildInputs = with pkgsMusl; [ pkg-config ];
71
71
+
72
72
+
# Add these ldflags for static compilation
73
73
+
ldflags = [ "-s" "-w" "-linkmode external" ''-extldflags "-static -L${pkgsStatic.musl}/lib"'' ];
74
74
+
75
75
+
# Use static stdenv
76
76
+
stdenv = pkgMusl.stdenv;
77
77
+
};
69
78
};
70
79
packages = forAllSystems (system: {
71
80
inherit (nixpkgsFor."${system}") indigo-lexgen appview knotserver;