Skip to content

Instantly share code, notes, and snippets.

@qxrein
Created August 4, 2025 18:25
Show Gist options
  • Select an option

  • Save qxrein/951c3b3ed5d8e21f4eba21272fa77d33 to your computer and use it in GitHub Desktop.

Select an option

Save qxrein/951c3b3ed5d8e21f4eba21272fa77d33 to your computer and use it in GitHub Desktop.
nix flake devshell for meep simulator
{
description = "Meep devshell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
python = pkgs.python311;
pythonPackages = pkgs.python311Packages;
in {
devShells.default = pkgs.mkShell {
packages = with pythonPackages; [
python
meep
numpy
matplotlib
h5py
pip
setuptools
wheel
];
shellHook = ''
export PYTHONPATH="${pythonPackages.meep}/${python.sitePackages}:$PYTHONPATH"
'';
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment