-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added nix flake files * added nix installation * added install * added default.nix * added installPhase * Renamed Build to Nix * changed cubical derivation * added FinWeak * added more indentation * removed useless {n} * added more indentation * added agdaWithCubical in flake.nix * removed unnecessary FinWeak * added nix flake in install.md * changed CI to master * changed name to nix flakes instructions * improved nix flakes * nixpkgs is referred to nixos-22.05 * changed defaultPackage to default * updated flake.nix * added install.md instruction * updated nix flakes * changed to flake-compat
- Loading branch information
1 parent
0420f86
commit 9118909
Showing
6 changed files
with
184 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,18 @@ | ||
name: Nix | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
paths: | ||
- '**.nix' | ||
- 'flake.lock' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v17 | ||
- name: Build | ||
run: nix build -v --print-build-logs |
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
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,10 @@ | ||
(import | ||
( | ||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) | ||
{ src = ./.; } | ||
).defaultNix |
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,54 @@ | ||
{ | ||
description = "Cubical Agda"; | ||
|
||
inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
inputs.flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
|
||
outputs = { self, flake-compat, flake-utils, nixpkgs }: | ||
let | ||
inherit (nixpkgs.lib) cleanSourceWith hasSuffix; | ||
overlay = final: prev: { | ||
cubical = final.agdaPackages.mkDerivation rec { | ||
pname = "cubical"; | ||
version = "0.4"; | ||
|
||
src = cleanSourceWith { | ||
filter = name: type: | ||
!(hasSuffix ".nix" name) | ||
; | ||
src = ./.; | ||
}; | ||
|
||
|
||
LC_ALL = "C.UTF-8"; | ||
|
||
# The cubical library has several `Everything.agda` files, which are | ||
# compiled through the make file they provide. | ||
nativeBuildInputs = [ final.ghc ]; | ||
buildPhase = '' | ||
make | ||
''; | ||
meta = { | ||
description = "An experimental library for Cubical Agda"; | ||
homepage = "https://github.com/agda/cubical"; | ||
license = "MIT License"; | ||
}; | ||
}; | ||
agdaWithCubical = final.agdaPackages.agda.withPackages [final.cubical]; | ||
}; | ||
overlays = [ overlay ]; | ||
in | ||
{ overlays.default = overlay; } // | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let pkgs = import nixpkgs { inherit system overlays; }; | ||
in rec { | ||
packages = with pkgs; rec { | ||
inherit cubical agdaWithCubical; | ||
default = cubical; | ||
}; | ||
}); | ||
} |