mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-08-02 22:55:37 +00:00
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:
parent
5ed3af57ee
commit
239ffce5a7
30
flake.nix
Normal file
30
flake.nix
Normal 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 "
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user