-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
72 lines (61 loc) · 2.29 KB
/
flake.nix
File metadata and controls
72 lines (61 loc) · 2.29 KB
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
{
description = "ansilust - next-generation text art processing";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
version = "0.0.1";
# Map Nix systems to release artifact names
systemToReleaseArch = {
"x86_64-linux" = "linux-x64-gnu";
"aarch64-linux" = "linux-arm64-gnu";
"x86_64-darwin" = "darwin-x64";
"aarch64-darwin" = "darwin-arm64";
};
releaseArch = systemToReleaseArch.${system};
in {
packages = {
default = pkgs.stdenv.mkDerivation {
pname = "ansilust";
inherit version;
# Download pre-built binary from GitHub releases
src = pkgs.fetchurl {
url = "https://github.com/effect-native/ansilust/releases/download/v${version}/ansilust-${releaseArch}.tar.gz";
# Placeholder checksum - will be updated by release script
sha256 = "PLACEHOLDER_CHECKSUM_${releaseArch}";
};
# No build needed - we're using pre-compiled binaries
phases = [ "unpackPhase" "installPhase" ];
unpackPhase = ''
mkdir -p $out/bin
tar -xzf $src -C $out/bin --strip-components=1
'';
installPhase = ''
# Binary should be in place from unpackPhase
test -f $out/bin/ansilust || exit 1
chmod +x $out/bin/ansilust
'';
meta = with pkgs.lib; {
description = "Next-generation text art processing system";
homepage = "https://github.com/effect-native/ansilust";
license = licenses.mit;
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
mainProgram = "ansilust";
};
};
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
zig
nodejs
gnumake
pkg-config
];
};
}
);
}