How to install wallabag-client

I’d like to install wallabag-client from here: GitHub - artur-shaik/wallabag-client: Command line client for the self hosted read-it-later app Wallabag

The install instructions are as follows:

pip3 install wallabag-client

This gives the following error:

error: externally-managed-environment

× This environment is externally managed
╰─> This command has been disabled as it tries to modify the immutable
    `/nix/store` filesystem.

I am using home-manager and flakes. Is there an alternative solution to install this package?

See Python - NixOS Wiki.
You could for example try to:

  • package the application yourself: See this section of Nixpkgs manual, then use the nix derivation (for example in devShells); or
  • create a virtual environment with python, then use pip to install in that virtual environment

OK. Thanks very much for that. Unfortunately, it’s just a bit beyond me to implement. Too many concepts are still too foreign to me for this to make sense.

In the simplest form you only need 4 commands:

# install python3
nix shell 'nixpkgs#python3'
# create a virtual environment
python3 -m venv .venv
# activate it
source .venv/bin/activate
# install with pip
pip3 install wallabag-client

Thanks for this. I think it worked as you intended. wallabag-client installed properly and seems to work. But it seems to be limited to this virtual environment that you had me set up.

I want to be able to call wallabag-client from within my browser, so it needs to always be available. How can I achieve that?

OK. Switching gears…

Maybe this is easier: GitHub - Nepochal/wallabag-cli: Wallabag-cli is a command line client for the self hosted read-it-later app wallabag.

This project does the same thing, but includes a binary. I tried running the binary and got this:

Could not start dynamically linked executable: ./wallabag
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld

What is the easy :wink: way to get this working?

You might also try using pipx, it will manage a Python virtual environment behind the scenes

1 Like

pipx is a good solution here. (add pipx to home.packages)

the other nix specific solution would be to write package derivation for these repos and callPackage them in your home-manager and add those to home.packages.

look at nix-community/nix-init if you are interested in writing nix derivations.

The “easy” way is to package it so that it continues to work going forward. Using pip, etc. will risk breakages.

I second the nix-init recommendation to create a package expression (say, mypackage.nix) then you can add it to some package list (pkgs.callPackage ./path/to/mypackage.nix {}).

If you’re stuck at that point, you’re welcome to ask.

1 Like

pipx solved my problem.

This is a very frustrating, difficult to learn distro. Luckily this is a great community.

Thanks everyone.

Yeah, I should had prefaced my recommendation with “pipx is an easy button but will most likely break the installed package at some point”. When (not if) that happens, you could just reinstall the wallabag client package, assuming you add pipx to your Nix packages. By “breaking” I don’t mean anything catastrophic, but rather python will most likely complain about a missing module and refuse to do anything.

True, but stick around – it’s worth it :wink:

@waffle8946 , you are not wrong, that would be the most stable solution and, hey, one that could even be contributed back to nixpkgs.

However I (as respectfully as possible :slight_smile: ) disagree with making such recommendation in the context of this thread.
IMHO writing one’s first nix package expression is not easy at all; especially when they are also hitting that first cliff of the learning curve

I would never claim it’s easy, but this is a help forum, we should be here to help.

And this beginner stage is exactly where it is most appropriate to point out that the correct way to run programs on NixOS is to package them - otherwise people come away with the belief that NixOS is somehow “broken” rather than a result of using the tools incorrectly.

Besides, nix-init actually does get you 90% of the way there (depending on the ecosystem, python here is well supported). And python is well-known in the community, so they will get answers if they ask, it’s not like I’m telling them to go package something in some obscure language.

1 Like

There really is no “easy way”, and what you mean is perhaps more like “familiar way”.
This is why I put that wiki link first: NixOS is different from other distributions, and our approaches to problems are different.
I would recommend considering this as a great opportunity to learn how to do things in the “Nix” way.

1 Like