fibre_walk_project_code/flake.nix

64 lines
1.7 KiB
Nix
Raw Normal View History

2024-05-10 12:07:26 -04:00
{
2024-05-11 11:52:04 -04:00
description = "Analysis code for the realization of the NHQW in fibre loops.";
2024-05-10 12:07:26 -04:00
2024-05-11 11:52:04 -04:00
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
poetry2nix = {
url = "github:nix-community/poetry2nix";
2024-05-11 11:52:04 -04:00
inputs.nixpkgs.follows = "nixpkgs";
2024-05-10 12:07:26 -04:00
};
};
2024-05-11 11:52:04 -04:00
outputs = inputs @ { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
2024-05-13 11:15:20 -04:00
poetry2nix = inputs.poetry2nix.lib.mkPoetry2Nix { inherit pkgs; };
2024-05-11 11:52:04 -04:00
in
2024-05-13 11:15:20 -04:00
{
packages = {
fibreMagic = poetry2nix.mkPoetryApplication {
projectDir = self;
preferWheels = true;
overrides = poetry2nix.overrides.withDefaults (final: prev: {
matplotlib = with pkgs; prev.matplotlib.override (
{
enableGtk3 = true;
}
);
});
2024-05-11 11:52:04 -04:00
};
2024-05-13 11:15:20 -04:00
default = self.packages.${system}.fibreMagic;
};
# Shell for app dependencies.
#
# nix develop
#
# Use this shell for developing your app.
devShells.default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.fibreMagic ];
package = with pkgs; [
ruff
pyright
python3Packages.jupyter
];
shellHook = ''
export PYTHONPATH=$(pwd)/src:$PYTHONPATH
'';
2024-05-13 11:15:20 -04:00
};
# Shell for poetry.
#
# nix develop .#poetry
#
# Use this shell for changes to pyproject.toml and poetry.lock.
devShells.poetry = pkgs.mkShell {
packages = [ pkgs.poetry ];
};
});
2024-05-10 12:07:26 -04:00
}