zulip desktop - Nix

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Mason Mackaman

So I just got myself setup on NixOS and I'm trying to get the Zulip desktop app up and running. The unstable version didn't work for me but luckily the stable version did. however, I can't log in because it looks like nixos prevents zulip from affecting my browser, and therefore I can't get the login token :thinking:

Torsten Schmits

how do you figure that nixos is preventing that?

Mason Mackaman

well first I get this image.png

then I hit continue and get this image.png

Torsten Schmits

huh. maybe the brave-browser.desktop file is buggy and that's why kde wants to update it?

Torsten Schmits

as a workaround, you could try copying the desktop file to ~/.local/share...

Torsten Schmits

maybe it will be earlier in the search path

Torsten Schmits

just tried it, works for me with firefox. typing this from the app

Torsten Schmits

if you set the default browser in kde to firefox, it might just work

Mason Mackaman

just downloaded firefox, it's not giving me the option to set it as a default in the gui (doesn't show up). do you happen to know where the configuration file is?

Torsten Schmits

start systemsettings and search for default. in Applications there's an item Web Browser

Mason Mackaman

hm I saw the option to just set it to a command in the gui, but firefox didn't work. started the app but it crashed before it did anything

Torsten Schmits

does firefox work on its own?

Torsten Schmits

hm. maybe try setting the whole path from which firefox

Mason Mackaman

alright well the gui updated to show firefox as an option. I'm gonna try that real quick

Mason Mackaman

damn, still just crashes. I mean, I'm assuming that's what's happening. I'm seeing the tab show up in the bar at the bottom but I never see a window, then it goes away.

Torsten Schmits

try running it from a terminal

Torsten Schmits

I assume that's what you meant is crashing, yes

Torsten Schmits

just to see if there's any output

Torsten Schmits

or just look at journalctl

Mason Mackaman

oh, no, firefox is crashing when zulip tries to activate it. zulip is fine

Mason Mackaman

wow wtf, when I run zulip from the terminal, it tries to use brave again

Torsten Schmits

you did install firefox from nixpkgs, right?

Mason Mackaman

when I run it from the app menu, where it doesn't even have an app. I just click Run zulip, so I figured it would be the same, it tries firefox

Torsten Schmits

hm, there's an app in the menu here

Mason Mackaman

I installed the nixos version. I'm assuming that's still considered nixpkgs

Torsten Schmits

yep. what version of nixos?

Mason Mackaman

also I have a zulip desktop app in my applications folder, it just takes an indeterminate amount of time for that to show up in the app panel (or whatever that panel is called)

Torsten Schmits

maybe you should reboot to ensure the environment in kde is up to date

Mason Mackaman

to be clear, I have installed everything from nix

Mason Mackaman

maybe you should reboot to ensure the environment in kde is up to date

do you think a log out - log in would do the trick?

Torsten Schmits

also look for firefox crash messages in journalctl

Mason Mackaman

oof, logged back in and my desktop is completely frozen save my mouse

Mason Mackaman

any way to get to a terminal or do I just gotta press and hold the power button?

Torsten Schmits

maybe the problem lies deeper than zulip :skull:

Torsten Schmits

depends on your system, there's ctrl-f1 and alt-sysrq alt-k

Mason Mackaman

dope, ctr-alt-f1 did the trick

Torsten Schmits

ah, just remembered you were the one starting linux with nixos :laughter_tears:

Torsten Schmits

btw. freezes occuring when restarting the desktop environment aren't uncommon, especially with nvidia cards

Mason Mackaman

I tried out manjaro because it [starting from nixos] seemed to difficult, got my dev tools via pacman, then I realized I could just try to do that process again using nix. and once I did that I was like oh, well I guess I might as well use nixos now.

Mason Mackaman

in other news, upon restart my brave app in the favorites section was replaced be firefox :thinking:

Torsten Schmits

run in a terminal: journalctl -xe -b and see if there's an error message from firefox

