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

Initial commit of haskell.nix. #656

Open
wants to merge 1 commit into
base: master
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
32 changes: 19 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: test matrix
on:
push:
on:
push:
pull_request:
jobs:
build:
Expand All @@ -17,15 +17,21 @@ jobs:
TARGET: x86_64-unknown-linux-musl
COMPILER: gcc
LINKER: gcc

steps:
- run: echo ${{matrix.TARGET}}
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v10
- uses: cachix/cachix-action@v6
with:
name: miso-haskell
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: echo ${{matrix.os}}
- run: nix-build -A pkgs.yarn default.nix && nix-env -i ./result
- run: nix-build --arg examples true
- run: cd tests && yarn && yarn test
- run: echo ${{matrix.TARGET}}
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v13
with:
nix_path: nixpkgs=channel:nixos-unstable
name: miso-haskell
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://hydra.iohk.io https://cache.nixos.org/
- run: echo ${{matrix.os}}
- run: nix-env -iA cachix -f https://cachix.org/api/v1/install
- run: cachix use miso-haskell
- run: nix-build -A pkgs.yarn default.nix && nix-env -i ./result
- run: nix-build
- run: cd tests && yarn && yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ dist
*.o
*.hi
*.jsexe
/TAGS
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ before_install:
- nix-build -A pkgs.yarn default.nix && nix-env -i ./result

script:
- nix-build --arg examples true
- nix-build -A miso
- cd tests && yarn && yarn test
74 changes: 21 additions & 53 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,58 +1,26 @@
{ haddock ? true
, tests ? false
, examples ? false
, ios ? false
, overlays ? []
, system ? builtins.currentSystem
, crossSystem ? null
, crossOverlays ? []
, allowBroken ? false
, allowUnfree ? true
}:
let
options =
{ inherit
haddock
tests
examples
ios
overlays
system
crossSystem
crossOverlays
allowBroken
allowUnfree;
sources = import ./nix/sources.nix {};
haskellNix = import sources.haskellNix {};
args = haskellNix.nixpkgsArgs // { config.allowUnfree = true; };
pkgs = import haskellNix.sources.nixpkgs-unstable args;
miso = pkgs.haskell-nix.project {
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "miso";
src = ./.;
};
pkgs = import ./nix options;
armPkgs =
with pkgs; with pkgs.lib;
optionalAttrs (options.ios && stdenv.isDarwin)
{ miso-arm = pkgsCross.iphone64.haskell.packages.integer-simple.ghc865.miso; };
release =
with pkgs.haskell.packages.ghc865;
with pkgs.haskell.lib;
sdistTarball (buildStrictly miso);
release-examples =
with pkgs.haskell.packages.ghc865;
with pkgs.haskell.lib;
sdistTarball (buildStrictly miso-examples-jsaddle);
examplePkgs = with pkgs; with pkgs.lib;
let
examplePkgs = optionalAttrs options.examples {
inherit (haskell.packages.ghc865) miso-examples-jsaddle;
inherit (haskell.packages.ghcjs86) miso-examples;
inherit s3;
};
in
examplePkgs //
optionalAttrs (stdenv.isDarwin && options.examples && options.ios)
{ inherit (pkgsCross.iphone64.haskell.packages.integer-simple.ghc865) miso-examples-arm;
};
compiler-nix-name = "ghc8105";
};
examples = pkgs.haskell-nix.project {
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "miso-examples";
src = ./examples;
};
compiler-nix-name = "ghc8105";
};
in
{
inherit pkgs;
miso-ghcjs = pkgs.haskell.packages.ghcjs86.miso;
miso-ghc = pkgs.haskell.packages.ghc865.miso;
inherit (pkgs.haskell.packages.ghc865) miso-jsaddle;
inherit release release-examples;
} // examplePkgs // armPkgs
miso = miso.projectCross.ghcjs.hsPkgs.miso.components.library;
}


8 changes: 2 additions & 6 deletions miso.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ copyright: Copyright (c) 2017-2020 David M. Johnson
bug-reports: https://github.com/dmjio/miso/issues
build-type: Simple
extra-source-files: README.md
cabal-version: >=1.22
cabal-version: 1.22
synopsis: A tasty Haskell front-end framework
description:
Miso is a small, production-ready, "isomorphic" Haskell front-end framework featuring a virtual-dom, recursive diffing / patching algorithm, event delegation, event batching, SVG, Server-sent events, Websockets, type-safe servant-style routing and an extensible Subscription-based subsystem. Inspired by Elm, Redux and Bobril. Miso is pure by default, but side effects (like XHR) can be introduced into the system via the Effect data type. Miso makes heavy use of the GHCJS FFI and therefore has minimal dependencies.
Expand All @@ -20,7 +20,7 @@ extra-source-files:

flag tests
default:
False
True
description:
Builds Miso's tests

Expand Down Expand Up @@ -181,8 +181,6 @@ library
jsbits/delegate.js
jsbits/isomorphic.js
jsbits/util.js
hs-source-dirs:
frontend-src
build-depends:
containers,
scientific,
Expand All @@ -192,8 +190,6 @@ library
else
build-depends:
vector
hs-source-dirs:
backend-src
if impl(ghcjs)
hs-source-dirs:
ghcjs-src
Expand Down
15 changes: 0 additions & 15 deletions nix/default.nix

This file was deleted.

28 changes: 0 additions & 28 deletions nix/haskell/packages/ghc865/default.nix

This file was deleted.

43 changes: 0 additions & 43 deletions nix/haskell/packages/ghcARM/default.nix

This file was deleted.

46 changes: 0 additions & 46 deletions nix/haskell/packages/ghcjs/default.nix

This file was deleted.

67 changes: 0 additions & 67 deletions nix/haskell/packages/source.nix

This file was deleted.

4 changes: 0 additions & 4 deletions nix/nixpkgs.json

This file was deleted.

Loading