mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-08-02 22:55:37 +00:00

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
31 lines
716 B
Nix
31 lines
716 B
Nix
{
|
|
# 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 "
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|