From 4d56c82096791f1628d55d858f5d2f9a7f48e625 Mon Sep 17 00:00:00 2001 From: vieta Date: Fri, 2 Feb 2024 09:35:49 +0100 Subject: [PATCH] vlang --- README.md | 6 ++++++ flake.lock | 6 +++--- flake.nix | 5 +++++ vlang/.envrc | 1 + vlang/flake.lock | 25 +++++++++++++++++++++++++ vlang/flake.nix | 22 ++++++++++++++++++++++ 6 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 vlang/.envrc create mode 100644 vlang/flake.lock create mode 100644 vlang/flake.nix diff --git a/README.md b/README.md index 35a0d90..a22b7f8 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Once your preferred template has been initialized, you can use the provided shel | [Rust] | [`rust`](./rust/) | | [Scala] | [`scala`](./scala/) | | [Shell] | [`shell`](./shell/) | +| [Vlang] | [`vlang`](./shell/) | | [Zig] | [`zig`](./zig/) | ## Template contents @@ -248,6 +249,10 @@ The sections below list what each template includes. In all cases, you're free t - [shellcheck] 0.9.0 +### [`Vlang`](./vlang/) + +- [Vlang] 0.4.4 + ### [`zig`](./zig/) - [Zig] 0.10.1 @@ -358,4 +363,5 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T [virtualenv]: https://pypi.org/project/virtualenv [vulnix]: https://github.com/flyingcircusio/vulnix [yarn]: https://yarnpkg.com +[vlang]: https://vlang.io/ [zig]: https://ziglang.org diff --git a/flake.lock b/flake.lock index 0f56f8b..2ddc5f0 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1689261696, - "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", + "lastModified": 1706683685, + "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 100df82..94778d2 100644 --- a/flake.nix +++ b/flake.nix @@ -201,6 +201,11 @@ description = "Shell script development environment"; }; + vlang = { + path = ./vlang; + description = "Vlang developent environment"; + }; + zig = { path = ./zig; description = "Zig development environment"; diff --git a/vlang/.envrc b/vlang/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/vlang/.envrc @@ -0,0 +1 @@ +use flake diff --git a/vlang/flake.lock b/vlang/flake.lock new file mode 100644 index 0000000..7120fbb --- /dev/null +++ b/vlang/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "revCount": 577948, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.577948%2Brev-97b17f32362e475016f942bbdfda4a4a72a8a652/018d5e85-4e02-7200-b411-d764d60cd44e/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/vlang/flake.nix b/vlang/flake.nix new file mode 100644 index 0000000..134872b --- /dev/null +++ b/vlang/flake.nix @@ -0,0 +1,22 @@ +{ + description = "A Nix-flake-based Vlang development environment"; + + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + outputs = { self, nixpkgs }: + let + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); + in + { + devShells = forEachSupportedSystem ({ pkgs }: { + default = pkgs.mkShell { + packages = with pkgs; [ + vlang + ]; + }; + }); + }; +}