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

would love to see purescript-psa added #102

Closed
Benjmhart opened this issue Mar 17, 2020 · 3 comments · Fixed by #129
Closed

would love to see purescript-psa added #102

Benjmhart opened this issue Mar 17, 2020 · 3 comments · Fixed by #129
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Benjmhart
Copy link

since my primary usecase is for CI pipelines, would love to see purescript-psa added as I'm using it for catching compiler warnings and turning them into errors

@justinwoo
Copy link
Owner

You might try doing this with a similar setup to pscid: https://github.com/justinwoo/easy-purescript-nix/tree/master/pscid

@justinwoo justinwoo added help wanted Extra attention is needed enhancement New feature or request labels Mar 19, 2020
@Benjmhart
Copy link
Author

I actually might try and tackle this issue in the next few weeks then

@toastal
Copy link
Contributor

toastal commented Jan 13, 2021

This seems to be working for me

# shell.nix
let
  easy-ps-src =
    (pkgs.fetchFromGitHub {
      owner = "justinwoo";
      repo = "easy-purescript-nix";
      rev = "c8c32741bc09e2ac0a94d5140cf51fa5de809e24";
      sha256 = "0rn938nbxqsd7lp7l8z1y7bhzaq29vbziq6hq9llb3yh9xs10lmf";
    });

  easy-ps = import easy-ps-src { inherit pkgs; };

  our_pscid = import "${easy-ps-src}/pscid" {
    inherit pkgs;
    nodejs = pkgs.nodejs-14_x;
  };

  our_purescript-psa =
    let
      nodeEnv = import "${easy-ps-src}/pscid/node-env.nix" {
        inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
        nodejs = pkgs.nodejs-14_x;
        libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
      };

      args = (import "${easy-ps-src}/pscid/node-packages.nix" {
        inherit (pkgs) fetchurl fetchgit;
        inherit nodeEnv;
      }
      ).args;

      npmPackage = builtins.fetchTarball {
        url = "https://registry.npmjs.org/purescript-psa/-/purescript-psa-0.8.0.tgz";
        sha256 = "0hn2m8wjl7mcvv4b7nzfva0b1657pg5k2z51xsyc8jc60fqnilhf";
      };
    in nodeEnv.buildNodePackage (args // { src = npmPackage; });
in pkgs.mkShell {
  # ...
  nativeBuildInputs = [
    easy-ps.purs-0_13_8
    easy-ps.psc-package
    easy-ps.purty
    easy-ps.spago
    easy-ps.zephyr
    our_pscid
    our_purescript-psa
  ];
  # ...
}

revised:

let
  nodejs = pkgs.nodejs-14_x;

  # pulling apart the src so that we can override the NodeJS version
  # commit for PR #129
  easy-ps-src = pkgs.fetchFromGitHub {
    owner = "toastal"; # "justinwoo";
    repo = "easy-purescript-nix";
    rev = "5840355396977eb0bd0192afb74aff5186f33435";
    sha256 = "0fd0f90bxgsd9hznyx1cl62b89564nfh195f1h8vidrh05gg5k8l";
  };

  easy-ps = import easy-ps-src { inherit pkgs; } // {
    psa = import "${easy-ps-src}/psa" { inherit pkgs nodejs; };
    pscid = import "${easy-ps-src}/pscid" { inherit pkgs nodejs; };
  };
in pkgs.mkShell {
  # ...
  nativeBuildInputs = [
    nodejs
    easy-ps.purs-0_13_8
    easy-ps.psc-package
    easy-ps.purty
    easy-ps.spago
    easy-ps.zephyr
    easy-ps.psa
    easy-ps.pscid
  ];
  # ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants