Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
c2798505
Commit
c2798505
authored
Oct 10, 2021
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release-9.2.nix: init
parent
180e42ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
0 deletions
+112
-0
release-9.2.nix
release-9.2.nix
+112
-0
No files found.
release-9.2.nix
0 → 100644
View file @
c2798505
let
# https://github.com/NixOS/nixpkgs/pull/141095
nixpkgs-src
=
builtins
.
fetchTarball
{
url
=
"https://github.com/NixOS/nixpkgs/tarball/bab822b583416305be6b98424cb2980f4fcf4f24"
;
sha256
=
"1iwhb8i7v9734z0mk695klflry4kfrcs3m5l7g97brsyardcz9gj"
;
};
in
{
compiler
?
"ghc921"
,
nixpkgs
?
import
nixpkgs-src
{}
,
packages
?
(
_
:
[])
,
pythonPackages
?
(
_
:
[])
,
rtsopts
?
"-M3g -N2"
,
staticExecutable
?
false
,
systemPackages
?
(
_
:
[])
}:
let
ihaskell-src
=
nixpkgs
.
nix-gitignore
.
gitignoreSource
[
"**/*.ipynb"
"**/*.nix"
"**/*.yaml"
"**/*.yml"
"**/
\.
*"
"/Dockerfile"
"/README.md"
"/cabal.project"
"/images"
"/notebooks"
"/requirements.txt"
]
./.
;
displays
=
self
:
builtins
.
listToAttrs
(
map
(
display
:
{
name
=
"ihaskell-
${
display
}
"
;
value
=
self
.
callCabal2nix
display
"
${
ihaskell-src
}
/ihaskell-display/ihaskell-
${
display
}
"
{};
})
[
"aeson"
"blaze"
"charts"
"diagrams"
"gnuplot"
"graphviz"
"hatex"
"juicypixels"
"magic"
"plot"
"rlangqq"
"static-canvas"
"widgets"
]);
haskellPackages
=
nixpkgs
.
haskell
.
packages
.
"
${
compiler
}
"
.
override
(
old
:
{
overrides
=
nixpkgs
.
lib
.
composeExtensions
(
old
.
overrides
or
(
_
:
_
:
{}))
(
self
:
super
:
{
ihaskell
=
(
nixpkgs
.
haskell
.
lib
.
overrideCabal
(
self
.
callCabal2nix
"ihaskell"
ihaskell-src
{})
(
_drv
:
{
preCheck
=
''
export HOME=$TMPDIR/home
export PATH=$PWD/dist/build/ihaskell:$PATH
export GHC_PACKAGE_PATH=$PWD/dist/package.conf.inplace/:$GHC_PACKAGE_PATH
''
;
configureFlags
=
(
old
.
configureFlags
or
[])
++
[
"-f"
"-use-hlint"
];
}))
.
overrideScope
(
self
:
super
:
{
hlint
=
null
;
});
ghc-parser
=
self
.
callCabal2nix
"ghc-parser"
./ghc-parser
{};
ipython-kernel
=
self
.
callCabal2nix
"ipython-kernel"
./ipython-kernel
{};
}
//
displays
self
);
});
# statically linking against haskell libs reduces closure size at the expense
# of startup/reload time, so we make it configurable
ihaskellExe
=
if
staticExecutable
then
nixpkgs
.
haskell
.
lib
.
justStaticExecutables
haskellPackages
.
ihaskell
else
nixpkgs
.
haskell
.
lib
.
enableSharedExecutables
haskellPackages
.
ihaskell
;
ihaskellEnv
=
haskellPackages
.
ghcWithPackages
packages
;
jupyterlab
=
nixpkgs
.
python3
.
withPackages
(
ps
:
[
ps
.
jupyterlab
]
++
pythonPackages
ps
);
ihaskellGhcLibFunc
=
exe
:
env
:
nixpkgs
.
writeShellScriptBin
"ihaskell"
''
${
exe
}
/bin/ihaskell -l $(
${
env
}
/bin/ghc --print-libdir) "$@"
''
;
ihaskellKernelFileFunc
=
ihaskellGhcLib
:
rtsopts
:
{
display_name
=
"Haskell"
;
argv
=
[
"
${
ihaskellGhcLib
}
/bin/ihaskell"
"kernel"
"{connection_file}"
"+RTS"
]
++
(
nixpkgs
.
lib
.
splitString
" "
rtsopts
)
++
[
"-RTS"
];
language
=
"haskell"
;
};
ihaskellKernelSpecFunc
=
ihaskellKernelFile
:
nixpkgs
.
runCommand
"ihaskell-kernel"
{}
''
export kerneldir=$out/kernels/haskell
mkdir -p $kerneldir
cp
${
./html
}
/* $kerneldir
echo '
${
builtins
.
toJSON
ihaskellKernelFile
}
' > $kerneldir/kernel.json
''
;
ihaskellLabextension
=
nixpkgs
.
runCommand
"ihaskell-labextension"
{}
''
mkdir -p $out/labextensions/
ln -s
${
./jupyterlab-ihaskell/labextension
}
$out/labextensions/jupyterlab-ihaskell
''
;
ihaskellDataDirFunc
=
ihaskellKernelSpec
:
ihaskellLabextension
:
nixpkgs
.
buildEnv
{
name
=
"ihaskell-data-dir"
;
paths
=
[
ihaskellKernelSpec
ihaskellLabextension
];
};
ihaskellBuildEnvFunc
=
{
ihaskellEnv
,
jupyterlab
,
systemPackages
,
ihaskellDataDir
}:
nixpkgs
.
buildEnv
{
name
=
"ihaskell-with-packages"
;
buildInputs
=
[
nixpkgs
.
makeWrapper
];
paths
=
[
ihaskellEnv
jupyterlab
];
postBuild
=
''
for prg in $out/bin"/"*;do
if [[ -f $prg && -x $prg ]]; then
wrapProgram $prg \
--prefix PATH : "
${
nixpkgs
.
lib
.
makeBinPath
([
ihaskellEnv
]
++
(
systemPackages
nixpkgs
))
}
" \
--prefix JUPYTER_PATH : "
${
ihaskellDataDir
}
"
fi
done
''
;
passthru
=
{
inherit
haskellPackages
;
inherit
ihaskellExe
;
inherit
ihaskellEnv
;
inherit
ihaskellLabextension
;
inherit
jupyterlab
;
inherit
ihaskellGhcLibFunc
;
inherit
ihaskellKernelFileFunc
;
inherit
ihaskellKernelSpecFunc
;
inherit
ihaskellDataDirFunc
;
inherit
ihaskellBuildEnvFunc
;
};
};
in
ihaskellBuildEnvFunc
{
inherit
ihaskellEnv
jupyterlab
systemPackages
;
ihaskellDataDir
=
let
ihaskellGhcLib
=
ihaskellGhcLibFunc
ihaskellExe
ihaskellEnv
;
ihaskellKernelFile
=
ihaskellKernelFileFunc
ihaskellGhcLib
rtsopts
;
ihaskellKernelSpec
=
ihaskellKernelSpecFunc
ihaskellKernelFile
;
in
ihaskellDataDirFunc
ihaskellKernelSpec
ihaskellLabextension
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment