vlaci / openconnect-sso

Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs
GNU General Public License v3.0
299 stars 131 forks source link

not able to install on NixOS #186

Open turbotimon opened 3 weeks ago

turbotimon commented 3 weeks ago

I tried all the possibilities on the README

The easiest method to try is by installing directly:

$ nix-env -i -f https://github.com/vlaci/openconnect-sso/archive/master.tar.gz
installing 'python3.11-openconnect-sso-0.8.1'
trace: warning: `pythonForBuild` (from `python*`) has been renamed to `pythonOnBuildForHost`
trace: warning: `pythonForBuild` (from `python*`) has been renamed to `pythonOnBuildForHost`

RAM gets completely full (32GB), nothing happens..

An overlay is also available to use in nix expressions: My shell.nix looks like:

# shell.nix
let
openconnectOverlay = import (builtins.fetchTarball "https://github.com/vlaci/openconnect-sso/archive/master.tar.gz") + "/overlay.nix";
pkgs = import <nixpkgs> { overlays = [ openconnectOverlay ]; };
in
pkgs.mkShell {
# Now pkgs.openconnect-sso will be available in the shell environment.
buildInputs = [ pkgs.openconnect-sso ];
}

Same error and behaviour like above

I also tried pipx but that does not work on nix because of PyQt6 can't be installed the normal way.

Anyone can help to fix this?

NixOS Version 24.05

jkenda commented 6 days ago

I'm getting in the same situation with the nix-env method but with the second method I actually get a build error:

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/wcfpskhg6pnwhxdyjaranxmz2h7310j8-nixos-24.05/nixos/pkgs/stdenv/generic/make-derivation.nix:333:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'

         at /nix/store/wcfpskhg6pnwhxdyjaranxmz2h7310j8-nixos-24.05/nixos/pkgs/stdenv/generic/make-derivation.nix:380:7:

          379|       depsHostHost                = elemAt (elemAt dependencies 1) 0;
          380|       buildInputs                 = elemAt (elemAt dependencies 1) 1;
             |       ^
          381|       depsTargetTarget            = elemAt (elemAt dependencies 2) 0;

       error: poetry2nix is now maintained out-of-tree. Please use https://github.com/nix-community/poetry2nix/

My NixOS version is also 24.05.

arthur-d42 commented 3 days ago

You need to add the community maintained version of poetry2nix to pkgs

I added this to my inputs:

poetry2nix = {
            url = "github:nix-community/poetry2nix/2024.5.939250";
            inputs.nixpkgs.follows = "nixpkgs";
          };

And made the packages

        config = { 
          allowUnfree = true;
          packageOverrides = _: {
          poetry2nix = poetry2nix.lib.mkPoetry2Nix { inherit pkgs; };
          };
         };

Then i also had an issue where a python didn't build because it required a higher version of another - this is fixed if you get the overlay from my fork

https://github.com/arthur-d42/openconnect-sso/

turbotimon commented 2 days ago

@arthur-d42 thanks for your message! I'm not exactly sure where to put the config = part. Do you mind share the whole shell.nix? (btw, your link does not point to the link text)