diff --git a/templates/all.nix b/templates/all.nix index d9b0387..5af51b6 100644 --- a/templates/all.nix +++ b/templates/all.nix @@ -19,4 +19,8 @@ path = ./godot; description = "A template for working on a Godot game or project"; }; + nim = { + path = ./nim; + description = "A template for working on a Nim project"; + }; } diff --git a/templates/nim/.envrc b/templates/nim/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/templates/nim/.envrc @@ -0,0 +1 @@ +use flake diff --git a/templates/nim/.gitignore b/templates/nim/.gitignore new file mode 100644 index 0000000..6abfe1b --- /dev/null +++ b/templates/nim/.gitignore @@ -0,0 +1,2 @@ +/target +/.direnv diff --git a/templates/nim/flake.nix b/templates/nim/flake.nix new file mode 100644 index 0000000..daf4697 --- /dev/null +++ b/templates/nim/flake.nix @@ -0,0 +1,31 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + outputs = { + self, + nixpkgs, + }: let + inherit (self) outputs; + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + + "x86_64-darwin" + "aarch64-darwin" + ]; + forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems; + in { + devShells = forEachSupportedSystem (system: let + pkgs = import nixpkgs {inherit system;}; + in { + nim-dev = pkgs.mkShell { + buildInputs = with pkgs; [ + nim + nimble + nimlangserver + ]; + }; + + default = outputs.devShells.${system}.nim-dev; + }); + }; +}