-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
125 lines (111 loc) · 4.58 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
description = "A very basic flake";
inputs.haskellNix.url = "haskellNix"; # This uses the registry. old way was "github:input-output-hk/haskell.nix"
inputs.nixpkgs.follows = "haskellNix/nixpkgs-2305";
outputs = { self, nixpkgs, haskellNix }:
let
system = "x86_64-linux";
overlays = [ ] ;
# haskellNix.overlay
# (final: prev: {
# # haskell-nix = prev.haskell-nix // {
# # extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings // {
# # # String pkgconfig-depends names are mapped to lists of Nixpkgs
# # # package names
# # "python3-ptghci" = [ "python3-ptghci" ];
# # };
# # };
# # in (pwp.override {
# # makeWrapperArgs = ["--set PYTHONHOME $out"];
# # })
# # .overrideAttrs (finalAttrs: prevAddrs: {
# # pname = "python3";
# #})
# ptghci-hs = final.haskell-nix.cabalProject' {
# src = ./.;
# compiler-nix-name = "ghc945";
# shell.tools = {
# cabal = {};
# hlint = {};
# ghcid = {};
# haskell-language-server = {
# version = "latest";
# cabalProject = ''
# packages: .
# package haskell-language-server
# flags: -floskell -stylishHaskell -eval
# '';
# modules = [{
# packages.haskell-language-server.flags.floskell = false;
# packages.haskell-language-server.flags.stylishHaskell = false;
# packages.haskell-language-server.flags.eval = false;
# }];
# };
# };
# };
# ptghci =
# let
# python3-ptghci = prev.python3.withPackages(ps: with ps; [
# ansicolors prompt-toolkit pygments pygtrie pyyaml pyzmq six
# wcwidth
# ]);
# flake = pkgs.ptghci-hs.flake { };
# executablePkg = flake.packages."ptghci:exe:ptghci";
# pybits = ./pybits;
# in executablePkg.overrideAttrs(old: {
# buildInputs = old.buildInputs ++ [ pkgs.makeWrapper ];
# # wrap the binary in a script where the appropriate env var is set
# postInstall = old.postInstall or "" + ''
# wrapProgram "$out/bin/ptghci" \
# --set PYTHONPATH "${python3-ptghci.sitePackages}:${pybits}"
# '';
# });
# })
# ];
pkgs = import nixpkgs { inherit system overlays; };
ptghci =
let drv = pkgs.haskellPackages.callCabal2nix "ptghci" ./.;
python =
(pkgs.python310.withPackages(ps: with ps; [
ansicolors prompt-toolkit pygments pygtrie pyyaml pyzmq six wcwidth
])).override {
makeWrapperArgs = ["--set PYTHONHOME $out"];
};
pybits = ./pybits;
in (pkgs.callPackage drv { python3-embed = python; })
.overrideAttrs (old: {
doCheck = false;
buildInputs = old.buildInputs ++ [ pkgs.makeWrapper ];
postInstall = old.postInstall or "" + ''
wrapProgram "$out/bin/ptghci" \
--set PYTHONPATH "${python.out}/${python.sitePackages}:${pybits}"
'';
});
# ptghci_builtins = (pkgs.haskellPackages.developPackage {
# name = "ptghci";
# root = ./.;
# modifier = drv: builtins.trace drv (
# let
# #drvPythonApplied = attrs: drv (attrs // {python3-embed = pkgs.python3;});
# in (drv { python3-embed = pkgs.python3;}).override { python3-embed = pkgs.python3; });
# drv' =
# pkgs.haskell.lib.addBuildTools drvPythonApplied (with pkgs.haskellPackages;
# [ cabal-install
# pkg-config
# pkgs.python310.withPackages(ps: with ps; [
# ansicolors prompt-toolkit pygments pygtrie pyyaml pyzmq six wcwidth zmq
# ])
# ]);
# in (pkgs.haskell.lib.addExtraLibraries drv' (with pkgs.haskellPackages;
# [
# pkgs.python310.withPackages(ps: with ps; [
# ansicolors prompt-toolkit pygments pygtrie pyyaml pyzmq six wcwidth zmq
# ])
# ])));
#});
in {
#daPkgs = pkgs;
packages.x86_64-linux.ptghci = ptghci;
packages.x86_64-linux.default = self.packages.x86_64-linux.ptghci;
};
}