This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9aa3ab1
commit 1d32b08
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
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,6 @@ | ||
use_flake() { | ||
watch_file flake.nix | ||
watch_file flake.lock | ||
eval "$(nix print-dev-env)" | ||
} | ||
use flake |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
/build | ||
result* | ||
# Do not lock flake to avoid having to maintain it | ||
flake.lock |
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
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,52 @@ | ||
{ | ||
description = "Lake (Lean Make) is a new build system and package manager for Lean 4."; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05"; | ||
lean = { | ||
url = "github:leanprover/lean4"; | ||
}; | ||
flake-utils = { | ||
url = "github:numtide/flake-utils"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = | ||
{ self | ||
, flake-utils | ||
, nixpkgs | ||
, lean | ||
}: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
packageName = "Lake"; | ||
src = ./.; | ||
leanPkgs = lean.packages.${system}; | ||
project = leanPkgs.buildLeanPackage { | ||
name = packageName; | ||
inherit src; | ||
}; | ||
in | ||
{ | ||
packages.${packageName} = project.lean-package; | ||
packages.lakeProject = project; | ||
|
||
defaultPackage = self.packages.${system}.${packageName}; | ||
|
||
apps.lake = flake-utils.lib.mkApp { | ||
name = "lake"; | ||
drv = project.executable; | ||
}; | ||
|
||
defaultApp = self.apps.${system}.lake; | ||
|
||
# `nix develop` | ||
devShell = pkgs.mkShell { | ||
buildInputs = with pkgs; [ | ||
leanPkgs.lean | ||
]; | ||
}; | ||
}); | ||
} |