aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorJoris2024-06-02 14:38:13 +0200
committerJoris2024-06-02 14:38:22 +0200
commit1019ea1ed341e3a7769c046aa0be5764789360b6 (patch)
tree1a0d8a4f00cff252d661c42fc23ed4c19795da6f /flake.nix
parente8da9790dc6d55cd2e8883322cdf9a7bf5b4f5b7 (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.nix51
1 files changed, 29 insertions, 22 deletions
diff --git a/flake.nix b/flake.nix
index 170fe8d..fe059df 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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"
- '';
- }; }
- );
+ };
+ }
+ );
}
+