diff --git a/.envrc b/.envrc index 1d953f4..051d09d 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use nix +eval "$(lorri direnv)" diff --git a/.travis.yml b/.travis.yml index a46b0a4..e84a560 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,4 @@ -language: node_js -dist: trusty -sudo: required -node_js: stable +language: nix notifications: email: false -env: - - PATH=$HOME/purescript:$PATH -install: - - TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p') - - wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz - - tar -xvf $HOME/purescript.tar.gz -C $HOME/ - - chmod a+x $HOME/purescript - - npm install -g bower pulp purescript-psa psc-package -script: - - make test -after_success: - - test -n $TRAVIS_TAG && (echo $GITHUB_TOKEN | pulp login) && (yes | pulp publish --no-push) +script: nix-shell --run 'make test' diff --git a/shell.nix b/shell.nix index 37b3ff0..5d34a6a 100644 --- a/shell.nix +++ b/shell.nix @@ -1,16 +1,23 @@ -{ - purescript ? "0.12.4", - nixjs ? fetchTarball "https://github.com/cprussin/nixjs/tarball/release-19.03", - nixpkgs ? -}: +{ sources ? import ./sources.nix }: let - nixjs-overlay = import nixjs { inherit purescript; }; - pkgs = import nixpkgs { overlays = [ nixjs-overlay ]; }; + niv-overlay = self: _: { + niv = self.symlinkJoin { + name = "niv"; + paths = [ sources.niv ]; + buildInputs = [ self.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/niv \ + --add-flags "--sources-file ${toString ./sources.json}" + ''; + }; + }; + pkgs = import sources.nixpkgs { overlays = [ niv-overlay ]; }; in pkgs.mkShell { buildInputs = [ + pkgs.niv pkgs.git pkgs.nodejs pkgs.yarn diff --git a/sources.json b/sources.json new file mode 100644 index 0000000..59e82c1 --- /dev/null +++ b/sources.json @@ -0,0 +1,14 @@ +{ + "nixpkgs": { + "branch": "nixos-19.09", + "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", + "homepage": "https://github.com/NixOS/nixpkgs", + "owner": "NixOS", + "repo": "nixpkgs-channels", + "rev": "b7bbc6d37878ed00b6467b574b02e840279f7d3d", + "sha256": "02q10jgi6m0vak3amb50ifw1pj82i17hs0npdkig7lsp8w3is7jq", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs-channels/archive/b7bbc6d37878ed00b6467b574b02e840279f7d3d.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + } +} diff --git a/sources.nix b/sources.nix new file mode 100644 index 0000000..ba3bafe --- /dev/null +++ b/sources.nix @@ -0,0 +1,12 @@ +let + nivSrc = fetchTarball { + url = "https://github.com/nmattia/niv/tarball/4f038fc598d5494f5d16302270edc61ab2898c79"; + sha256 = "1dwfkd942wisccpsv0kf47abl0n17d9v4zasv4bm8lvy1dhv82ia"; + }; + sources = import "${nivSrc}/nix/sources.nix" { + sourcesFile = ./sources.json; + }; + niv = import nivSrc {}; +in + +niv // sources diff --git a/src/HTTPure/Server.purs b/src/HTTPure/Server.purs index 86b886e..58fea2e 100644 --- a/src/HTTPure/Server.purs +++ b/src/HTTPure/Server.purs @@ -81,7 +81,7 @@ serveSecure' sslOptions options router onStarted = do -- | Given a port number, return a `HTTP.ListenOptions` `Record`. listenOptions :: Int -> HTTP.ListenOptions listenOptions port = - { hostname: "localhost" + { hostname: "0.0.0.0" , port: port , backlog: Maybe.Nothing }