From 40fefd39ff870d7f187a76ee8f33678a9e5e4027 Mon Sep 17 00:00:00 2001 From: tzlil Date: Fri, 17 Feb 2023 16:49:03 +0200 Subject: initial commit (move from github) --- flake.nix | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..78f8367 --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + + # This section will allow us to create a python environment + # with specific predefined python packages from PyPi + pypi-deps-db = { + url = "github:DavHau/pypi-deps-db"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.mach-nix.follows = "mach-nix"; + }; + mach-nix = { + url = "github:DavHau/mach-nix/3.5.0"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + inputs.pypi-deps-db.follows = "pypi-deps-db"; + }; + }; + + outputs = { self, nixpkgs, flake-utils, mach-nix, ... }@attr: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + + # create a custom python environment + myPython = mach-nix.lib.${system}.mkPython { + # specify the base version of python you with to use + python = "python310"; + + requirements = '' + setuptools + numpy + z3-solver + ''; + _.z3-solver = { + nativeBuildInputs.add = with pkgs; [ cmake ]; + dontUseCmakeConfigure = true; + }; + }; + in { + devShell = pkgs.mkShell { + nativeBuildInputs = [ + # Now you can use your custom python environemt! + # This should also work for `buildInputs` and so on! + myPython + ]; + }; + } + ); +} -- cgit 1.4.1