vidzig/flake.nix

54 lines
1.3 KiB
Nix
Raw Normal View History

2024-02-23 18:42:31 +01:00
{
description = "Video download server in Zig.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, nixpkgs
, utils
,
}: utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages.default = pkgs.stdenv.mkDerivation {
name = "vidzig";
src = ./.;
dontConfigure = true;
dontFixup = true;
2024-06-21 19:34:16 +02:00
nativeBuildInputs = with pkgs; [ zig_0_13.hook haxe ];
2024-02-23 18:42:31 +01:00
postPatch = ''
2024-05-05 18:38:44 +02:00
runHook prePostPatch
2024-02-23 18:42:31 +01:00
mkdir -p $ZIG_GLOBAL_CACHE_DIR
ln -s ${pkgs.callPackage ./deps.nix { }} $ZIG_GLOBAL_CACHE_DIR/p
2024-05-05 18:38:44 +02:00
runHook postPostPatch
2024-02-23 18:42:31 +01:00
'';
};
2024-02-26 18:10:33 +01:00
devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
2024-05-05 18:38:44 +02:00
buildInputs = with pkgs; [
zig
haxe
2024-02-26 18:10:33 +01:00
];
shellHook = ''
echo Welcome to the Vidzig dev shell!
echo build with \'zig build\'
echo run the server with \'zig run-server\'
echo run vzctl with \'zig run-cli\'
'';
};
2024-02-23 18:42:31 +01:00
}) //
{
nixosModules.default = import ./nixos/vidzig.nix self;
};
}