1
0
Fork 0

Real package pog???

This commit is contained in:
Honbra 2024-01-30 20:16:04 +01:00
parent 2e36ee2758
commit ed1bd84a26
Signed by: honbra
GPG key ID: B61CC9ADABE2D952
3 changed files with 51 additions and 54 deletions

View file

@ -1,26 +1,29 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "fenix": {
"inputs": { "inputs": {
"systems": "systems" "nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1706595721,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-nf5/lPawM20WO1gHAlsUwDEJ4v+InC3BYYV1EBsBJZk=",
"owner": "numtide", "owner": "nix-community",
"repo": "flake-utils", "repo": "fenix",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "rev": "46a368edf5f1cc16573157797e5acead834d5b2c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "nix-community",
"repo": "flake-utils", "repo": "fenix",
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1705309234,
@ -54,29 +57,25 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"fenix": "fenix",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"rust-overlay": "rust-overlay"
} }
}, },
"rust-overlay": { "rust-analyzer-src": {
"inputs": { "flake": false,
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1706634984, "lastModified": 1706540258,
"narHash": "sha256-xn7lGPE8gRGBe3Lt8ESoN/uUHm7IrbiV7siupwjHX1o=", "narHash": "sha256-6RTztJE21l0hfWHp0qMWBurWnoFmUxYEDCvaGTnQYcA=",
"owner": "oxalica", "owner": "rust-lang",
"repo": "rust-overlay", "repo": "rust-analyzer",
"rev": "883b84c426107a8ec020e7124f263d7c35a5bb9f", "rev": "d13951f25c4cb880bff09a3c02a796ecc51f69ac",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "oxalica", "owner": "rust-lang",
"repo": "rust-overlay", "ref": "nightly",
"repo": "rust-analyzer",
"type": "github" "type": "github"
} }
}, },
@ -94,21 +93,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -3,35 +3,48 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = { fenix = {
url = "github:oxalica/rust-overlay"; url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: outputs = { self, nixpkgs, fenix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system;
}; };
rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
extensions = [ "rust-src" ];
});
in in
with pkgs; with pkgs;
{ {
devShells.default = mkShell rec { packages.default = pkgs.rustPlatform.buildRustPackage rec {
buildInputs = [ rust ] ++ [ 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
fenix.packages.${system}.latest.rustfmt
rust-analyzer rust-analyzer
pkg-config pkg-config
postgresql postgresql
sqlfluff sqlfluff
sqlx-cli sqlx-cli
]; ];
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; # LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
# ssh -NL /home/honbra/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432 <user>@<host> # ssh -NL /home/honbra/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432 <user>@<host>
# good luck setting up /home/honbra on your machine # good luck setting up /home/honbra on your machine
DATABASE_URL = "postgresql:///ncpn?host=/home/honbra&user=honbra"; DATABASE_URL = "postgresql:///ncpn?host=/home/honbra&user=honbra";

View file

@ -16,7 +16,7 @@ use crate::config::Config;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let filter = filter::Targets::new() let filter = filter::Targets::new()
.with_target("honbra_api", Level::TRACE) .with_target("ncpn", Level::TRACE)
.with_target("tower_http::trace::on_response", Level::TRACE) .with_target("tower_http::trace::on_response", Level::TRACE)
.with_target("tower_http::trace::on_request", Level::TRACE) .with_target("tower_http::trace::on_request", Level::TRACE)
.with_default(Level::INFO); .with_default(Level::INFO);