!9IQChSjwSHXPPWTa:lix.systems

Lix

1124 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms304 Servers

Load older messages


SenderMessageTime
16 May 2024
@raitobezarius:matrix.orgraitobezariusno worries13:17:39
@raitobezarius:matrix.orgraitobezarius the way to verify is to run the copying path .* from .*lix as a regex on the file 13:17:55
@raitobezarius:matrix.orgraitobezariusi had no hit so I was wondering if you were worried over the "test queries"13:18:10
@sigmanificient:matrix.org@sigmanificient:matrix.orgwhy is it raining on the chat>13:36:48
@sigmanificient:matrix.org@sigmanificient:matrix.org * why is it raining on the chat?13:36:51
@ar:is-a.cat@ar:is-a.cat
In reply to@sigmanificient:matrix.org
why is it raining on the chat?
element, at least the web version, has animations that show up when someone's using some emoji symbols. unicode snowflake symbol is among them
13:37:51
@ar:is-a.cat@ar:is-a.catso, with me having the snowflake symbol in my display name, and people highlighting me, you can expect to see snowfall animations :313:38:27
@sigmanificient:matrix.org@sigmanificient:matrix.orgšŸ˜…13:38:37
@ar:is-a.cat@ar:is-a.catā„ļø13:38:51
@olafklingt:matrix.org@olafklingt:matrix.org left the room.15:15:52
@toastal:mozilla.orgtoastal-matrix-sucks nix flake update pre-commit-hooks now has the flake-utils dependency dropped to lighten the dependency load. 15:21:30
@ff-vringar:mozilla.orgvringar

Hey,
I thought overrideAttrs was an unintrusive way to patch a package, however when I build my package.nix

{ ghidra, 
  # can be overridden with `yourPackage.override { enableSomething = true; }`
  username ? "vringar"
}:
ghidra.overrideAttrs (finalAttrs: previousAttrs: {
            postInstall = previousAttrs.postInstall or "" + ''
            cat <<'EOF' >>$out/lib/ghidra/support/launch.properties
            # Username
            VMARGS=-Duser.name=${username}
            EOF
            '';
          }
)

But if I then try to call an attribute that was defined like this

  passthru = {
    inherit releaseName distroPrefix;
    inherit (ghidra-extensions) buildGhidraExtension buildGhidraScripts;

    withExtensions = callPackage ./with-extensions.nix { };
  };

I get the error attribute 'withExtensions' missing.
Am I override this wrong or are passthrough properties magic in some way?

17:56:20
@ff-vringar:mozilla.orgvringar *

Hey,
I thought overrideAttrs was an unintrusive way to patch a package, however when I build my package.nix

{ ghidra, 
  # can be overridden with `yourPackage.override { enableSomething = true; }`
  username ? "vringar"
}:
ghidra.overrideAttrs (finalAttrs: previousAttrs: {
            postInstall = previousAttrs.postInstall or "" + ''
            cat <<'EOF' >>$out/lib/ghidra/support/launch.properties
            # Username
            VMARGS=-Duser.name=${username}
            EOF
            '';
          }
)

But if I then try to call an attribute that was defined like this

  passthru = {
    inherit releaseName distroPrefix;
    inherit (ghidra-extensions) buildGhidraExtension buildGhidraScripts;

    withExtensions = callPackage ./with-extensions.nix { };
  };

I get the error "attribute 'withExtensions' missing".
Am I overriding this wrong or are passthrough properties magic in some way?

17:56:41
@ff-vringar:mozilla.orgvringar *

Hey,
I thought overrideAttrs was an unintrusive way to patch a package, however when I build my package.nix with pkgs.callPackage ./package.nix { }

{ ghidra, 
  # can be overridden with `yourPackage.override { enableSomething = true; }`
  username ? "vringar"
}:
ghidra.overrideAttrs (finalAttrs: previousAttrs: {
            postInstall = previousAttrs.postInstall or "" + ''
            cat <<'EOF' >>$out/lib/ghidra/support/launch.properties
            # Username
            VMARGS=-Duser.name=${username}
            EOF
            '';
          }
)

But if I then try to call an attribute that was defined like this

  passthru = {
    inherit releaseName distroPrefix;
    inherit (ghidra-extensions) buildGhidraExtension buildGhidraScripts;

    withExtensions = callPackage ./with-extensions.nix { };
  };

I get the error "attribute 'withExtensions' missing".
Am I overriding this wrong or are passthrough properties magic in some way?

17:58:05
@qyriad:katesiria.orgQyriad Passthru properties get applied to the final package attrset by mkDerivation — before mkDerivation has finished happening, any passthru attrs will only be available as passthru.foo 17:59:12
@qyriad:katesiria.orgQyriad * Passthru properties get applied to the final package attrset by mkDerivation. before mkDerivation has finished happening, any passthru attrs will only be available as passthru.foo 17:59:27
@ff-vringar:mozilla.orgvringar

I'm not quite sure I'm able to get from this information to my solution.
What I tried was

let
          pkgs = nixpkgs.legacyPackages.${system};
          patchedGhidra = pkgs.callPackage ./package.nix { };
          ghidraWithExtensions = patchedGhidra.passthru.withExtensions([]);
