Skip to content

Conversation

@coxla1
Copy link

@coxla1 coxla1 commented Nov 30, 2025

I was trying to build this on NixOS with a recent protobuf version, but got failures. According to this issue, there have been changes with libUPB and protobuf, such that looking for gRPC libraries will fail with UPB targets not yet defined. A description of the issue and a temporary workaround were proposed here, which I added to SNFM.

@coxla1
Copy link
Author

coxla1 commented Nov 30, 2025

Nix package declaration

  • SNFM
{
  lib,
  stdenv,
  fetchFromGitHub,
  pkgs,
  ...
}:
stdenv.mkDerivation rec {
  pname = "snfm";
  version = "1.0.6";

  src = fetchFromGitHub {
    owner = "coxla1";
    repo = "snfm";
    # rev = "v${version}";
    rev = "df3f7a365d793b493a0705d3f04a66087996c087";
    hash = "sha256-SLHKtU4/G4sG8chXpijESU7Jc/Z9lbEXVEYiZJzBM6k=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = with pkgs; [cmake pkg-config copyDesktopItems];
  buildInputs = with pkgs; [pkgsStatic.protobuf grpc yaml-cpp wxGTK32];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    mkdir -p $out/share
    cp manage_files $out/bin/snfm-manage-files
    cp send_file $out/bin/snfm-send-file
    cp snfm_user_manual.md $out/share
    cp snfm_config_example.yaml $out/share
    runHook postInstall
  '';

  desktopItems = pkgs.makeDesktopItem {
    name = pname;
    desktopName = "Super Nintendo File Manager";
    exec = "snfm-manage-files";
  };
}
  • SNI
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  notray ? false,
  ...
}: let
  commit = "9ef83c5";
  # commitDate = "2025-05-11T23:22:00";
in
  buildGoModule rec {
    pname = "sni";
    version = "0.0.101";

    src = fetchFromGitHub {
      owner = "alttpo";
      repo = "sni";
      rev = "v${version}";
      hash = "sha256-ETmNL1FV2FgdIpBqNFH03Xtck3EkMUh7SBWBMb4NVDU=";
    };

    vendorHash = "sha256-KC2EdcsVOCjWDO4aEzSFdHbLvshhbBKpPJVoYVRHL7Q=";

    tags = lib.optionals notray ["notray"];
    ldflags = [
      "-w"
      "-X main.version=${src.rev}"
      "-X main.commit=${commit}"
      # "-X main.date=${commitDate}"
    ];

    installPhase = ''
      mkdir -p $out/bin
      mkdir -p $out/lib/udev/rules.d
      cp $GOPATH/bin/sni $out/bin
      cp linux/udev/rules.d/51-fxpak.rules $out/lib/udev/rules.d
    '';
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant