Last active
October 13, 2022 01:51
-
-
Save sevanspowell/d4110d471e85bc1bfd8fb0f41eddb5b1 to your computer and use it in GitHub Desktop.
Agda NixOS Hacky Setup - Put these in appropriate dirs, cd to plfa dir and nix-shell, launch emacs from there. Thanks Brian McKenna and Isaac Elliot.
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
{ | |
"owner": "NixOS", | |
"repo": "nixpkgs", | |
"rev": "eabe7b845f867e696f8a11be04d47520b3ff4660", | |
"sha256": "068qbrp2fvpn437hwg932hm0pav2m10sj7v0kcj3wp8hsvsv088w" | |
} |
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
{ compiler ? "default" }: | |
self: super: | |
let | |
hsPkgs = if compiler == "default" | |
then super.haskellPackages | |
else super.haskell.packages.${compiler}; | |
hsPkgSources = { | |
agda2html = self.pkgs.fetchFromGitHub { | |
owner = "wenkokke"; | |
repo = "agda2html"; | |
sha256 = "08a6cw9kghylgynqmdfkwf2ggmkd21d6i4f67188138mss38aik6"; | |
rev = "0aece4fb509c3333f2d271789e0a09729ad08754"; | |
}; | |
}; | |
hsPkgsOverlay = hself: hsuper: { | |
agda2html = hself.callCabal2nix "agda2html" "${hsPkgSources.agda2html}" {}; | |
}; | |
in | |
{ | |
haskellPackages = hsPkgs.override (oldArgs: { | |
overrides = | |
self.lib.composeExtensions | |
(oldArgs.overrides or (_: _: {})) | |
(hsPkgsOverlay); | |
}); | |
} |
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
{ }: | |
let | |
inherit (import <nixpkgs> {}) fetchFromGitHub; | |
pin-info = builtins.fromJSON (builtins.readFile ./nixpkgs.json); | |
pin-source = fetchFromGitHub { | |
inherit (pin-info) owner repo rev sha256; | |
}; | |
pkgs = import pin-source { overlays = [ (import ./overlay.nix {}) ]; }; | |
drv = pkgs.agda.mkDerivation(self: { | |
name = "plfa"; | |
src = pkgs.lib.sourceFilesBySuffices ./. [ ".agda" ".lagda" ".agda-lib" "libraries" ]; | |
pathsToLink = [ "/share" "/bin" ]; | |
buildDepends = [ | |
pkgs.ruby | |
pkgs.haskellPackages.Agda | |
pkgs.haskellPackages.agda2html | |
pkgs.AgdaStdlib | |
pkgs.bundler | |
]; | |
}); | |
in | |
if pkgs.lib.inNixShell then drv.env else drv |
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
name: standard-library | |
include: /nix/store/sq1ap8xg0ymk9czdd9q87lhvvbixf34x-agda-stdlib-1.0/share/agda | |
-- Use your own path to agda-stdlib in nix store ^ |
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
plfa | |
standard-library |
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
<PATH TO plfa HERE>/plfa.github.io/plfa.agda-lib | |
<PATH TO plfa HERE>/plfa.github.io/standard-library.agda-lib |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment