Skip to content
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

Nix #138

Open
peterc-s opened this issue Mar 12, 2024 · 13 comments
Open

Nix #138

peterc-s opened this issue Mar 12, 2024 · 13 comments
Labels
bug Something isn't working needs testing question Further information is requested

Comments

@peterc-s
Copy link

Is there a plan to have an official nixpkg? New to nix and liked using goldwarden before so would be nice. Flatpak seems a bit broken on nix as I can't seem to login and when I did login I was unable to get browser biometrics working.

@quexten
Copy link
Owner

quexten commented Mar 12, 2024

NixOS/nixpkgs#278362

As far as I understand the PR added the package (at least the CLI)? I'm not super familiar with Nix,
but aside from that what's missing?

Or do you mean the UI? I believe @SuperSandro2000 was looking into packaging the UI for Nix a while ago, but this depends on #134 which I have not gotten around to looking at yet.

@quexten
Copy link
Owner

quexten commented Mar 12, 2024

I wonder what the issue with the Flatpak is on Nix. A bunch of issues regarding Flatpak isolation in different environments have already been fixed, but it seems some still remain.

@quexten quexten added bug Something isn't working question Further information is requested needs testing labels Mar 12, 2024
@peterc-s
Copy link
Author

NixOS/nixpkgs#278362

As far as I understand the PR added the package (at least the CLI)? I'm not super familiar with Nix,
but aside from that what's missing?

Or do you mean the UI? I believe @SuperSandro2000 was looking into packaging the UI for Nix a while ago, but this depends on #134 which I have not gotten around to looking at yet.

I couldn't find it on search.nixos.org so it might be a thing. UI seems a bit buggy for me, doesn't let me login and gives "bad password" and then the UI just stops updating for whatever reason.

If I knew how to build a nixpkg I would give it a shot, probably something I could do though (not with the UI though, probably just the CLI with daemon)

@SuperSandro2000
Copy link
Contributor

As far as I understand the PR added the package (at least the CLI)? I'm not super familiar with Nix,
but aside from that what's missing?

The GUI and the a module to connect all the bits and pieces. I am working on both currently.

Or do you mean the UI? I believe @SuperSandro2000 was looking into packaging the UI for Nix a while ago, but this depends on #134 which I have not gotten around to looking at yet.

My works doesn't strictly depend on that. I ended up just packing the paths but that's ugly and not that maintainable.

I wonder what the issue with the Flatpak is on Nix. A bunch of issues regarding Flatpak isolation in different environments have already been fixed, but it seems some still remain.

First of all it is unnecessarily big compared to naive libraries and lacks integration for polkit, browser extension, etc.

Also on NixOS Goldwarden cannot just write to any path it wants, even with sudo. For example the polkit file must be placed with the module system.

@peterc-s
Copy link
Author

I wonder what the issue with the Flatpak is on Nix. A bunch of issues regarding Flatpak isolation in different environments have already been fixed, but it seems some still remain.

Nix does structure a lot of things very differently to other OS' - I don't know why I was able to login once and access my vault and all that but now when I try to login it wont work. Have tried using the flatpak CLI to set the keys and tried using both standard login and API keys on the GUI and was unable to login.

@SuperSandro2000
Copy link
Contributor

The PR is at NixOS/nixpkgs#293117

@woolmonkey
Copy link

Everything works fine for me except browser biometrics.

@SuperSandro2000
Copy link
Contributor

I did not finish the work on that. I have some experience getting it to work with kdeconnect and a vim integration both with native code pieces, so I am confident I can fix it when I find the time.

@jakobkukla
Copy link

jakobkukla commented Jul 2, 2024

I just attempted to write a home-manager module for goldwarden. The goal is to be able to configure the server urls and the email address declaratively. Currently, I find it difficult to write a maintainable module because goldwarden relies on a lot of setup commands to populate the config file.

Most nixos/home-manager modules "manage" the program's config file (by simply linking a read-only config to .config or wherever the program stores its config files). In the case of goldwarden, this is not feasible because goldwarden mixes configuration variables like urls with state variables like tokens and updates the config file with these state variables at runtime.

Would you consider moving the state variables somewhere else so that the config file is something that could theoretically be read-only? On another note, is there a reason why the email address is not set in the config file? I guess it's not needed for successive logins, but it would be nice to have it there. Thanks a lot!

Just for reference: In theory the resulting home-manager module could be similiar to rbw's module: rbw.nix

EDIT: I just noticed this wiki page: wiki/Configuring-the-Daemon. Maybe these environment variables will be enough to implement this. Sorry for the noise!

@quexten
Copy link
Owner

quexten commented Jul 3, 2024

@jakobkukla All good, let me know in case the env variables do not work out and I can take a look at what can be done to make nix support easier.

@drainpixie
Copy link

Any info on this?
Using the latest home-manager goldwarden package I get the following error when trying to setup polkit via goldwarden setup polkit on Gnome

akemi@timeline:~/d/puella $ goldwarden setup polkit
panic: exit status 1

goroutine 1 [running]:
github.com/quexten/goldwarden/cli/cmd.setupPolkit()
	github.com/quexten/goldwarden/cli/cmd/setup_linux.go:49 +0x46f
github.com/quexten/goldwarden/cli/cmd.init.func24(0xc00018b300?, {0x938225?, 0x4?, 0x9380fd?})
	github.com/quexten/goldwarden/cli/cmd/setup_linux.go:81 +0xf
github.com/spf13/cobra.(*Command).execute(0xce5e00, {0xd825c0, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0xce49e0)
	github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:1039
github.com/quexten/goldwarden/cli/cmd.Execute({{0x0, 0x0}, 0x0, {0xc000028f90, 0x2e}, 0x0, 0x0, {0x0, 0x0}, {0x0, ...}, ...})
	github.com/quexten/goldwarden/cli/cmd/root.go:29 +0xe6
main.main()
	github.com/quexten/goldwarden/main.go:54 +0x618

Panicking after this pkexec call:

command := exec.Command("pkexec", "mv", "/tmp/goldwarden-policy", "/usr/share/polkit-1/actions/com.quexten.goldwarden.policy")

I believe this is due to the nature of NixOS; /usr/share simply isn't a thing and "hard-coding" the path just doesn't work.
Has anyone got it to work or is it just an isolated issue?

@xusiai
Copy link

xusiai commented Oct 24, 2024

Has anyone got it to work or is it just an isolated issue?

Experiencing this on NixOS as well.

@poopsicles
Copy link

@drainpixie @xusiai i initially tried just adding the goldwarden package with home-manager, but ran into the same issues as you, but then found the NixOS module which sets up the service amongst other things.

After enabling that and following the Getting Started - Logging In steps (set pin, get secrets, login), the GUI application works (I'm sure you could probably use the GUI to do the logging in, but it kept throwing up "this application isn't responding" messages even though it was just...working)

I'm sure a home-manager module that does the same is possible, and @jakobkukla did some work on that, but seems to have abandoned it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs testing question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants