-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a flake.nix which can be used to build and retrieve `juliaup` from the nix package manager. It uses the `rustPlatform.buildRustPackage` function from nixpkgs to build the Rust package, and the 23.11 pkg distribution. Nix makes it easy to build and install `juliaup`, either by running `nix build` or `nix run` in the project directory or by referencing the flake from another nix configuration.
- Loading branch information
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
description = "Julia installer and version multiplexer"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); | ||
version = cargoToml.package.version; | ||
buildInputs = with pkgs; [ | ||
openssl | ||
] ++ (if pkgs.stdenv.isDarwin then [ | ||
darwin.apple_sdk.frameworks.SystemConfiguration | ||
] else []); | ||
in { | ||
packages.juliaup = pkgs.rustPlatform.buildRustPackage { | ||
pname = "juliaup"; | ||
inherit version; | ||
|
||
src = ./.; | ||
|
||
cargoLock = { | ||
lockFile = ./Cargo.lock; | ||
}; | ||
|
||
nativeBuildInputs = with pkgs; [ | ||
pkg-config | ||
]; | ||
|
||
inherit buildInputs; | ||
|
||
doCheck = false; # Disable tests | ||
|
||
meta = with pkgs.lib; { | ||
description = "Julia installer and version multiplexer"; | ||
homepage = "https://github.com/JuliaLang/juliaup"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ sjkelly ]; | ||
}; | ||
}; | ||
|
||
defaultPackage = self.packages.${system}.juliaup; | ||
|
||
apps.juliaup = flake-utils.lib.mkApp { | ||
drv = self.packages.${system}.juliaup; | ||
}; | ||
|
||
defaultApp = self.apps.${system}.juliaup; | ||
} | ||
); | ||
} |