diff --git a/python/.envrc b/python/.envrc deleted file mode 100644 index 3550a30..0000000 --- a/python/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/python/.github/workflows/build_nix.yml b/python/.github/workflows/build_nix.yml deleted file mode 100644 index 2f684e1..0000000 --- a/python/.github/workflows/build_nix.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: "Build legacy Nix package on Ubuntu" - -on: - push: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v12 - - name: Building package - run: nix-build . -A defaultPackage.x86_64-linux diff --git a/python/.gitignore b/python/.gitignore deleted file mode 100644 index 3fba40a..0000000 --- a/python/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -__pycache__ -secrets.py -runs -.ipynb_* -*.csv -.direnv diff --git a/python/default.nix b/python/default.nix deleted file mode 100644 index 39bacff..0000000 --- a/python/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -(import ( - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; - sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } -) { - src = ./.; -}).defaultNix diff --git a/python/flake.nix b/python/flake.nix index 859989f..4e454b9 100644 --- a/python/flake.nix +++ b/python/flake.nix @@ -1,29 +1,24 @@ { - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - utils.url = "github:numtide/flake-utils"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + outputs = { self, nixpkgs }: + let + supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system}); + in + { + packages = forAllSystems (system: { + default = pkgs.${system}.poetry2nix.mkPoetryApplication { projectDir = self; }; + }); + + devShells = forAllSystems (system: { + default = pkgs.${system}.mkShellNoCC { + packages = with pkgs.${system}; [ + (poetry2nix.mkPoetryEnv { projectDir = self; }) + poetry + ]; + }; + }); }; - - outputs = {self, nixpkgs, utils}: - let out = system: - let pkgs = nixpkgs.legacyPackages."${system}"; - in { - - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - python3Packages.poetry - ]; - }; - - defaultPackage = with pkgs.poetry2nix; mkPoetryApplication { - projectDir = ./.; - preferWheels = true; - }; - - defaultApp = utils.lib.mkApp { - drv = self.defaultPackage."${system}"; - }; - - }; in with utils.lib; eachSystem defaultSystems out; - } diff --git a/python/shell.nix b/python/shell.nix deleted file mode 100644 index 77db547..0000000 --- a/python/shell.nix +++ /dev/null @@ -1,7 +0,0 @@ -(import ( - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; - sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } -) { - src = ./.; -}).shellNix