Skip to content

Commit

Permalink
add scala template
Browse files Browse the repository at this point in the history
  • Loading branch information
piq9117 committed Feb 23, 2024
1 parent 9770179 commit 0a110d6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
path = ./react-js-template;
description = "React JS Template";
};

scala = {
path = ./scala-template;
description = "Scala Template";
};
};
};
}
33 changes: 33 additions & 0 deletions scala-template/flake.nix
Original file line number Diff line number Diff line change
@@ -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❄ '
'';
};
});
};
}

0 comments on commit 0a110d6

Please sign in to comment.