From 0a110d6e7664464266afefaa811c0a5723e7cf37 Mon Sep 17 00:00:00 2001 From: piq9117 Date: Fri, 23 Feb 2024 17:17:25 -0500 Subject: [PATCH] add scala template --- README.md | 5 +++++ flake.nix | 5 +++++ scala-template/flake.nix | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 scala-template/flake.nix diff --git a/README.md b/README.md index 5870ca3..9ff7f3f 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,8 @@ nix flake init -t "github:piq9117/nix-templates#react-ts" ``` sh nix flake init -t "github:piq9117/nix-templates#react-js" ``` + +# Scala +```sh +nix flake init -t "github:piq9117/nix-templates#scala" +``` diff --git a/flake.nix b/flake.nix index 02076e3..6bd4ee3 100644 --- a/flake.nix +++ b/flake.nix @@ -43,6 +43,11 @@ path = ./react-js-template; description = "React JS Template"; }; + + scala = { + path = ./scala-template; + description = "Scala Template"; + }; }; }; } diff --git a/scala-template/flake.nix b/scala-template/flake.nix new file mode 100644 index 0000000..4aa10eb --- /dev/null +++ b/scala-template/flake.nix @@ -0,0 +1,33 @@ +{ + description = "A basic scala flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = {self, nixpkgs}: + let + supportedSystems = ["x86_64-linux"]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); + nixpkgsFor = forAllSystems(system: import nixpkgs { + inherit system; + overlays = [self.overlay]; + }); + in { + overlay = final: prev: {}; + devShells = forAllSystems(system: + let + pkgs = nixpkgsFor.${system}; + in { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + sbt + metals + ]; + shellHook = '' + export PS1='[$PWD]\n❄ ' + ''; + }; + }); + }; +}