Torsten Schmits

also try rm -r ~/.config/Zulip

Mason Mackaman

it's just filled to the brim with errors from the second I did the command and the second before

Mason Mackaman

nope, just Sep 16 19:35:07 nixos xsession[1003]: org.kde.baloo.engine: PositionDB::put MDB_BAD_TXN: Transaction must abort, has a child, or is invalid over and over again

Torsten Schmits

that's just some unrelated kde stuff

Mason Mackaman

well I feel like it's stopping us from seeing any firefox errors cuz it just gets filled with that

Torsten Schmits

is firefox already running while your starting zulip?

Mason Mackaman

why is my system constantly erroring ...

Mason Mackaman

I tried that once, it just tried to start a new firefox and crashed like before

Torsten Schmits

Torsten Schmits said:

also try rm -r ~/.config/Zulip

did you do that?

Torsten Schmits

and what happens now if you run zulip from the terminal?

Mason Mackaman

well currently that baloo thing is taking up 80% of the CPU and my computer's fan is goin nuts, I have no idea what's goin on

Mason Mackaman

I will try that in a second

Torsten Schmits

baloo is a file indexer, it probably scans your home directory

Mason Mackaman

I typed kill 1211, idk if that's the right syntax but it seemed to stop it

Torsten Schmits

you can do pkill -9 -f baloo

Mason Mackaman

aaaanyway, okay, I deleted that folder, I will try again and let you know if there's any error messages

Mason Mackaman

this appears to be the relevant error

