Skip to content

Add Nix flake support #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: golang
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ core-tests/full-core-docs.md
.psc-ide-port
.vscode/
result

/.direnv/

!.gitignore
33 changes: 11 additions & 22 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
let
haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) {};
nixpkgsSrc = haskellNix.sources.nixpkgs-1903; # has hsc2hs-0.68.4

hsc2hsOverlay = self: super: {
buildPackages = super.buildPackages // {
hsc2hs = super.haskellPackages.hsc2hs;
};
};

nixpkgsArgs = haskellNix.nixpkgsArgs // {
overlays = haskellNix.nixpkgsArgs.overlays ++ [ hsc2hsOverlay ];
};
in
{ pkgs ? import nixpkgsSrc nixpkgsArgs
}:

pkgs.haskell-nix.stackProject {
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "purescript-native";
(
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
345 changes: 345 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading