my git slow today
This commit is contained in:
@@ -1 +0,0 @@
|
||||
/nix/store/9hpficax6bzwhgl622w21pkx39wl6r8w-source
|
||||
1
.direnv/flake-inputs/r1n51h2kvjxvy04rlgfch87izm58nhcb-source
Symbolic link
1
.direnv/flake-inputs/r1n51h2kvjxvy04rlgfch87izm58nhcb-source
Symbolic link
@@ -0,0 +1 @@
|
||||
/nix/store/r1n51h2kvjxvy04rlgfch87izm58nhcb-source
|
||||
4
flake.lock
generated
4
flake.lock
generated
@@ -17,7 +17,7 @@
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/nix-community/fenix/0.1"
|
||||
"url": "https://flakehub.com/f/nix-community/fenix/0.1.%2A"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
@@ -31,7 +31,7 @@
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
|
||||
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
|
||||
74
flake.nix
74
flake.nix
@@ -2,15 +2,14 @@
|
||||
description = "A Nix-flake-based Rust development environment";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs
|
||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*"; # unstable
|
||||
fenix = {
|
||||
url = "https://flakehub.com/f/nix-community/fenix/0.1";
|
||||
url = "https://flakehub.com/f/nix-community/fenix/0.1.*";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, ... }@inputs:
|
||||
outputs = { self, nixpkgs, fenix, ... }@inputs:
|
||||
let
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
@@ -18,24 +17,23 @@
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forEachSupportedSystem =
|
||||
f:
|
||||
inputs.nixpkgs.lib.genAttrs supportedSystems (
|
||||
system:
|
||||
|
||||
forEachSupportedSystem = f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (system:
|
||||
f {
|
||||
pkgs = import inputs.nixpkgs {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
inputs.self.overlays.default
|
||||
];
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
inherit system;
|
||||
}
|
||||
);
|
||||
|
||||
in
|
||||
{
|
||||
overlays.default = final: prev: {
|
||||
rustToolchain =
|
||||
with inputs.fenix.packages.${prev.stdenv.hostPlatform.system};
|
||||
with fenix.packages.${prev.stdenv.hostPlatform.system};
|
||||
combine (
|
||||
with stable;
|
||||
[
|
||||
@@ -48,47 +46,38 @@
|
||||
);
|
||||
};
|
||||
|
||||
packages = forEachSupportedSystem ({ pkgs }: {
|
||||
default =
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "my-rust-project"; # Change to your Cargo.toml [package] name if different
|
||||
version = "0.1.0"; # Change to your Cargo.toml [package] version
|
||||
packages = forEachSupportedSystem ({ pkgs, system }:
|
||||
{
|
||||
default = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "my-rust-project"; # change if needed
|
||||
version = "0.1.0"; # change if needed
|
||||
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
# If you have additional lock files (e.g., for alternative registries), add them here
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
openssl
|
||||
];
|
||||
|
||||
# Optional: for faster iterative development, you can copy artifacts from cargo
|
||||
# doCheck = false; # if you want to skip tests during nix build
|
||||
nativeBuildInputs = with pkgs; [ pkg-config ];
|
||||
buildInputs = with pkgs; [ openssl ];
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "My Rust project";
|
||||
license = licenses.mit; # Adjust as needed
|
||||
mainProgram = "whereAmI"; # Optional: name of the main binary for nix run
|
||||
license = licenses.mit;
|
||||
mainProgram = "whereAmI";
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
apps = forEachSupportedSystem ({ pkgs }: {
|
||||
default = {
|
||||
type = "app";
|
||||
program = "${pkgs.default}/bin/whereAmI"; # or self.packages.${pkgs.system}.default
|
||||
};
|
||||
});
|
||||
apps = forEachSupportedSystem ({ pkgs, system }:
|
||||
{
|
||||
default = {
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.default}/bin/whereAmI";
|
||||
};
|
||||
});
|
||||
|
||||
devShells = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
devShells = forEachSupportedSystem ({ pkgs, system }:
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
@@ -100,12 +89,11 @@
|
||||
cargo-watch
|
||||
rust-analyzer
|
||||
];
|
||||
|
||||
env = {
|
||||
# Required by rust-analyzer
|
||||
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user