summaryrefslogtreecommitdiff
path: root/common/templates/zig/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'common/templates/zig/flake.nix')
-rw-r--r--common/templates/zig/flake.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/common/templates/zig/flake.nix b/common/templates/zig/flake.nix
new file mode 100644
index 0000000..26bb8f1
--- /dev/null
+++ b/common/templates/zig/flake.nix
@@ -0,0 +1,46 @@
+{
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+
+ outputs =
+ {
+ self,
+ nixpkgs,
+ ...
+ }:
+ let
+ inherit (nixpkgs) lib;
+ forAllSystems = lib.genAttrs lib.systems.flakeExposed;
+ in
+ {
+ packages = forAllSystems (
+ system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in
+ {
+ default = pkgs.stdenv.mkDerivation {
+ pname = "hello_zig";
+ version = "0.1.0";
+ src = self;
+
+ nativeBuildInputs = [ pkgs.zig.hook ];
+ };
+ }
+ );
+
+ devShells = forAllSystems (
+ system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in
+ {
+ default = pkgs.mkShellNoCC {
+ packages = [
+ pkgs.zig
+ pkgs.zls
+ ];
+ };
+ }
+ );
+ };
+}