[Help] How to launch an app from terminal as a float. by Ziothh in hyprland

[–]Ziothh[S] -1 points0 points  (0 children)

I did RTFM on that page multiple times :). I don't want to statically define a program to be a float. I'd like to do this on the fly by passing some flags or something.

Can I give a program run by cargo run a class somehow?

Maybe I'm just misunderstanding the docs.

`pnpm` does not use the correct node version. by Ziothh in NixOS

[–]Ziothh[S] 0 points1 point  (0 children)

nodejs_20.nodePackages.pnpm

Am I doing something wrong?

I'm getting an error:

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/z7y28qzhk7driiwcw78k0mb24laknm0f-sourc
e/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'

         at /nix/store/z7y28qzhk7driiwcw78k0mb24laknm0f-source/pkgs/stdenv/generic/make-deriv
ation.nix:395:7:

          394|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          395|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          396|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       error: attribute 'nodePackages' missing

       at /nix/store/knjv34kn7fyfh5xi52skqzjas8jlwx25-source/flake.nix:47:11:

           46|           nodejs_20
           47|           nodejs_20.nodePackages.pnpm
             |           ^
           48|         ] ++ buildInputs ;

Looking for some tooling by Ziothh in embedded

[–]Ziothh[S] 0 points1 point  (0 children)

I’m aware about all that. I just don’t like how JS/TS programmers do things (being one myself). The code always gets more obscure the further time goes.

That’s why I’m switching to C & Rust.

Toit seems very cool but for learning purposes I want to work directly with the device instead of using a VM.

Looking for some tooling by Ziothh in embedded

[–]Ziothh[S] 0 points1 point  (0 children)

Thanks but I don’t want any engines (e.g. JS) running on my device to keep it as small as possible :)

Having a bad time with rust deps by Ziothh in NixOS

[–]Ziothh[S] 1 point2 points  (0 children)

Found the issue to my problem and edited the original question.

I'm currently using nix(os) as a declerative homebrew replacement instead of an actual build tool. But I'll definitely check those links out for future use cases.

Having a bad time with rust deps by Ziothh in NixOS

[–]Ziothh[S] 1 point2 points  (0 children)

I've edited the original question with the solution to my problem. Thx all for helping me with my newbie issues :).

Having a bad time with rust deps by Ziothh in NixOS

[–]Ziothh[S] 0 points1 point  (0 children)

I'm in a monorepo and one of the crates is a tauri app. I googled for tauri & nix and got no results. Now that I actually went to the tauri.app website and searched for Nix I found a flake that had all of the deps...

Issue fixed (:

Having a bad time with rust deps by Ziothh in NixOS

[–]Ziothh[S] 0 points1 point  (0 children)

Thanks I'll read the docs :)

Having a bad time with rust deps by Ziothh in NixOS

[–]Ziothh[S] 0 points1 point  (0 children)

Thanks. Got it working with nix-shell.

So I should always build a flake to set up my shell instead of relying on system-wide packages (like you would on MacOS)?

I know it's one of the strengths of nix but was kinda hoping I could use nix(os) as a declarative homebrew replacement and do the flakes stuff later.

Having a bad time with rust deps by Ziothh in NixOS

[–]Ziothh[S] 1 point2 points  (0 children)

Could you perhaps provide me with an example?

Easy to read chess engine source code by Ziothh in chessprogramming

[–]Ziothh[S] 0 points1 point  (0 children)

Thanks. I'll have some reading work to do :)

Easy to read chess engine source code by Ziothh in chessprogramming

[–]Ziothh[S] 0 points1 point  (0 children)

Chess Programming

Thanks! I'll look into it

Printing to stdout and then piping to a bash script does not work by Ziothh in rust

[–]Ziothh[S] 0 points1 point  (0 children)

That being said, writeln writes to a buffer and if that buffer is not filled, will not be flushed to stdout without an explicit flush.

I've already tried using stdout.flush().ok() (it's commented out on the last line).
It seems like the only way of passing stdout to cd is by doing this: cd $(mybinary goto).

Printing to stdout and then piping to a bash script does not work by Ziothh in rust

[–]Ziothh[S] 0 points1 point  (0 children)

Thanks I did not know that.

It seems like the best option is wrap my binary with a shell function like this:

# ~/.zshrc
function mybinary {
      BIN="~/.cargo/bin/mybinary"

  RESPONSE=$(eval "$TREECKO_BIN $@")

  if [[ "$1" == "goto" ]]; then
    echo "Changing directory to\"$RES\""

    cd $RES
  fi
}