tangled
alpha
login
or
join now
altagos.dev
/
website
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
build with nix
altagos.dev
7 months ago
40b82314
f8ef1e2d
verified
This commit was signed with the committer's
known signature
.
altagos.dev
SSH Key Fingerprint:
SHA256:UbTjEcCZlc6GzQWLCuDK3D//HESWD2xFPkzue9XMras=
+180
3 changed files
expand all
collapse all
unified
split
.gitattributes
flake.lock
flake.nix
+1
.gitattributes
···
1
1
+
* text=auto eol=lf
+95
flake.lock
···
1
1
+
{
2
2
+
"nodes": {
3
3
+
"flake-utils": {
4
4
+
"inputs": {
5
5
+
"systems": "systems"
6
6
+
},
7
7
+
"locked": {
8
8
+
"lastModified": 1731533236,
9
9
+
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
10
10
+
"owner": "numtide",
11
11
+
"repo": "flake-utils",
12
12
+
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
13
13
+
"type": "github"
14
14
+
},
15
15
+
"original": {
16
16
+
"owner": "numtide",
17
17
+
"repo": "flake-utils",
18
18
+
"type": "github"
19
19
+
}
20
20
+
},
21
21
+
"nixpkgs": {
22
22
+
"locked": {
23
23
+
"lastModified": 1754498491,
24
24
+
"narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=",
25
25
+
"owner": "NixOS",
26
26
+
"repo": "nixpkgs",
27
27
+
"rev": "c2ae88e026f9525daf89587f3cbee584b92b6134",
28
28
+
"type": "github"
29
29
+
},
30
30
+
"original": {
31
31
+
"owner": "NixOS",
32
32
+
"ref": "nixos-unstable",
33
33
+
"repo": "nixpkgs",
34
34
+
"type": "github"
35
35
+
}
36
36
+
},
37
37
+
"nixpkgs_2": {
38
38
+
"locked": {
39
39
+
"lastModified": 1754531935,
40
40
+
"narHash": "sha256-Y9qoYxg7waoMhiRhEmG+mDs6Jx2yk5eB7MlGDPMNs8E=",
41
41
+
"owner": "nixos",
42
42
+
"repo": "nixpkgs",
43
43
+
"rev": "41752cc1a38a8c993cf4e92ab8df640803554c7a",
44
44
+
"type": "github"
45
45
+
},
46
46
+
"original": {
47
47
+
"owner": "nixos",
48
48
+
"repo": "nixpkgs",
49
49
+
"type": "github"
50
50
+
}
51
51
+
},
52
52
+
"root": {
53
53
+
"inputs": {
54
54
+
"nixpkgs": "nixpkgs",
55
55
+
"zig2nix": "zig2nix"
56
56
+
}
57
57
+
},
58
58
+
"systems": {
59
59
+
"locked": {
60
60
+
"lastModified": 1681028828,
61
61
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
62
62
+
"owner": "nix-systems",
63
63
+
"repo": "default",
64
64
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
65
65
+
"type": "github"
66
66
+
},
67
67
+
"original": {
68
68
+
"owner": "nix-systems",
69
69
+
"repo": "default",
70
70
+
"type": "github"
71
71
+
}
72
72
+
},
73
73
+
"zig2nix": {
74
74
+
"inputs": {
75
75
+
"flake-utils": "flake-utils",
76
76
+
"nixpkgs": "nixpkgs_2"
77
77
+
},
78
78
+
"locked": {
79
79
+
"lastModified": 1754532129,
80
80
+
"narHash": "sha256-nScPs0Hzm71rXe6H6jVy9Gp+t7MEOQcm3gjAj/L0Qvg=",
81
81
+
"owner": "Cloudef",
82
82
+
"repo": "zig2nix",
83
83
+
"rev": "f656a4a84e2182fb0c99132b214d136ebc087388",
84
84
+
"type": "github"
85
85
+
},
86
86
+
"original": {
87
87
+
"owner": "Cloudef",
88
88
+
"repo": "zig2nix",
89
89
+
"type": "github"
90
90
+
}
91
91
+
}
92
92
+
},
93
93
+
"root": "root",
94
94
+
"version": 7
95
95
+
}
+84
flake.nix
···
1
1
+
{
2
2
+
description = "Zig project flake";
3
3
+
4
4
+
inputs = {
5
5
+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6
6
+
zig2nix.url = "github:Cloudef/zig2nix";
7
7
+
};
8
8
+
9
9
+
outputs = {
10
10
+
nixpkgs,
11
11
+
zig2nix,
12
12
+
...
13
13
+
}: let
14
14
+
flake-utils = zig2nix.inputs.flake-utils;
15
15
+
in (flake-utils.lib.eachDefaultSystem (system: let
16
16
+
# Zig flake helper
17
17
+
# Check the flake.nix in zig2nix project for more options:
18
18
+
# <https://github.com/Cloudef/zig2nix/blob/master/flake.nix>
19
19
+
env = zig2nix.outputs.zig-env.${system} {zig = zig2nix.outputs.packages.${system}.zig-master;};
20
20
+
pkgs = nixpkgs.legacyPackages.${system};
21
21
+
in
22
22
+
with builtins;
23
23
+
with env.pkgs.lib; rec {
24
24
+
# Produces clean binaries meant to be ship'd outside of nix
25
25
+
# nix build .#foreign
26
26
+
packages.foreign = env.package {
27
27
+
src = cleanSource ./.;
28
28
+
29
29
+
# Packages required for compiling
30
30
+
nativeBuildInputs = with pkgs; [dart-sass];
31
31
+
32
32
+
# Packages required for linking
33
33
+
buildInputs = with env.pkgs; [];
34
34
+
35
35
+
# Smaller binaries and avoids shipping glibc.
36
36
+
zigPreferMusl = true;
37
37
+
};
38
38
+
39
39
+
# nix build .
40
40
+
packages.default = packages.foreign.override (attrs: {
41
41
+
# Prefer nix friendly settings.
42
42
+
zigPreferMusl = false;
43
43
+
44
44
+
# Executables required for runtime
45
45
+
# These packages will be added to the PATH
46
46
+
zigWrapperBins = with env.pkgs; [];
47
47
+
48
48
+
# Libraries required for runtime
49
49
+
# These packages will be added to the LD_LIBRARY_PATH
50
50
+
zigWrapperLibs = attrs.buildInputs or [];
51
51
+
});
52
52
+
53
53
+
# For bundling with nix bundle for running outside of nix
54
54
+
# example: https://github.com/ralismark/nix-appimage
55
55
+
# apps.bundle = {
56
56
+
# type = "app";
57
57
+
# program = "${packages.foreign}/bin/master";
58
58
+
# };
59
59
+
60
60
+
# nix run .
61
61
+
apps.default = env.app [] "zig build serve -- \"$@\"";
62
62
+
63
63
+
# nix run .#build
64
64
+
apps.build = env.app [] "zig build \"$@\"";
65
65
+
66
66
+
# nix run .#stylesheet
67
67
+
apps.test = env.app [] "zig build stylesheet -- \"$@\"";
68
68
+
69
69
+
# nix run .#zig2nix
70
70
+
apps.zig2nix = env.app [] "zig2nix \"$@\"";
71
71
+
72
72
+
# nix develop
73
73
+
devShells.default = env.mkShell {
74
74
+
# Packages required for compiling, linking and running
75
75
+
# Libraries added here will be automatically added to the LD_LIBRARY_PATH and PKG_CONFIG_PATH
76
76
+
nativeBuildInputs =
77
77
+
[]
78
78
+
++ packages.default.nativeBuildInputs
79
79
+
++ packages.default.buildInputs
80
80
+
++ packages.default.zigWrapperBins
81
81
+
++ packages.default.zigWrapperLibs;
82
82
+
};
83
83
+
}));
84
84
+
}