mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 05:26:59 +01:00
Initial commit
This commit is contained in:
commit
ed71df15f3
7 changed files with 218 additions and 0 deletions
48
flake.nix
Normal file
48
flake.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, flake-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
mill = pkgs.mill.overrideAttrs (old: rec {
|
||||
version = "1.0.2";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://repo1.maven.org/maven2/com/lihaoyi/mill-dist-native-linux-amd64/${version}/mill-dist-native-linux-amd64-${version}.exe";
|
||||
hash = "sha256-+jRVJDxpH9DONuar+1CqB0Yl6thAuTn7dJYqOEsebGU=";
|
||||
};
|
||||
buildInputs = [ pkgs.zlib ];
|
||||
nativeBuildInputs = [
|
||||
pkgs.makeWrapper
|
||||
]
|
||||
++ pkgs.lib.optional pkgs.stdenvNoCC.isLinux pkgs.autoPatchelfHook;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm 555 $src $out/bin/.mill-wrapped
|
||||
# can't use wrapProgram because it sets --argv0
|
||||
makeWrapper $out/bin/.mill-wrapped $out/bin/mill \
|
||||
--prefix PATH : "${pkgs.jre}/bin" \
|
||||
--set-default JAVA_HOME "${pkgs.jre}"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
doInstallCheck = false;
|
||||
});
|
||||
in
|
||||
{
|
||||
devShell = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
mill
|
||||
pkgs.scalafmt
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue