~yoctocell/flaskell

242ac34bf55bbdf0ca58544246362a3df02ae9ce — yoctocell 1 year, 9 months ago ea2559d
default.nix: Rewrite
4 files changed, 22 insertions(+), 41 deletions(-)

M README.md
M default.nix
M flake.nix
M flaskell.cabal
M README.md => README.md +6 -12
@@ 1,20 1,14 @@
# Flaskell
[![Built with Nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)

A CLI flashcard application written in Haskell

# Features
A CLI flashcard application written in Haskell.

# Installation
## Stack
## Nix
### Flake.nix
### Nix-build
### NUR
If you have nix flakes enabled, just run.

```sh
nix build
```

# TODO
- Screenshot
- Better looking UI
- Command line args
  - Specify markdown/org heading
  - Take stdin

M default.nix => default.nix +14 -24
@@ 1,38 1,28 @@
{ sources ? import ./nix/sources.nix
, pkgs ? import sources.nixpkgs
, compiler ? "ghc884"
}:
let
  flaskellOverlay = final: prev: rec {
    haskellPackages = prev.haskellPackages.override {
      packageOverrides = hfinal: hprev: {
        flaskell = hprev.callCabal2nix "flaskell" ./. { };
      };
  haskellPackages = pkgs.haskell.packages.${compiler}.override {
    overrides = hpNew: hpOld: {
      flaskell = hpNew.callCabal2nix "flaskell" ./. { };
    };
  };

  myEnv = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
    # ansi-terminal
    optparse-applicative
    base
    cabal-install
    regex
  ]);

  flaskell = haskellPackages.flaskell;
in
{
  flaskell = pkgs.haskellPackages.callCabal2nix "flaskell" ./. { };
  inherit flaskell;

  flaskellOverlay = final: prev: rec {
    haskellPackages = prev.haskellPackages.override {
      packageOverrides = hfinal: hprev: {
        flaskell = hprev.callCabal2nix "flaskell" ./. { };
      };
    };
  };
  flaskellShell = haskellPackages.shellFor {
    packages = p: with p; [
      flaskell
    ];

  flaskellShell = pkgs.mkShell {
    buildInputs = [
      myEnv
    buildInputs = with haskellPackages; [
      brittany
      cabal-install
      flaskell
    ];
  };


M flake.nix => flake.nix +1 -5
@@ 15,11 15,7 @@
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in
      rec
      {
        overlays.flaskell = (import ./. { inherit pkgs; }).flaskellOverlay;
        overlay = overlays.flaskell;

      rec {
        packages.flaskell = (pkgs.callPackage ./. { inherit pkgs; }).flaskell;
        defaultPackage = packages.flaskell;


M flaskell.cabal => flaskell.cabal +1 -0
@@ 25,6 25,7 @@ library
  build-depends:   base >=4.7 && <5
                 , optparse-applicative >= 0.15.0.0
                 , regex >=1.1.0.0
                 , bytestring >=0.10.10.0
                 -- , ansi-terminal >=0.11
  default-language: Haskell2010