chatthing/flake.nix

75 lines
1.6 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
devenv = {
url = "github:cachix/devenv/1e4701fb1f51f8e6fe3b0318fc2b80aed0761914";
};
};
outputs = {
self,
nixpkgs,
crane,
fenix,
flake-utils,
devenv,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
rs-toolchain = with fenix.packages.${system};
combine [
complete.toolchain
];
in {
# devShells.default = pkgs.mkShell rec {
# buildInputs = with pkgs; [
# ];
# LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
# };
devShells.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
({pkgs, ...}: {
packages = with pkgs; [
rs-toolchain
sqlx-cli
libpqxx
cargo-watch
bacon
];
languages.rust.enable = true;
pre-commit.hooks = {
clippy.enable = true;
rustfmt.enable = true;
};
services.postgres = {
enable = true;
listen_addresses = "127.0.0.1";
};
env = {
DATABASE_URL = "postgres://localhost/chatdings";
};
})
];
};
});
}