Add unicode-data and unicode-data-names to Nix

This commit is contained in:
Paul Brinkmeier 2023-03-01 03:41:39 +01:00
parent 765dde817e
commit c09ae680ba
7 changed files with 35 additions and 3 deletions

View File

@ -1,2 +1,4 @@
haskellPackages: with haskellPackages; [
]
unicode-data
unicode-data-names
]

View File

@ -1,5 +1,21 @@
{ overlays ? [] }:
let
sources = import ./sources.nix;
settings = import ./settings.nix;
overlay = final: prev: {
haskell = prev.haskell // {
packages = prev.haskell.packages // {
"${settings.ghc}" = prev.haskell.packages."${settings.ghc}".override {
overrides = haskellOverlay prev;
};
};
};
};
haskellOverlay = pkgs: final: prev: {
unicode-data = prev.unicode-data_0_4_0_1;
unicode-data-names = pkgs.haskell.lib.markUnbroken prev.unicode-data-names;
};
in
import sources.nixpkgs { inherit overlays; }
import sources.nixpkgs { overlays = overlays ++ [overlay]; }

5
nix/settings.nix Normal file
View File

@ -0,0 +1,5 @@
{
# GHC version to use with Nix.
# Should match the one in stack.yaml.
ghc = "ghc943";
}

View File

@ -13,6 +13,7 @@ extra-source-files:
dependencies:
- base >= 4.7 && < 5
- unicode-data-names
ghc-options:
- -Wall

View File

@ -1,5 +1,8 @@
{ pkgs ? import ./nix/pkgs.nix {} }:
let
haskellDeps = import ./nix/haskell-deps.nix;
settings = import ./nix/settings.nix;
tools = with pkgs; [
# nix tools
niv
@ -8,6 +11,7 @@ let
# haskell tools
stack
haskell-language-server
(pkgs.haskell.packages."${settings.ghc}".ghcWithPackages haskellDeps)
];
in
pkgs.mkShellNoCC {

View File

@ -1,9 +1,10 @@
{}:
let
pkgs = import ./nix/pkgs.nix {};
settings = import ./nix/settings.nix;
haskellDeps = import ./nix/haskell-deps.nix;
in
pkgs.haskell.lib.buildStackProject {
name = "utoy";
ghc = pkgs.haskell.packages.ghc943.ghcWithPackages haskellDeps;
ghc = pkgs.haskell.packages."${settings.ghc}".ghcWithPackages haskellDeps;
}

View File

@ -27,6 +27,7 @@ library
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
build-depends:
base >=4.7 && <5
, unicode-data-names
default-language: Haskell2010
executable utoy-exe
@ -36,6 +37,7 @@ executable utoy-exe
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
, unicode-data-names
, utoy
default-language: Haskell2010
@ -49,5 +51,6 @@ test-suite utoy-test
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
, unicode-data-names
, utoy
default-language: Haskell2010