Proper way to run git version of app outside of nix develop

Hi,

I rely on netexec in my work. 1.4.0 is broken for one of my usecases and I need 1.5.0, but nix maintainer did not yet provide it. My first approach was to create such override:

environment.systemPackages = [
  (pkgs.netexec.overrideAttrs (oldAttrs: {
    version = "1.5.0";
    src = pkgs.fetchFromGitHub {
      owner = "Pennyw0rth";
      repo = "NetExec";
      rev = "v1.5.0";
      hash = "sha256-...";
    };
  }))
];

Unfortunately this breaks due to the fact original nix package relies on nix supplied version of impacket which it patches and I don’t even want to think what other issues will I run into trying to unravel this. I was able to get around that by using this ugly flake:

{
  description = "NetExec development environment";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    {
      self,
      nixpkgs,
      flake-utils,
    }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in
      {
        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            python314
            poetry
            pipx
            openssl
          ];

         
        };
      }
    );
}

And running pipx install . inside netexec repo from within nix develop shell. This is OK for desperate patching, when under pressure, but it’s extremely annoying due to the fact nix develop uses vanilla bash. Is there a dead easy way, like a wrapper pkgs.justMakeItWorkFromPipx I could use to make a quick and dirty package? Or at least make the stuff built inside nix develop available as system-wide binary so I can run it in my normal shell configuration as if it was a part of the system (this would be preferable to avoid untangling issues with poetry2reasonablepackagemanagementsystem issues)?

Just to clarify: don’t care even if every single dependency is duplicated or other things are unoptimal. Just want a procedure to follow next time in such situation - preferably if it was agnostic to python :slight_smile:

Thanks in advance :smiley:

The package update to 1.5.0 was merged 2 days ago.

See it’s progress through the channels.

1 Like

Thanks @NobbZ ! I’ll just patch is from PR for now.

Still - would be very grateful for hints to make such ad-hoc software run. It still is beneficial for me to keep system clean - it will just get garbage collected :slight_smile:

If an override as you did doesn’t work, I am almost always ending up updating nixpkgs directly if no PR exists. If one exists I usually copy the expression until available in the channels.

If it’s about downgrade rather than upgrade, and overrides don’t work, I also copy an older expression from nixpkgs and use that.

If dependencies don’t play well with the situation, then things get hairy. Usually that is when I say to myself that no one will notice that I’m running foo 1.2.3 rather than 1.1.0.

1 Like