From 06dc7c99964df8ce53995896180f55c4f73e3168 Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Thu, 11 Aug 2022 23:32:44 +0000 Subject: [PATCH] Initialize flake from templates#python --- server/.envrc | 1 + server/.gitignore | 6 ++++++ server/default.nix | 7 +++++++ server/flake.nix | 33 +++++++++++++++++++++++++++++++++ server/shell.nix | 7 +++++++ 5 files changed, 54 insertions(+) create mode 100644 server/.envrc create mode 100644 server/.gitignore create mode 100644 server/default.nix create mode 100644 server/flake.nix create mode 100644 server/shell.nix 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