diff --git a/server/.envrc b/server/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/server/.envrc @@ -0,0 +1 @@ +use flake diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..3fba40a --- /dev/null +++ b/server/.gitignore @@ -0,0 +1,6 @@ +__pycache__ +secrets.py +runs +.ipynb_* +*.csv +.direnv diff --git a/server/default.nix b/server/default.nix new file mode 100644 index 0000000..39bacff --- /dev/null +++ b/server/default.nix @@ -0,0 +1,7 @@ +(import ( + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; + sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } +) { + src = ./.; +}).defaultNix diff --git a/server/flake.nix b/server/flake.nix new file mode 100644 index 0000000..66ca72f --- /dev/null +++ b/server/flake.nix @@ -0,0 +1,33 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = {self, nixpkgs, flake-utils}: + let + makeFlakeOutputs = system: + let + pname = "intake"; + pkgs = nixpkgs.legacyPackages."${system}"; + in + { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + python3Packages.poetry + ]; + }; + + defaultPackage = with pkgs.poetry2nix; mkPoetryApplication { + projectDir = builtins.path { path = ./.; name = pname; }; + preferWheels = true; + }; + + defaultApp = flake-utils.lib.mkApp { + drv = self.defaultPackage."${system}"; + }; + }; + in + with flake-utils.lib; eachSystem defaultSystems makeFlakeOutputs; + +} diff --git a/server/shell.nix b/server/shell.nix new file mode 100644 index 0000000..77db547 --- /dev/null +++ b/server/shell.nix @@ -0,0 +1,7 @@ +(import ( + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz"; + sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; } +) { + src = ./.; +}).shellNix