Skip to content

Commit 87a6a4b

Browse files
committed
init
0 parents  commit 87a6a4b

File tree

10 files changed

+1088
-0
lines changed

10 files changed

+1088
-0
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.direnv/
2+
target

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
description = "basic rust project";
3+
4+
inputs = {
5+
flake-utils.url = "github:numtide/flake-utils";
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
7+
};
8+
9+
outputs = { self, flake-utils, nixpkgs }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs {
13+
inherit system;
14+
overlays = [ my-overlay ];
15+
};
16+
my-overlay = final: prev: { };
17+
package-name = "tmp-postgres";
18+
19+
in
20+
{
21+
inherit pkgs;
22+
23+
devShells.default = pkgs.mkShell {
24+
nativeBuildInputs = with pkgs; [ cargo rust-analyzer rustfmt cargo-watch rustPackages.clippy ];
25+
inputsFrom = [ self.packages."${system}"."${package-name}" ];
26+
};
27+
packages = {
28+
default = self.packages."${system}"."${package-name}";
29+
# Read the docs at https://nixos.org/manual/nixpkgs/stable/#rust
30+
"${package-name}" = pkgs.rustPlatform.buildRustPackage {
31+
pname = package-name;
32+
version = "0.1.0";
33+
cargoSha256 = "sha256-o9pxSXyiDS7FFdZmXssY1qQvyya0tTg1nRpMPXd9ZO4=";
34+
src = ./src;
35+
buildInputs =
36+
let
37+
darwin-frameworks = with pkgs.darwin.apple_sdk.frameworks;
38+
[
39+
CoreFoundation
40+
CoreServices
41+
SystemConfiguration
42+
pkgs.libiconv
43+
];
44+
in
45+
if system == "aarch64-darwin" then darwin-frameworks else [ ];
46+
};
47+
};
48+
});
49+
}

0 commit comments

Comments
 (0)