Added Flake

Nix flake that can be launched with the command "nix develop" which
creates a development environment with the unstable version of Zig
installed. This flake is essential for NixOS users like me :P
This commit is contained in:
Voxi0 2024-12-25 13:08:44 +00:00
parent 5ed3af57ee
commit 239ffce5a7

30
flake.nix Normal file
View File

@ -0,0 +1,30 @@
{
# Flake dependencies
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
zig.url = "github:mitchellh/zig-overlay";
};
# Flake actions/outputs
outputs = { flake-utils, nixpkgs, zig, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(_: _: {
zigpkgs = zig.packages.${system};
})
];
};
in with pkgs; {
devShells.default = mkShell {
buildInputs = [ zigpkgs.master ];
shellHook = ''
# Change bash shell prompt
export PS1="\w "
'';
};
}
);
}