oidc-agent icon indicating copy to clipboard operation
oidc-agent copied to clipboard

Package for the nix packaging system

Open v1kko opened this issue 1 year ago • 3 comments

I created a package such that I can work with oidc-agent on my system. please see the derivation below. I hope it is useful for others that wish to install it on a nix system.

{ lib, stdenv, fetchFromGitHub, curl, webkitgtk, libmicrohttpd, libsecret, qrencode, libsodium, pkg-config, help2man }:

stdenv.mkDerivation rec {
  pname = "oidc-agent";
  version = "5.1.0";

  src = fetchFromGitHub {
    owner = "indigo-dc";
    repo = "${pname}";
    rev = "v${version}";
    sha256 = "sha256-cOK/rZ/jnyALLuhDM3+qvwwe4Fjkv8diQBkw7NfVo0c="
    ;
  };

  buildInputs = [
    pkg-config
    help2man
  ];
  nativeBuildInputs = [
    curl
    webkitgtk
    libmicrohttpd
    libsecret
    qrencode
    libsodium
  ];

  installPhase = ''
    make install_bin PREFIX=$out BIN_PATH=$out
    make install_lib PREFIX=$out LIB_PATH=$out/lib
    make install_conf install_bash install_scheme_handler install_xsession_script PREFIX=$out
  '';
  postFixup = ''
    cp -r $out/bin/* bin
    make install_man PREFIX=$out
  '';


  meta = with lib; {
    description = "oidc-agent for managing OpenID Connect tokens on the command line";
    homepage = "https://github.com/indigo-dc/oidc-agent";
    maintainers = [ ];
    license = licenses.mit;
  };
}

v1kko avatar Mar 20 '24 10:03 v1kko

Cool, thanks; I'll keep this open until I get to packaging again.

Could you recommend me a docker image to use with building nix packages?

marcvs avatar Mar 22 '24 04:03 marcvs

I will look into setting up a pipeline for this (also out of my own interest).

v1kko avatar Mar 26 '24 09:03 v1kko

Would it be possible to consider adding this to nixpkgs? I noticed that there are users requesting oidc-agent on the forum (https://discourse.nixos.org/t/managing-openid-connect-tokens/24743). Additionally, we could include a NixOS module to make usage easier.

xinyangli avatar Jun 15 '24 06:06 xinyangli

It seems that this has been added to nixpkgs, so I guess we can close this. Thanks to @xinyangli and @v1kko

zachmann avatar Jul 24 '24 07:07 zachmann