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