| 22 Mar 2025 |
K900 | You can and it is in fact how cache.nixos.org works | 15:38:42 |
gumby0811 | my inspiration kind of came from nix-snapshotter.. but it depends on Nix to be available on the host... I thought maybe something like this would allow to decouple that requirement. I don't know this all my might be just an academic exploration to teach me Rust.. thank you for the knowledge | 15:42:19 |
griff | gumby0811: it depends where you want to sit in the stack. If you just want to make something that Nix can substitute from and copy NAR files to that is pretty simple. You either implement two types of endpoints on a HTTP server or S3 server. Most binary caches do this. If you want to talk to the Nix daemon directly or want to implement a remote builder of some kind you need the daemon protocol and no complete implementation of that exists in Rust. Harmonia has some client stuff, Snix/Twix has some server stuff, Tweag did a nix-remote crate that also implements some of it and Gorgon can work as a proxy so has some client an server stuff. Lastly I would be remiss to not mention my own implementation of some of the daemon protocol Nix.rs. | 16:41:48 |
griff | If you need to make NAR files on the fly or need to read an write them there is a sync impl on crates last I looked and i know that Snix has sync and async impls and Nix.rs has an old async one. | 16:45:00 |
griff | For a HTTP cache that makes NAR files on the fly you would also need to deal with Narinfo files. Snix has a parser for them but it is a pretty simple text format in the style of "key: value\n" | 16:48:26 |
gumby0811 | thanks! | 17:19:34 |
| vaw joined the room. | 21:25:44 |
| 23 Mar 2025 |
Toma | In reply to @tomasajt:matrix.org Some feedback would be appreciated for https://github.com/NixOS/nixpkgs/pull/390171 ideally, this should go into the current staging cycle Looking for some feedback on this.
It un-breaks a few packages, including rustdesk* | 10:37:54 |
K900 | LGTM | 10:40:36 |
K900 | But I don't understand it super well | 10:40:47 |
| 24 Mar 2025 |
Toma | Btw what do you all think about still keeping fetchCargoTarball around?
Just in case fetchCargoVendor is incapable of doing something it might be useful.
Though we'd probably want to make it clear that there are no hash stability guarantees. | 11:36:58 |
K900 | I'd rather not have two ways of doing the same thing | 11:39:49 |
K900 | If fetchCargoVendor can't do something, it should be fixed | 11:40:04 |
emily | I think it would be an attractive nuisance to keep | 11:42:03 |
emily | especially since it'd probably require maintenance for future versions of the format anyway? | 11:42:53 |
Toma | I guess people can just copy the implementation out of tree if they really wanted to use it. | 13:03:22 |
| @aloisw:julia0815.de joined the room. | 17:31:26 |
@aloisw:julia0815.de | It seems that rustc.doc lost the standard library documentation somewhere in staging-next 2025-03-03. Is that issue known? | 17:47:24 |
| 25 Mar 2025 |
damccull | Hello. Trying to set up a new bevy project in a flake. Getting this error:
target/debug/bevy-tut: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory
With this flake:
{
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable";
};
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
surrealdb-gh.url = "github:surrealdb/surrealdb/v2.1.4";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem =
{
config,
self',
pkgs,
lib,
system,
...
}:
let
runtimeDeps = with pkgs; [
alsa-lib
libxkbcommon
udev
vulkan-loader
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
];
buildDeps = with pkgs; [
clang
lld
lldb
pkg-config
rustPlatform.bindgenHook
stdenv.cc.cc.lib
# (wasm-bindgen-cli.overrideAttrs (oldAttrs: rec {
# version = "0.2.100";
# src = fetchCrate {
# pname = "wasm-bindgen-cli";
# version = version;
# hash = "sha256-3RJzK7mkYFrs7C/WkhW9Rr4LdP5ofb2FdYGz1P7Uxog=";
# };
#
# cargoDeps = rustPlatform.fetchCargoVendor {
# inherit src;
# inherit (src) pname version;
# hash = "sha256-qsO12332HSjWCVKtf1cUePWWb9IdYUmT+8OPj/XP2WE=";
# };
# }))
];
devDeps =
with pkgs;
[
# Libraries and programs needed for dev work; included in dev shell
# NOT included in the nix build operation
bacon
bashInteractive
bunyan-rs
cargo-deny
cargo-edit
cargo-expand
cargo-msrv
cargo-nextest
(cargo-whatfeatures.overrideAttrs (oldAttrs: rec {
version = "0.9.13";
src = fetchCrate {
pname = "cargo-whatfeatures";
version = "${version}";
hash = "sha256-Nbyr7u47c6nImzYJvPVLfbqgDvzyXqR1C1tOLximuHU=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
inherit (src) pname version;
hash = "sha256-p95aYXsZM9xwP/OHEFwq4vRiXoO1n1M0X3TNbleH+Zw=";
};
}))
gdb
just
nushell
panamax
zellij
]
++ [
inputs.surrealdb-gh.packages.${system}.default
];
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
msrv = cargoToml.package.rust-version;
rustPackage =
features:
(pkgs.makeRustPlatform {
cargo = pkgs.rust-bin.stable.latest.minimal;
rustc = pkgs.rust-bin.stable.latest.minimal;
}).buildRustPackage
{
inherit (cargoToml.package) name version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildFeatures = features;
buildInputs = runtimeDeps;
nativeBuildInputs = buildDeps;
# Uncomment if your cargo tests require networking or otherwise
# don't play nicely with the nix build sandbox:
# doCheck = false;
};
ldpath = with pkgs; [
stdenv.cc.cc.lib
];
mkDevShell =
rustc:
pkgs.mkShell {
shellHook = ''
# TODO: figure out if it's possible to remove this or allow a user's preferred shell
exec env SHELL=${pkgs.bashInteractive}/bin/bash zellij --layout ./zellij_layout.kdl
'';
LD_LIBRARY_PATH = lib.makeLibraryPath ldpath;
GIO_MODULE_DIR = "${pkgs.glib-networking}/lib/gio/modules/";
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
buildInputs = runtimeDeps;
nativeBuildInputs = buildDeps ++ devDeps ++ [ rustc ];
};
rustTargets = [
"x86_64-unknown-linux-gnu"
"x86_64-linux-android"
"aarch64-linux-android"
"wasm32-unknown-unknown"
];
rustExtensions = [
"rust-analyzer"
"rust-src"
];
in
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
config = {
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) ([
"surrealdb"
]);
android_sdk.accept_license = true;
};
};
packages.default = self'.packages.base;
devShells.default = self'.devShells.stable;
packages.base = (rustPackage "");
packages.bunyan = (rustPackage "bunyan");
packages.tokio-console = (rustPackage "tokio-console");
devShells.nightly = (
mkDevShell (
pkgs.rust-bin.selectLatestNightlyWith (
toolchain:
toolchain.default.override {
extensions = rustExtensions;
targets = rustTargets;
}
)
)
);
devShells.stable = (
mkDevShell (
pkgs.rust-bin.stable.latest.default.override {
extensions = rustExtensions;
targets = rustTargets;
}
)
);
devShells.msrv = (
mkDevShell (
pkgs.rust-bin.stable.${msrv}.default.override {
extensions = rustExtensions;
targets = rustTargets;
}
)
);
};
};
}
Really not sure why since I have udev in the place it's supposed to be according to bevy docs, and I've tried it in all the places I can think of anyways. Suggestions?
| 00:49:39 |
damccull | Ah, nevermind. It was an LD_PATH issue. | 01:23:03 |
damccull | * Ah, nevermind. It was an LD_LIBRARY_PATH issue. | 01:23:16 |
Ralith | sounds like they're using dlopen when they should be linking | 02:45:09 |
Toma | There are a few packages (around 3) still using the first cargo lockfile format in-tree, so I made this
https://github.com/NixOS/nixpkgs/pull/393016 | 12:41:11 |
K900 | Can we just delete them instead lol | 12:42:00 |
emily | we already removed tons of packages for that | 12:43:10 |
emily | are the remaining ones that important? | 12:43:20 |
emily | kubernix looks like something that probably won't even work any more and that is likely using ancient/insecure versions if it does | 12:44:25 |
Toma | okay, I don't really care if it doesn't get merged,
the main thing is that the PR exists so in case someone really wants it they can take the changes | 12:46:13 |
K900 | What's the packages? | 12:46:44 |
K900 | Do we have a list? | 12:46:52 |