readme update; nix flake; hints on how to run.

This commit is contained in:
silky 2023-06-29 10:59:38 +01:00 committed by Noon van der Silk
parent fe57e2e606
commit 5384b0cb88
5 changed files with 155 additions and 1 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
.spago/
output/
node_modules/
.psci_modules
# Nix
.direnv/

View File

@ -43,7 +43,7 @@ instance graphqlReactFinlandConference ::
}
)
client :: GraphQLClient
client :: GraphQLClientAff
client = graphQL "https://api.react-finland.fi/graphql" [] driver
main ∷ Effect Unit
@ -57,3 +57,40 @@ main =
```
You can check out the [test](./test/Main.purs) for a full example.
## Development
You can either use the nix shell, or the npm package.
### Nix shell
Having set up [flakes](https://nixos.wiki/wiki/Flakes), either using [direnv](https://direnv.net/) (`direnv allow`) or `nix develop`
Buliding:
```
spago build
```
Testing:
```
spago -x test.dhall test
```
### Npm
Just run `npm i` and then:
Building:
```
spago build
```
Testing:
```
npm run test
```

61
flake.lock Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"easy-purescript-nix": {
"flake": false,
"locked": {
"lastModified": 1686900973,
"narHash": "sha256-9whTjp8BYy8ZzyghhgbawS06/dVESduME3wsdNH/mpk=",
"owner": "justinwoo",
"repo": "easy-purescript-nix",
"rev": "8cf400656945b2f2bacfd6a8775792aa701f60e9",
"type": "github"
},
"original": {
"owner": "justinwoo",
"repo": "easy-purescript-nix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687829761,
"narHash": "sha256-QRe1Y8SS3M4GeC58F/6ajz6V0ZLUVWX3ZAMgov2N3/g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9790f3242da2152d5aa1976e3e4b8b414f4dd206",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"easy-purescript-nix": "easy-purescript-nix",
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

51
flake.nix Normal file
View File

@ -0,0 +1,51 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
easy-purescript-nix = {
url = "github:justinwoo/easy-purescript-nix";
flake = false;
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, easy-purescript-nix, ... }@inputs:
let
name = "purescript-graphql-fundeps";
supportedSystems = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in
{
devShell = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
easy-ps = import easy-purescript-nix { inherit pkgs; };
in
pkgs.mkShell {
inherit name;
buildInputs = (with pkgs; [
nodejs_20
nixpkgs-fmt
]) ++ (with easy-ps; [
purs
purs-tidy
psa
spago
purescript-language-server
]) ++ (pkgs.lib.optionals (system == "aarch64-darwin")
(with pkgs.darwin.apple_sdk.frameworks; [
Cocoa
CoreServices
]));
});
};
}