18:02:13
@qyriad:katesiria.orgQyriad it's something like this:
mkDerivationĀ =Ā attrs: let
Ā Ā /*Ā allĀ ofĀ theĀ normalĀ mkDerivationĀ magicĀ hereĀ */
  withoutPassthru = builtins.removeAttrs attrs [ "passthru" ]
in
Ā Ā (builtins.derivationĀ withoutPassthru)Ā //Ā attrs.passthru                    
18:02:19
@ff-vringar:mozilla.orgvringar *

I'm not quite sure I'm able to get from this information to my solution.
What I tried was

let
          pkgs = nixpkgs.legacyPackages.${system};
          patchedGhidra = pkgs.callPackage ./package.nix { };
          ghidraWithExtensions = patchedGhidra.passthru.withExtensions([]);
in
...
18:02:23
@ff-vringar:mozilla.orgvringar

But I still get

error:
       … while evaluating the attribute 'passthru.withExtensions'
         at /nix/store/m5mzlpqf5ya3gwg0r56x5xdvvv7wnp3v-source/pkgs/stdenv/generic/make-derivation.nix:630:14:
          629|
          630|      inherit passthru overrideAttrs;
             |              ^
          631|      inherit meta;

       error: attribute 'withExtensions' missing
       at /nix/store/y0dzij82im47vr6pi1ffzz8xjax10hj5-source/flake.nix:15:34:
           14|           patchedGhidra = pkgs.callPackage ./package.nix { };
           15|           ghidraWithExtensions = patchedGhidra.passthru.withExtensions
             |                                  ^
           16|             (p: with p; [

18:02:53
@ff-vringar:mozilla.orgvringar *

I'm not quite sure I'm able to get from this information to my solution.
What I tried after reading your message was:

let
          pkgs = nixpkgs.legacyPackages.${system};
          patchedGhidra = pkgs.callPackage ./package.nix { };
          ghidraWithExtensions = patchedGhidra.passthru.withExtensions([]);
in
...
18:04:50
@ff-vringar:mozilla.orgvringar I'm assuming mkDerivation is invoked by callPkg (? Big uncertainty)
So afterwards the attribute should be available?
18:06:52
@mjm:midna.devmjmOnly if package.nix calls it18:09:01
@mjm:midna.devmjmcallPackage just handles passing arguments to the function in the file you give (package.nix in this case)18:09:46
@ff-vringar:mozilla.orgvringar
In reply to @ff-vringar:mozilla.org

Hey,
I thought overrideAttrs was an unintrusive way to patch a package, however when I build my package.nix with pkgs.callPackage ./package.nix { }

{ ghidra, 
  # can be overridden with `yourPackage.override { enableSomething = true; }`
  username ? "vringar"
}:
ghidra.overrideAttrs (finalAttrs: previousAttrs: {
            postInstall = previousAttrs.postInstall or "" + ''
            cat <<'EOF' >>$out/lib/ghidra/support/launch.properties
            # Username
            VMARGS=-Duser.name=${username}
            EOF
            '';
          }
)

But if I then try to call an attribute that was defined like this

  passthru = {
    inherit releaseName distroPrefix;
    inherit (ghidra-extensions) buildGhidraExtension buildGhidraScripts;

    withExtensions = callPackage ./with-extensions.nix { };
  };

I get the error "attribute 'withExtensions' missing".
Am I overriding this wrong or are passthrough properties magic in some way?

Okay, and since this is my entire file I should do a mkDerivation on the outputs of the overrideAttrs call?
18:10:32
@ff-vringar:mozilla.orgvringar
In reply to @ff-vringar:mozilla.org

Hey,
I thought overrideAttrs was an unintrusive way to patch a package, however when I build my package.nix with pkgs.callPackage ./package.nix { }

{ ghidra, 
  # can be overridden with `yourPackage.override { enableSomething = true; }`
  username ? "vringar"
}:
ghidra.overrideAttrs (finalAttrs: previousAttrs: {
            postInstall = previousAttrs.postInstall or "" + ''
            cat <<'EOF' >>$out/lib/ghidra/support/launch.properties
            # Username
            VMARGS=-Duser.name=${username}
            EOF
            '';
          }
)

But if I then try to call an attribute that was defined like this

  passthru = {
    inherit releaseName distroPrefix;
    inherit (ghidra-extensions) buildGhidraExtension buildGhidraScripts;

    withExtensions = callPackage ./with-extensions.nix { };
  };

I get the error "attribute 'withExtensions' missing".
Am I overriding this wrong or are passthrough properties magic in some way?

* Okay, and so I should do a mkDerivation on the outputs of the overrideAttrs call?
18:10:47
@mjm:midna.devmjmno18:10:58
@mjm:midna.devmjmThe original package is calling mkDerivation then18:11:30
@mjm:midna.devmjmsorry I’m on mobile, my ability to help is limited18:12:14
@ff-vringar:mozilla.orgvringarNo need to apologize šŸ’™ thanks for taking the time to help18:12:54

There are no newer messages yet.


Back to Room ListRoom Version: 10