46 lines
1.0 KiB
Nix
46 lines
1.0 KiB
Nix
|
{
|
||
|
description = "A flake to compile Zig code from GitHub";
|
||
|
|
||
|
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 = import nixpkgs { inherit system; };
|
||
|
|
||
|
# Replace with the actual GitHub repository URL and revision
|
||
|
src = pkgs.fetchgit {
|
||
|
url= "https://git.lerch.org/lobo/clipboard.git";
|
||
|
rev= "master";
|
||
|
sha256 = "";
|
||
|
};
|
||
|
|
||
|
in {
|
||
|
packages.default = pkgs.stdenv.mkDerivation {
|
||
|
pname = "zig-project";
|
||
|
version = "0.1.0";
|
||
|
|
||
|
inherit src;
|
||
|
|
||
|
nativeBuildInputs = [ pkgs.zig ];
|
||
|
|
||
|
buildPhase = ''
|
||
|
zig build
|
||
|
'';
|
||
|
|
||
|
installPhase = ''
|
||
|
mkdir -p $out/bin
|
||
|
cp zig-out/bin/* $out/bin/
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
devShells.default = pkgs.mkShell {
|
||
|
buildInputs = [ pkgs.zig ];
|
||
|
};
|
||
|
}
|
||
|
);
|
||
|
}
|