NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.15k stars 13.42k forks source link

Package `arcan` and `durden` #49626

Closed colemickens closed 3 years ago

colemickens commented 5 years ago

Package Request

Anyone want to collaborate? I will try my hand at packaging it in a bit, and will probably add it to the wayland/windowmanager overlay I'm maintaining along with a nixpkgs PR if I get it working.

gazally commented 5 years ago

I've succeeded in building and running Arcan and Durden. The package definition for Arcan works but I'm sure there are things in the closure that don't belong (X11?). I started with Void Linux's dependency list and kept adding things cmake complained about until it built.

Getting it running was challenging because it depends on a bunch of environment variables being set correctly and neither the error messages or the documentation are all that clear. It also wants its binary to be SUID. Here's what I've been doing while working on the package and figuring out how to run the binary:

From a virtual terminal:

$ nix-build '<nixpkgs>' -A arcan -I nixpkgs=/path/to/my/branch
$ sudo cp result/bin/arcan .
$ sudo chmod +s arcan
$ ./arcan durden

Here are my settings for the environment variables:

export ARCAN_APPLBASEPATH=$HOME/.config/arcan/appl
export ARCAN_APPLSTOREPATH=$HOME/.config/arcan/store
export ARCAN_RESOURCEPATH=$HOME/files
export ARCAN_BINPATH=$PWD/result/bin/arcan_frameserver
export ARCAN_SCRIPTPATH=$PWD/result/share/arcan/scripts
export ARCAN_LOGPATH=$HOME/.config/arcan/logs
export ARCAN_STATEPATH=$HOME/.config/arcan/state
export ARCAN_FONTPATH=/run/current-system/sw/share/X11-fonts

I created all the directories in $HOME which are referenced in the variables.

I don't have a package for Durden. I installed it by cloning it off github and then making a symbolic link to its durden subdirectory from $HOME/.config/arcan/appl.

I'm running this on a laptop with Intel graphics, and have been working on it in a virtual terminal with my x session left running in another. The one time I switched back to xserver without killing arcan first, it hung my laptop.

colemickens commented 5 years ago

That is great to hear @gazally, thank you for sharing. I'm pretty occupied right now with some traveling, but I'll try to take a look at this soon. Thank you for writing it up though, I'm sure someone will stumble on that and be thankful too!

EDIT: oops, I thought this was on a different repo, I probably would've worded this differently otherwise. Either way, still excited to see this. :)

gazally commented 5 years ago

I've added a draft package for Xarcan and am typing this in Firefox running in an X server in a window on Arcan.

The package definition builds an executable called Xarcan and you can invoke it from a shell prompt in a Durden window to run it. To run a second instance, use Xarcan :1. To start an application or window manager in the X server from a shell prompt, set DISPLAY first as in DISPLAY=:0 awesome. It doesn't automatically detect when its window size changes, but xrandr works.

The font path part of the derivation isn't right. I made two attempts at making it work and left them both in the derivation. The code in preConfigure puts a font path into the configure flag provided for that purpose, but the resulting executable can't find the fonts. The other chunk of code in postInstall links fonts into the derivation, and that part gets the truetype fonts to work but not the bitmap fonts. I'm happy to run xterm -fa FreeMono so I stopped there, but someone who knows more about X fonts than me should take a look.

gazally commented 5 years ago

I was curious about the various Arcan tools (clipboard, image viewer, network proxy, wayland bridge) so I packaged them. There had been a lot of change in the tools directory between the last release and master, so I packaged the tools from master. So the latest commit in my branch adds arcan-unstable, xarcan-unstable and several child packages under arcanTools-unstable.

I haven't figured out how to get the Wayland bridge to work, but I wasn't using Wayland before this so may be missing something obvious.

I have been running arcan-unstable and xarcan-unstable with Durden on my laptop for about a week now and am finding it very usable and stable.

egasimus commented 4 years ago

Hey there @colemickens and @gazally! Wish I had found this thread earlier. I had a go at packaging Arcan at egasimus/arcan-nix. It builds, however it still has some rough edges at runtime (most glaringly, mouse and keyboard don't work if not running as root - addressing that now).

I'm going to study what the two of you have discovered so far, and maybe we can join forces in bringing this very interesting piece of software to the Nix ecosystem.

gazally commented 4 years ago

Hey @egasimus! I've just updated my branch with a commit to make it build more recent versions of arcan and Xarcan. I've had no problems with arcan 0.6.0-pre2 but the recent Xarcan litters the screen with mouse cursor trails.

It would be great to get it running not as root so keep us posted on your progress.

gazally commented 4 years ago

To get the keyboard and mouse to work when not running as root, just add the user running arcan to the input group.

egasimus commented 4 years ago

@gazally thanks, that worked!

I brushed the dust off my Arcan/Nix code just to try out your suggestion. Now I have Arcan, its core utilities and the example compositors (except safespaces which fails to find something or other) running on my system, including a terminal - one more thing to run besides startx, sway, or fbterm in a vanilla console! Neat!

I skipped the whole overlays thing and ended up with a file that can be submitted to Nixpkgs (or imported into environment.systemPackages=[(pkgs.callPackage (import ./Arcan.nix) {})]). Guess I should share that part of my config as a gist or something before submitting a PR?

Or is there something missing, as might be suggested by https://gist.github.com/telent/4a92294a767656759959006fe8440122?

Food for thought a.k.a. "and then what?":

egasimus commented 4 years ago

Gist: https://gist.github.com/egasimus/0254dcd67f95f262aa6e133794738392

(Sure is cool how Durden and Prio have different mouse capture behavior btw)

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

terlar commented 3 years ago

There is still some good progress over at the gist.

abathur commented 3 years ago

I found this while looking into a new project (pipeworld, https://github.com/letoram/pipeworld) posted to lobste.rs today. (By same developers as arcan, and uses arcan, so I was curious if we had it packaged.) Just cross-referencing on the off-chance it helps anyone here. I'll also add this to the gist.