From 52fc07062e41d9b9c00edf7e48187bd4058cdb93 Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Fri, 11 Apr 2025 01:11:46 +0200 Subject: init --- flake.nix | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ac2e3a4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + description = "Lean 4 Example Project"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + lean4-nix = { + url = "github:lenianiva/lean4-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ { + nixpkgs, + flake-parts, + lean4-nix, + ... + }: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = [ + "aarch64-darwin" + "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + + perSystem = { + system, + pkgs, + ... + }: { + _module.args.pkgs = import nixpkgs { + inherit system; + overlays = [(lean4-nix.readToolchainFile ./lean-toolchain)]; + }; + + packages.default = + (pkgs.lean.buildLeanPackage { + name = "Example"; + roots = ["Main"]; + src = pkgs.lib.cleanSource ./.; + }) + .executable; + + devShells.default = pkgs.mkShell { + packages = with pkgs.lean; [lean lean-all]; + }; + }; + }; +} -- cgit 1.4.1