!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

465 Members
Rust111 Servers

Load older messages


SenderMessageTime
4 Sep 2024
@emilazy:matrix.orgemily
        clippy = config.packages.default.overrideAttrs (prevAttrs: {
          name = "clippy-check";

          nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ pkgs.clippy ];

          dontBuild = true;

          checkPhase = ''
            runHook preCheck
            cargo clippy
            runHook postCheck
          '';

          installPhase = ''
            runHook preInstall
            touch $out
            runHook postInstall
          '';
        });
02:04:12
@emilazy:matrix.orgemily not very pretty, but it seems nicer since it works with buildInputs etc. 02:04:23
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯
nixos login: root (automatic login)
User not known to the underlying authentication module

I'm amazed that that is possible.

03:52:30
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯ I was thinking I could do some fun networking experiments with containers = listToAttrs (genList (idx: { name = "c${toString idx}"; value = /* some container config */; };) 100);, but the time this takes to evaluate is ridiculous. 04:49:14
@prism019:matrix.orgPrism019Redacted or Malformed Event05:25:39
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯Yay, https://github.com/NixOS/nixpkgs/blob/12228ff1752d7b7624a54e9c1af4b222b3c1073b/nixos/modules/virtualisation/nixos-containers.nix#L846-L847 doesn't escape the interface names, so if your interface has a -, the container won't start..05:26:10
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯* Yay, https://github.com/NixOS/nixpkgs/blob/12228ff1752d7b7624a54e9c1af4b222b3c1073b/nixos/modules/virtualisation/nixos-containers.nix#L846-L847 doesn't escape the interface names, so if your interface has a -, the container won't start.. (Time to write a bug report…)05:26:26
@prism019:matrix.orgPrism019Apologies for that, phone was unlocked in my pocket.05:28:59
@julius:mtx.liftm.deˈt͡sɛːzaɐ̯ ("Talk to the hand" was common phrase in my school days to shut someone up. Now I talked to the butt. ;)) 05:32:56
@justastream:matrix.orgStream joined the room.09:45:15
@justastream:matrix.orgStreamhey friends09:45:22
@justastream:matrix.orgStream

I'm really hoping some of you have the technical know-how to help me here, because I really don't want to uninstall NixOs!

For simplicity, all I want is a global install of rustup or oxalica/rust-overlay so I can write Rust code again!

I've got Rust compiling in shell.nix but I'm keen on a global install (I'm a full time Rust engineer) that plays nice with my RustRover IDE.

Setup:

  • OS: NixOs
  • Flakes: enabled
  • IDE: RustRover

Can someone please please help me? I took two days off this week to contribute to OSS and all I've managed is to beat my head against a Nix wall 🙏

09:58:00
@k900:0upti.meK900 Generally, adding rustup to environment.systemPackages should mostly work 09:58:42
@k900:0upti.meK900But also, generally, you don't actually want a system-wide install09:58:54
@justastream:matrix.orgStream

Oh, forgot to add, my "rustup environment.systemPackages" doesn't work because:

  The system library `openssl` required by crate `openssl-sys` was not found.
  The file `openssl.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `openssl.pc`.


  --- stderr
  thread 'main' panicked at /home/justastream/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.103/build/find_normal.rs:190:5:


  Could not find directory of OpenSSL installation, and this `-sys` crate cannot
  proceed without this knowledge. If OpenSSL is installed and this crate had
  trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
  compilation process.

  Make sure you also have the development packages of openssl installed.
  For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

  If you're in a situation where you think the directory *should* be found
  automatically, please open a bug at https://github.com/sfackler/rust-openssl
  and include information about your system as well as this message.

  $HOST = x86_64-unknown-linux-gnu
  $TARGET = x86_64-unknown-linux-gnu
  openssl-sys = 0.9.103


  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
10:00:14
@k900:0upti.meK900That's not a rustup issue10:00:23
@k900:0upti.meK900That's basically the reason you don't want a system-wide install10:00:34
@k900:0upti.meK900It's trying to find openssl, which is a C library10:00:41
@k900:0upti.meK900Which is generally not something Nix is designed to provide access to system-wdie10:00:53
@k900:0upti.meK900* Which is generally not something Nix is designed to provide access to system-wide10:00:55
@justastream:matrix.orgStream

In order to satisfy the requirements, I added all the deps system wide that I did to get my shell.nix to work:

rustup 
openssl
openssl.dev
pkg-config
clang
llvmPackages.bintools 
libiconv
gcc
clang
10:02:31
@k900:0upti.meK900Yeah, the problem is that it will not set up the environment correctly10:02:44
@k900:0upti.meK900For those things to actually be findable10:02:48
@k900:0upti.meK900 Because adding things to environment.systemPackages and adding them to a dev shell's inputs doesn't actually do the same thing 10:03:03
@justastream:matrix.orgStreamI'm open to a non-system wide install but so far all I've managed to get working is shell.nix and I can't get that to work with RustRover10:03:05
@k900:0upti.meK900They are subtly different10:03:09
@k900:0upti.meK900You probably want to use direnv for IDE integration10:03:34
@k900:0upti.meK900See https://direnv.net/10:03:40
@k900:0upti.meK900And https://plugins.jetbrains.com/plugin/15285-direnv-integration for JetBrains stuff specifically10:04:21
@k900:0upti.meK900 Then you can just put use nix in your .envrc 10:04:29

Show newer messages


Back to Room ListRoom Version: 6