anzi/flake.nix
2024-01-12 21:39:57 -06:00

62 lines
1.3 KiB
Nix

{
description = "zig-ansi";
inputs = {
nixpkgs = {
url = "nixpkgs/nixos-unstable";
};
flake-utils = {
url = "github:numtide/flake-utils";
};
make-shell = {
url = "github:ursi/nix-make-shell";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem
(
system: let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells.default = let
project = "zig-ansi";
make-shell = import inputs.make-shell {
inherit system;
pkgs = pkgs;
};
in
make-shell {
packages = [
pkgs.zon2nix
pkgs.zig_0_11
pkgs.zls
];
env = {
NIX_PROJECT = project;
};
};
packages = {
zig-ansi = pkgs.stdenv.mkDerivation {
name = "zig-ansi";
src = ./.;
nativeBuildInputs = [
pkgs.zig_0_11.hook
];
postPatch = ''
ln -s ${pkgs.callPackage ./deps.nix {}} $ZIG_GLOBAL_CACHE_DIR/p
'';
dontStrip = true;
};
};
}
);
}