|
15 | 15 | in
|
16 | 16 | flake-utils.lib.eachSystem supportedSystems (system:
|
17 | 17 | let
|
18 |
| - linker-workaround = pkgs_.writeShellScript "linker-workaround" '' |
| 18 | + linker-workaround = pkgs: pkgs.writeShellScript "linker-workaround" '' |
19 | 19 | # put all flags into 'params' array
|
20 |
| - source ${pkgsStatic.stdenv.cc}/nix-support/utils.bash |
| 20 | + source ${pkgs.stdenv.cc}/nix-support/utils.bash |
21 | 21 | expandResponseParams "$@"
|
22 | 22 |
|
23 | 23 | # check if '-shared' flag is present
|
|
44 | 44 | # invoke the actual linker with the new params
|
45 | 45 | exec x86_64-unknown-linux-musl-cc @<(printf "%q\n" "''${newParams[@]}")
|
46 | 46 | '';
|
47 |
| - hixProject = args@{ static ? false, ... }: |
48 |
| - (pkgs args).haskell-nix.cabalProject { |
49 |
| - compiler-nix-name = "ghc945"; |
50 |
| - src = nix-filter.lib { |
51 |
| - root = ./.; |
52 |
| - include = [ |
53 |
| - ./docs |
54 |
| - ./lib |
55 |
| - ./lib-internal |
56 |
| - ./src |
57 |
| - ./test |
58 |
| - ./pandoc-crossref.cabal |
59 |
| - ./cabal.project.freeze |
60 |
| - ./cabal.project |
61 |
| - ./Setup.hs |
62 |
| - ./.gitignore |
63 |
| - ./LICENSE |
64 |
| - ./README.md |
65 |
| - ./CHANGELOG.md |
66 |
| - ]; |
67 |
| - }; |
68 |
| - evalSystem = "x86_64-linux"; |
69 |
| - modules = [{ |
70 |
| - packages.pandoc-crossref.ghcOptions = |
71 |
| - if static then ["-pgml=${linker-workaround}"] else []; |
72 |
| - }]; |
| 47 | + hixProject = pkgs.haskell-nix.cabalProject { |
| 48 | + compiler-nix-name = "ghc945"; |
| 49 | + src = nix-filter.lib { |
| 50 | + root = ./.; |
| 51 | + include = [ |
| 52 | + ./docs |
| 53 | + ./lib |
| 54 | + ./lib-internal |
| 55 | + ./src |
| 56 | + ./test |
| 57 | + ./pandoc-crossref.cabal |
| 58 | + ./cabal.project.freeze |
| 59 | + ./cabal.project |
| 60 | + ./Setup.hs |
| 61 | + ./.gitignore |
| 62 | + ./LICENSE |
| 63 | + ./README.md |
| 64 | + ./CHANGELOG.md |
| 65 | + ]; |
73 | 66 | };
|
74 |
| - overlays = [ haskellNix.overlay (final: prev: {}) ]; |
75 |
| - pkgsStatic = pkgs_.pkgsCross.musl64; |
76 |
| - pkgs_ = import nixpkgs { inherit system overlays; inherit (haskellNix) config; }; |
77 |
| - pkgs = {static ? false }: if static then pkgsStatic else pkgs_; |
78 |
| - flake = (hixProject {}).flake {}; |
79 |
| - flakeStatic = (hixProject { static = true; }).flake {}; |
80 |
| - in { |
81 |
| - legacyPackages = pkgs {}; |
| 67 | + evalSystem = "x86_64-linux"; |
| 68 | + modules = [({pkgs, ...}: with pkgs; { |
| 69 | + packages.pandoc-crossref.ghcOptions = |
| 70 | + lib.optional stdenv.hostPlatform.isMusl "-pgml=${linker-workaround pkgs}"; |
| 71 | + })]; |
| 72 | + }; |
| 73 | + overlays = [ haskellNix.overlay ]; |
| 74 | + pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; }; |
| 75 | + flake = hixProject.flake { |
| 76 | + crossPlatforms = ps: with ps; [ musl64 ]; |
| 77 | + }; |
| 78 | + in pkgs.lib.recursiveUpdate { inherit (flake) packages apps checks; } { |
82 | 79 | packages = {
|
83 | 80 | default = flake.packages."pandoc-crossref:exe:pandoc-crossref";
|
84 |
| - static = flakeStatic.packages."pandoc-crossref:exe:pandoc-crossref"; |
85 |
| - pandoc = (hixProject {}).pandoc-cli.components.exes.pandoc; |
| 81 | + static = flake.packages."x86_64-unknown-linux-musl:pandoc-crossref:exe:pandoc-crossref"; |
| 82 | + pandoc = hixProject.pandoc-cli.components.exes.pandoc; |
86 | 83 | };
|
87 | 84 | apps = {
|
88 | 85 | default = flake.apps."pandoc-crossref:exe:pandoc-crossref";
|
89 | 86 | test = flake.apps."pandoc-crossref:test:test-pandoc-crossref";
|
90 | 87 | test-integrative = flake.apps."pandoc-crossref:test:test-integrative";
|
91 | 88 | };
|
92 |
| - devShells.default = pkgs_.mkShell { |
93 |
| - buildInputs = [ |
94 |
| - self.packages.${system}.default |
95 |
| - self.packages.${system}.pandoc |
96 |
| - ]; |
| 89 | + devShells.default = pkgs.mkShell { |
| 90 | + buildInputs = with self.packages.${system}; [ default pandoc ]; |
97 | 91 | };
|
98 | 92 | });
|
99 | 93 |
|
|
0 commit comments