Sep 16 19:44:35 nixos xsession[1003]: XPCOMGlueLoad error for file /nix/store/qpcggj45i1lvk9vfz3f29fz8finxlriw-firefox-unwrapped-80.0/lib/firefox/libxul.so:
Sep 16 19:44:35 nixos xsession[1003]: /usr/lib/libnss3.so: version `NSS_3.55' not found (required by /nix/store/qpcggj45i1lvk9vfz3f29fz8finxlriw-firefox-unwrapped-80.0/lib/firefox/libxul.so)
Sep 16 19:44:35 nixos xsession[1003]: Couldn't load XPCOM.
Torsten Schmits

could be something. try going to an https page in firefox

Mason Mackaman

https://nixos.org/ no issue

Torsten Schmits

Torsten Schmits said:

and what happens now if you run zulip from the terminal?

what about this?

Mason Mackaman

well it tries to use firefox now instead of brave, but still the same behaviour

Torsten Schmits

interestingly, when I run zulip from the terminal it starts with an empty window

Mason Mackaman

I'm running version 5.0.0

Torsten Schmits

oops, now also from kde

Torsten Schmits

looks like there's already an issue on github
https://github.com/NixOS/nixpkgs/issues/97646

Describe the bug When opening Zulip on recent nixos-unstable, the application starts, but the only display is a completely grey window. Things were fine a couple of weeks ago – for example at commi...
Torsten Schmits

I guess it's not that reliable yet on nixos

Mason Mackaman

what version are you using? cuz the unstable version was a blank screen for me

Torsten Schmits

btw zulip has a debug flag, try running zulip -d

Mason Mackaman

the stable version opens fine

Torsten Schmits

before I used 20.03 and everything worked

Mason Mackaman

zulip -d didn't make a difference (no new terminal output)

Mason Mackaman

also for some reason when I run it from the terminal, no error messages regarding firefox are in the journal

Mason Mackaman

I guess I have no idea how that works so maybe that's supposed to happen

Mason Mackaman

one thing I'm curious about is why does it give me that security prompt when I try using brave, but not firefox? (the one before there's an error about not be able to write)

Mason Mackaman

no, the KIO client popup

Mason Mackaman

it says, This will start the program ... If you do not trust this program, click Cancel

Torsten Schmits

I guess firefox is trusted implicitly

Mason Mackaman

so I guess I'm a zulip web user till further notice?

Torsten Schmits

btw. the zulip version in 20.03 tells me that it is insecure to use and I should update

Torsten Schmits

it certainly looks like it

Mason Mackaman

oh... haven't got that far :,(

Mason Mackaman

did you have unstable working before?

Torsten Schmits

no, I first tried stable, that worked, then unstable, which doesn't

Mason Mackaman

oh, so are you just using the web?

Mason Mackaman

or on a different machine?

Torsten Schmits

yeah, had no idea there was a desktop app

Mason Mackaman

aight, nix-env -e time, thanks for the help

Torsten Schmits

if you installed the apps with nix-env, it might be worth a try to do it in /etc/nixos

Mason Mackaman

if you installed the apps with nix-env

is there another way?

it might be worth a try to do it in /etc/nixos

I don't really understand this

Torsten Schmits

right, you have to put this in /etc/nixos/configuration.nix:

environment.systemPackages = [pkgs.firefox pkgs.zulip];
Mason Mackaman

also totally unrelated, do you know what the % things are in the app commands, for example, my neovim app's command is nvim %F and I see a lot of others that end in %U

Torsten Schmits

those get substituted with certain arguments passed to the app running component of kde

Torsten Schmits

the %F probably is the filename that you clicked on in some file browser

Mason Mackaman

right, you have to put this in /etc/nixos/configuration.nix

and then run nixos-rebuild switch?

Mason Mackaman

I thought that just installed the stable version of that package for every user. how could it make a difference here?

Mason Mackaman

maybe I'm thinking of the wrong field

Torsten Schmits

no idea, but it is the difference between your system and mine, where it works :smile:

Mason Mackaman

alrighty, worth a shot. why did you put them there btw? is it a thing to want to install apps there vs using nix-env?

Torsten Schmits

it is generally more comfortable to do it declaratively rather than imperatively with nix-env, since you can easily restore an identical system with just the config files

Torsten Schmits

and tbh I have no idea what happens on a nixos-rebuild with packages installed with nix-env, I never do that

Mason Mackaman

I thought the user environment was just another declarative layer on top of the system one

Mason Mackaman

man does nixos-rebuild always fetch everything fresh from the cache? all of this stuff should already be in my store :thinking:

Mason Mackaman

that moment when you wait so long for it to finish only to realized you didn't sudo it

Torsten Schmits

it shouldn't, unless you updated a channel, did a garbage collect or have an override in the config. but if you removed the packges with nix-env, maybe it auto-garbage collected

Mason Mackaman

here's something very confusing, I thought those packages always pulled from the latest stable packages, but I saw zulip 5.4.0 in the stream of text

Torsten Schmits

nope, it pulls whatever version is used in the snapshot you have locally. to get the latest, you have to do a nix-channel --update

Mason Mackaman

so because my personal account has the unstable channel, it installed 5.4 instead of 5.0?

Mason Mackaman

well, I give up, firefox still just crashed

Torsten Schmits

you'll have to wait until unstable is fixed I guess

Torsten Schmits

or someone else comes up with an idea :smile:

Torsten Schmits

after reading the 200 messages in this thread

Mason Mackaman

lmao, at least there's still a chance of that happening cuz zulip is awesome. on slack it would be gone forever before long

tristanC

Reading such thread is not fun, a condensed summary would be useful :-). Isn't it possible to use a stable channel just for the zulip env?

Torsten Schmits

yes, the problem was that the stable version couldn't open the browser, which the unstable version starts with a blank window.

Mason Mackaman

I'm pretty sure when I put zulip in my config (as opposed to using nix-env) it used the unstable version (5.4) and when I tried it I actually didn't get the blank screen that time (I did get the blank screen before when using nix-env). however my browser still wouldn't cooperate.

Torsten Schmits

https://github.com/NixOS/nixpkgs/issues/97646#issuecomment-706306340

Describe the bug When opening Zulip on recent nixos-unstable, the application starts, but the only display is a completely grey window. Things were fine a couple of weeks ago – for example at commi...