|
| 1 | +# Copyright 2024-2025 Open Quantum Design |
| 2 | + |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | + |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +{ |
| 15 | + description = "OpenQuantum Design Compiler Infrastructure"; |
| 16 | + |
| 17 | + inputs = { |
| 18 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 19 | + flake-utils.url = "github:numtide/flake-utils"; |
| 20 | + }; |
| 21 | + |
| 22 | + outputs = { self, nixpkgs, flake-utils }: |
| 23 | + flake-utils.lib.eachDefaultSystem (system: |
| 24 | + let |
| 25 | + pkgs = nixpkgs.legacyPackages.${system}; |
| 26 | + python = pkgs.python311; |
| 27 | + pythonPackages = python.pkgs; |
| 28 | + in |
| 29 | + { |
| 30 | + packages.default = pythonPackages.callPackage ./pkgs/derivation.nix { }; |
| 31 | + |
| 32 | + devShells.default = pkgs.mkShell { |
| 33 | + packages = with pkgs; [ |
| 34 | + # Python with dependencies |
| 35 | + (python.withPackages (ps: with ps; [ |
| 36 | + # Core dependencies |
| 37 | + pydantic |
| 38 | + |
| 39 | + # Documentation dependencies |
| 40 | + pymdown-extensions |
| 41 | + mkdocstrings |
| 42 | + mkdocs-material |
| 43 | + mkdocstrings-python |
| 44 | + mdx-truly-sane-lists |
| 45 | + |
| 46 | + # Test dependencies |
| 47 | + pytest |
| 48 | + |
| 49 | + # Development tools |
| 50 | + pip |
| 51 | + black |
| 52 | + isort |
| 53 | + mypy |
| 54 | + ])) |
| 55 | + |
| 56 | + # Additional development tools |
| 57 | + git |
| 58 | + ]; |
| 59 | + |
| 60 | + shellHook = '' |
| 61 | + export PYTHONPATH="$PWD/src:$PYTHONPATH" |
| 62 | + echo "OpenQuantum Design Compiler Infrastructure development environment" |
| 63 | + echo "Python version: $(python --version)" |
| 64 | + ''; |
| 65 | + }; |
| 66 | + } |
| 67 | + ); |
| 68 | +} |
0 commit comments