Skip to content
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

nix flake update #88

Merged
merged 2 commits into from
Sep 24, 2023
Merged
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
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,16 @@ stack.yaml
example/**/*.js

.direnv
result
result


bower_components/
node_modules/
.pulp-cache/
output/
generated-docs/
.psc-package/
.psc*
.purs*
.psa*
.spago
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
purescript-bridge.cabal
example/example.cabal
.
example/.
10 changes: 0 additions & 10 deletions example/.gitignore

This file was deleted.

87 changes: 73 additions & 14 deletions flake.lock

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

60 changes: 37 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,62 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:nixos/nixpkgs/haskell-updates";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
flake-root.url = "github:srid/flake-root";
purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
purescript-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
outputs = inputs@{ self, nixpkgs, haskell-flake, flake-root, flake-parts, purescript-overlay }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
# systems = ["x86_64-linux" "x86_64-darwin"];
imports = [ inputs.haskell-flake.flakeModule ];
imports = [
haskell-flake.flakeModule
flake-root.flakeModule
];

perSystem = { self', pkgs, ... }: {
perSystem = { self', pkgs, system, config,... }: {

haskellProjects.default = {

packages = {
purescript-bridge.root = ./.;
example.root = ./example;
};
# https://flake.parts/overlays#consuming-an-overlay
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
purescript-overlay.overlays.default
];
};

haskellProjects.default = {
basePackages = pkgs.haskellPackages;

# Dependency overrides go here. See https://haskell.flake.page/dependency
# source-overrides = { };
# overrides = self: super: { };

devShell = {
enable = true;

mkShellArgs = {
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.zlib.out}/lib:LD_LIBRARY_PATH
'';
};

tools = hp: {
inherit (pkgs)
purescript
spago
tools = haskellPackages: {
inherit (haskellPackages)
zlib;
};

hlsCheck.enable = false;
};

# exclude devShell, fixes duplicate definition
autoWire = [ "packages" "apps" "checks" ];
};

devShells.default = pkgs.mkShell {
inputsFrom = [
config.haskellProjects.default.outputs.devShell
];
buildInputs = [
pkgs.hello
pkgs.purs
pkgs.spago
pkgs.purs-tidy-bin.purs-tidy-0_10_0
pkgs.purs-backend-es
pkgs.purescript-language-server
];
};

packages.default = self'.packages.example;
Expand Down
23 changes: 23 additions & 0 deletions spago.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ name = "purescript-bridge-example"
, dependencies =
[ "console"
, "effect"
, "foreign-generic"
, "profunctor-lenses"
, "aff"
, "affjax"
, "affjax-web"
, "argonaut-aeson-generic"
, "ordered-collections"
, "argonaut-codecs"
, "argonaut-generic"
, "either"
, "foldable-traversable"
, "foreign-object"
, "maybe"
, "newtype"
, "prelude"
]
, packages = ./example/packages.dhall
, sources = [ "example/src/**/*.purs", "example/test/**/*.purs" ]
}
Loading