-
-
Notifications
You must be signed in to change notification settings - Fork 380
Launching editor fails with nix shell on arch linux #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This error usually comes from Edit: no, it is not. |
I looked at the code where this error comes from and it seems that I was wrong about |
interesting, i use alsa as well as x11. it has probably something to do with my nix configuration, as everything works without the nix shell. thanks for the response though! if you prefer to, you can close the issue, i mostly opened it so that you know that something might be up with the provided shell.nix |
Try using Wayland, it might fix the issue. I remember someone in Discord server mentioned that switching to Wayland helps. |
@NandorKovacs can you try running the editor under {
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
rust-overlay,
...
}:
let
overlays = [
(import rust-overlay)
];
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f:
nixpkgs.lib.genAttrs systems
(system: f { pkgs = import nixpkgs { inherit system overlays; }; });
in
{
devShells = forAllSystems ({ pkgs }: with pkgs; {
default = mkShell rec {
buildInputs = [
rust-bin.stable.latest.default
pkg-config
xorg.libxcb
alsa-lib
wayland
libxkbcommon
libGL
];
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
};
});
};
} |
Sure! Should I add the flake to the main repo as well? It would be a small change (two files, plus a few lines in the gitignore), and it's what I've been using for working on the engine; I just haven't been adding them to git. |
I'm not quite sure. I don't know much about nixOS and its way of making configs and stuff, how this flake works exactly? |
The two main files are flake.nix and flake.lock. They're more or less the equivalent of Cargo.toml/Cargo.lock, except instead of just managing Rust packages they can also manage system libraries and other dependencies. Using either a flake or a shell.nix file is the standard way to set up dev environments with Nix, since otherwise it has trouble locating dynamically linked libraries and other packages in the $PATH. You can look at helix for an example of a large Rust project using a flake. I already posted the flake.nix file above; here's the corresponding flake.lock: {
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1739866667,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1740074384,
"narHash": "sha256-T2eO9ognlph94/TyAu1uILo38fZG1G4S5FQxG+YBDv0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d291a120b6524911249b198baf3ec3e07ff57e04",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
} |
Cool, today I learned something new. Feel free to make a PR with it as you proposed. |
Will do, thank you! Im currently on vacation, im gonna test it in a day or two. |
This is probably an error on my end.
I got the editor working, however not using the provided shell.nix. I was happy i didn't have to search what the package names on arch are, and just tried using the provided nix shell.
However, when using the provided shell.nix, launching the editor with
RUST_BACKTRACE=full cargo run --package fyroxed
results in the following stack trace:I am unsure what i am doing wrong. I tested my nix setup, and packages do seem to work. I am however using arch linux, maybe it would work on NixOS?
The text was updated successfully, but these errors were encountered: