diff options
author | Joris | 2024-06-02 14:38:13 +0200 |
---|---|---|
committer | Joris | 2024-06-02 14:38:22 +0200 |
commit | 1019ea1ed341e3a7769c046aa0be5764789360b6 (patch) | |
tree | 1a0d8a4f00cff252d661c42fc23ed4c19795da6f /flake.nix | |
parent | e8da9790dc6d55cd2e8883322cdf9a7bf5b4f5b7 (diff) |
Migrate to Rust and Hyper
With sanic, downloading a file locally is around ten times slower than
with Rust and hyper.
Maybe `pypy` could have helped, but I didn’t succeed to set it up
quickly with the dependencies.
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 51 |
1 files changed, 29 insertions, 22 deletions
@@ -1,28 +1,35 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:nixos/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem - (system: - let pkgs = nixpkgs.legacyPackages.${system}; - in { devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ - sqlite - watchexec - sanic - setuptools - ])) + outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { + inherit system overlays; + }; + in + with pkgs; + { + devShell = mkShell { + buildInputs = [ + cargo-watch + lld + openssl + pkg-config + rust-bin.stable."1.78.0".default + sqlite + watchexec ]; - shellHook = '' - export DEBUG="TRUE" - export HOST="127.0.0.1" - export PORT="8080" - export KEY="1234" - ''; - }; } - ); + }; + } + ); } + |