vlaci / openconnect-sso

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

Installation via Nix overlay does not work on NixOS 20.09 #51

Closed jherland closed 3 years ago

jherland commented 3 years ago

Trying to install openconnect-sso via home-manager on my NixOS 20.09 (the current stable NixOS version) like this:

{ pkgs, ...}:
{
  nixpkgs.overlays = [
    (import "${builtins.fetchTarball https://github.com/vlaci/openconnect-sso/archive/master.tar.gz}/overlay.nix")
  ];
  home.packages = with pkgs; [ openconnect-sso ];
}

fails (after lots of build activity with:

Processing ./openconnect_sso-0.7.1-py3-none-any.whl
...
ERROR: Could not find a version that satisfies the requirement keyring<23.0.0,>=21.1 (from openconnect-sso==0.7.1) (from versions: none)
ERROR: No matching distribution found for keyring<23.0.0,>=21.1 (from openconnect-sso==0.7.1)
builder for '/nix/store/35r2gwjkp2srq1z4xgnrli6xss1vhllz-python3.8-openconnect-sso-0.7.1.drv' failed with exit code 1
...

I don't immediately see why this should fail. If I nix-shell -p python38Packages.keyring on my NixOS 20.09 I get keyring v21.3.1 which should satisfy openconnect-sso's requirement. I've tried this on a couple of machines, and also via home-manager or from /etc/nixos/configuration.nix, still with the same build failure.

There are multiple workarounds:

For now I am running with this (which works well for me):

{ pkgs, ...}:

let
  openconnect-sso-src = builtins.fetchTarball "https://github.com/vlaci/openconnect-sso/archive/master.tar.gz";
  unstablePkgs = import <nixos-unstable> {
    overlays = [
        (import "${openconnect-sso-src}/overlay.nix")
    ];
  };

in
{
  home.packages = [ unstablePkgs.openconnect-sso ];
}
vlaci commented 3 years ago

I think I have found a workaround. Python dependency handling is... weird to say the least and when it interacts with Nix it gets even weirder.

jherland commented 3 years ago

Brilliant! 0.7.2 works perfectly here.