Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 10478c7

Browse files
committedMay 11, 2022
use flake-utils.eachSystem
1 parent 2cb72b7 commit 10478c7

File tree

2 files changed

+66
-43
lines changed

2 files changed

+66
-43
lines changed
 

‎flake.lock

+19-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flake.nix

+47-40
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
11
{
22
description = "concat";
3-
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; };
4-
outputs = { self, nixpkgs }:
5-
let
6-
pkgs = nixpkgs.legacyPackages.x86_64-linux;
3+
inputs = {
4+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
5+
flake-utils.url = "github:numtide/flake-utils";
6+
};
7+
outputs = { self, nixpkgs, flake-utils }:
8+
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
9+
let
10+
pkgs = import nixpkgs { inherit system; };
711

8-
haskellOverlay = self: super: {
9-
"concat-inline" = pkgs.haskell.lib.dontHaddock
10-
(self.callCabal2nix "concat-inline" ./inline { });
11-
"concat-plugin" = self.callCabal2nix "concat-plugin" ./plugin { };
12-
"concat-classes" = self.callCabal2nix "concat-classes" ./classes { };
13-
"concat-satisfy" = self.callCabal2nix "concat-satisfy" ./satisfy { };
14-
"concat-known" = self.callCabal2nix "concat-known" ./known { };
15-
#"concat-hardware" = self.callCabal2nix "concat-hardware" ./hardware { };
16-
"concat-graphics" = self.callCabal2nix "concat-graphics" ./graphics { };
17-
"concat-examples" = pkgs.haskell.lib.dontHaddock
18-
(self.callCabal2nix "concat-examples" ./examples { });
19-
};
12+
haskellOverlay = self: super: {
13+
"concat-inline" = pkgs.haskell.lib.dontHaddock
14+
(self.callCabal2nix "concat-inline" ./inline { });
15+
"concat-plugin" = self.callCabal2nix "concat-plugin" ./plugin { };
16+
"concat-classes" = self.callCabal2nix "concat-classes" ./classes { };
17+
"concat-satisfy" = self.callCabal2nix "concat-satisfy" ./satisfy { };
18+
"concat-known" = self.callCabal2nix "concat-known" ./known { };
19+
#"concat-hardware" = self.callCabal2nix "concat-hardware" ./hardware { };
20+
"concat-graphics" =
21+
self.callCabal2nix "concat-graphics" ./graphics { };
22+
"concat-examples" = pkgs.haskell.lib.dontHaddock
23+
(self.callCabal2nix "concat-examples" ./examples { });
24+
};
2025

21-
newHaskellPackages =
22-
pkgs.haskellPackages.override { overrides = haskellOverlay; };
26+
newHaskellPackages =
27+
pkgs.haskellPackages.override { overrides = haskellOverlay; };
2328

24-
in {
25-
packages.x86_64-linux = {
26-
inherit (newHaskellPackages)
27-
concat-inline concat-plugin concat-classes concat-satisfy concat-known
28-
#concat-hardware
29-
concat-graphics concat-examples;
30-
};
29+
in {
30+
packages = {
31+
inherit (newHaskellPackages)
32+
concat-inline concat-plugin concat-classes concat-satisfy
33+
concat-known
34+
#concat-hardware
35+
concat-graphics concat-examples;
36+
};
3137

32-
# see these issues and discussions:
33-
# - https://github.com/NixOS/nixpkgs/issues/16394
34-
# - https://github.com/NixOS/nixpkgs/issues/25887
35-
# - https://github.com/NixOS/nixpkgs/issues/26561
36-
# - https://discourse.nixos.org/t/nix-haskell-development-2020/6170
37-
overlay = final: prev: {
38-
haskellPackages = prev.haskellPackages.override (old: {
39-
overrides = final.lib.composeExtensions (old.overrides or (_: _: { }))
40-
haskellOverlay;
41-
});
42-
};
38+
# see these issues and discussions:
39+
# - https://github.com/NixOS/nixpkgs/issues/16394
40+
# - https://github.com/NixOS/nixpkgs/issues/25887
41+
# - https://github.com/NixOS/nixpkgs/issues/26561
42+
# - https://discourse.nixos.org/t/nix-haskell-development-2020/6170
43+
overlay = final: prev: {
44+
haskellPackages = prev.haskellPackages.override (old: {
45+
overrides =
46+
final.lib.composeExtensions (old.overrides or (_: _: { }))
47+
haskellOverlay;
48+
});
49+
};
4350

44-
devShell.x86_64-linux = let
45-
hsenv = pkgs.haskellPackages.ghcWithPackages (p: [ p.cabal-install ]);
46-
in pkgs.mkShell { buildInputs = [ hsenv ]; };
47-
};
51+
devShell = let
52+
hsenv = pkgs.haskellPackages.ghcWithPackages (p: [ p.cabal-install ]);
53+
in pkgs.mkShell { buildInputs = [ hsenv ]; };
54+
});
4855
}

0 commit comments

Comments
 (0)
Please sign in to comment.