This commit is contained in:
2026-02-28 22:44:47 +00:00
parent 53b7fcde22
commit 4d159ca256
10 changed files with 2353 additions and 0 deletions

19
.direnv/bin/nix-direnv-reload Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/mrfluffy/Documents/projects/rust/woosmaps_fallback" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/mrfluffy/Documents/projects/rust/woosmaps_fallback")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi
# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/mrfluffy/Documents/projects/rust/woosmaps_fallback" true
# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/mrfluffy/Documents/projects/rust/woosmaps_fallback/.envrc"
# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/mrfluffy/Documents/projects/rust/woosmaps_fallback/.envrc" "/home/mrfluffy/Documents/projects/rust/woosmaps_fallback/.direnv"/*.rc

View File

@@ -0,0 +1 @@
/nix/store/anbs72p9zzvyk3a227k0zmas73l56gxl-source

View File

@@ -0,0 +1 @@
/nix/store/jadhwjnrpcyjkyn0qhxa7kcm09g73miz-source

View File

@@ -0,0 +1 @@
/nix/store/w0x3nihmdb6cwdqh0i0h4fs95alvv770-source

View File

@@ -0,0 +1 @@
/nix/store/zkrz054gvl1dcxkw25d8lgx8l10px665-source

View File

@@ -0,0 +1 @@
/nix/store/hl1342yac266lnn8j3xlc22ffihskkn9-nix-shell-env

File diff suppressed because it is too large Load Diff

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

63
flake.lock generated Normal file
View File

@@ -0,0 +1,63 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1769929675,
"narHash": "sha256-EBpe7sXCPLs+qVePXbA7kc+Kmpmp0pWysEpjjEWTK+E=",
"rev": "78d518f5ca32a86dc767de481160dbae640c70cf",
"revCount": 2542,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/nix-community/fenix/0.1.2542%2Brev-78d518f5ca32a86dc767de481160dbae640c70cf/019c1851-0ed1-7f81-b175-8e8bbad651e6/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/nix-community/fenix/0.1"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1771848320,
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
"revCount": 953160,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.953160%2Brev-2fc6539b481e1d2569f25f8799236694180c0993/019c8e05-d2f6-7c7e-9ead-612154b18bfb/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1"
}
},
"root": {
"inputs": {
"fenix": "fenix",
"nixpkgs": "nixpkgs"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1769857242,
"narHash": "sha256-3eKpRRzKz0KzY7CJzRXFm4POwEqbuTohyQ2ajI/zKvg=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "17304e9c7e11d26139672d3d77aa498b1cae0d69",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

105
flake.nix Normal file
View File

@@ -0,0 +1,105 @@
{
description = "A Nix-flake-based Rust development environment";
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; # unstable Nixpkgs
fenix = {
url = "https://flakehub.com/f/nix-community/fenix/0.1";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, ... }@inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.self.overlays.default
];
};
}
);
in
{
overlays.default = final: prev: {
rustToolchain =
with inputs.fenix.packages.${prev.stdenv.hostPlatform.system};
combine (
with stable;
[
clippy
rustc
cargo
rustfmt
rust-src
]
);
};
packages = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.rustPlatform.buildRustPackage {
pname = "woosmaps_fallback";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
openssl
];
};
}
);
apps = forEachSupportedSystem (
{ pkgs }:
{
default = {
type = "app";
program = "${self.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/woosmaps_fallback";
};
}
);
devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShell {
packages = with pkgs; [
rustToolchain
openssl
pkg-config
cargo-deny
cargo-edit
cargo-watch
rust-analyzer
];
env = {
# Required by rust-analyzer
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
};
};
}
);
};
}