Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
1831a8d1
Commit
1831a8d1
authored
5 months ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
flake.nix: Add flake support
parent
5b2b29d8
No related branches found
No related tags found
1 merge request
!977
Tweaks
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.envrc
+1
-0
1 addition, 0 deletions
.envrc
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
flake.lock
+60
-0
60 additions, 0 deletions
flake.lock
flake.nix
+78
-0
78 additions, 0 deletions
flake.nix
with
140 additions
and
0 deletions
.envrc
0 → 100644
+
1
−
0
View file @
1831a8d1
use flake
This diff is collapsed.
Click to expand it.
.gitignore
+
1
−
0
View file @
1831a8d1
# nix-related
result
.nix-nifty-venv
.direnv
docs/source/user/getting_started_0.rst
docs/source/user/custom_nonlinearities.rst
...
...
This diff is collapsed.
Click to expand it.
flake.lock
0 → 100644
+
60
−
0
View file @
1831a8d1
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1735834308,
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
This diff is collapsed.
Click to expand it.
flake.nix
0 → 100644
+
78
−
0
View file @
1831a8d1
{
description
=
"Numerical Information Field Theory"
;
inputs
=
{
nixpkgs
.
url
=
"nixpkgs/nixos-unstable"
;
flake-utils
.
url
=
"github:numtide/flake-utils"
;
};
outputs
=
{
self
,
nixpkgs
,
flake-utils
}:
flake-utils
.
lib
.
eachDefaultSystem
(
system
:
let
pkgs
=
import
nixpkgs
{
inherit
system
;
};
myPyPkgs
=
pkgs
.
python3Packages
;
version
=
"8.5.2"
;
req
.
minimal
=
with
myPyPkgs
;
[
numpy
scipy
ducc0
];
req
.
dev
=
with
myPyPkgs
;
[
pytest
pytest-cov
matplotlib
];
# req.mpi = [ myPyPkgs.mpi4py pkgs.openmpi pkgs.openssh ];
req
.
jax
=
with
myPyPkgs
;
[
jax
jaxlib
];
req
.
rest
=
with
myPyPkgs
;
[
astropy
h5py
];
req
.
docs
=
with
myPyPkgs
;
[
sphinx
pkgs
.
jupyter
# python3Packages.jupyter is broken, see https://github.com/NixOS/nixpkgs/issues/299385
jupytext
pydata-sphinx-theme
myst-parser
];
allreqs
=
pkgs
.
lib
.
attrValues
req
;
nifty
=
myPyPkgs
.
buildPythonPackage
{
pname
=
"nifty8"
;
inherit
version
;
src
=
./.
;
pyproject
=
true
;
build-system
=
with
pkgs
.
python3
.
pkgs
;
[
setuptools
];
dependencies
=
req
.
minimal
;
# TODO Add MPI tests
checkInputs
=
[
myPyPkgs
.
pytestCheckHook
]
++
allreqs
;
disabledTestPaths
=
[
"test/test_mpi"
];
pythonImportsCheck
=
[
"nifty8"
];
};
nifty-docs
=
pkgs
.
stdenv
.
mkDerivation
{
name
=
"nifty-docs"
;
inherit
version
;
src
=
./.
;
buildInputs
=
allreqs
++
[
nifty
];
buildPhase
=
"sh docs/generate.sh"
;
installPhase
=
''
mkdir $out
mv docs/build/* $out
''
;
};
in
{
# Standard nifty package
packages
.
default
=
nifty
;
# Build nifty docs (`nix build .#docs`)
packages
.
"docs"
=
nifty-docs
;
# Development shell (`nix develop .`) including python-lsp-server for development
devShells
.
default
=
pkgs
.
mkShell
{
nativeBuildInputs
=
(
with
myPyPkgs
;
[
python-lsp-server
python-lsp-ruff
])
++
(
with
pkgs
;
[
ruff
ruff-lsp
])
++
allreqs
;
};
# Shell in which nifty is installed (`nix develop .#nifty-installed`),
# e.g., for building the docs (`sh docs/generate.sh`) or running demos
devShells
.
"nifty-installed"
=
pkgs
.
mkShell
{
nativeBuildInputs
=
allreqs
;
packages
=
[
nifty
];
};
});
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment