1
0
Fork 0
ncpn/flake.nix
2024-02-03 14:42:19 +01:00

56 lines
1.5 KiB
Nix

{
description = "Non-creative project name";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, fenix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
with pkgs;
{
packages.default = pkgs.rustPlatform.buildRustPackage rec {
pname = "ncpn";
version = "0.1.0";
src = self;
cargoSha256 = "sha256-SzblF7WU4SfqbwB2sk3uSzfd4OOi/z4/+NxzZhuiymI=";
meta = with stdenv.lib; {
description = "Non-creative project name: Yet another link shortener, except this time in Rust!";
homepage = "https://src.honbra.com/honbra/ncpn";
};
};
devShells.default = mkShell {
buildInputs = [
cargo
rustc
clippy
fenix.packages.${system}.latest.rustfmt
rust-analyzer
pkg-config
postgresql
sqlfluff
sqlx-cli
];
# LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
# ssh -NL /home/honbra/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432 <user>@<host>
# good luck setting up /home/honbra on your machine
DATABASE_URL = "postgresql:///ncpn?host=/home/honbra&user=honbra";
};
}
);
}