| 16 May 2024 |
raitobezarius | no worries | 13:17:39 |
raitobezarius | the way to verify is to run the copying path .* from .*lix as a regex on the file | 13:17:55 |
raitobezarius | i had no hit so I was wondering if you were worried over the "test queries" | 13:18:10 |
@sigmanificient:matrix.org | why is it raining on the chat> | 13:36:48 |
@sigmanificient:matrix.org | * why is it raining on the chat? | 13:36:51 |
@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 | so, with me having the snowflake symbol in my display name, and people highlighting me, you can expect to see snowfall animations :3 | 13:38:27 |
@sigmanificient:matrix.org | š
| 13:38:37 |
@ar:is-a.cat | āļø | 13:38:51 |
| @olafklingt:matrix.org left the room. | 15:15:52 |
toastal-matrix-sucks | nix flake update pre-commit-hooks now has the flake-utils dependency dropped to lighten the dependency load. | 15:21:30 |
vringar | 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 |
vringar | * 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 |
vringar | * 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 | 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 | * 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 |
vringar | 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 | 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 |
vringar | * 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 |
vringar | 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 |
vringar | * 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 |
vringar | I'm assuming mkDerivation is invoked by callPkg (? Big uncertainty) So afterwards the attribute should be available? | 18:06:52 |
mjm | Only if package.nix calls it | 18:09:01 |
mjm | callPackage just handles passing arguments to the function in the file you give (package.nix in this case) | 18:09:46 |
vringar | 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 |
vringar | 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 | no | 18:10:58 |
mjm | The original package is calling mkDerivation then | 18:11:30 |
mjm | sorry Iām on mobile, my ability to help is limited | 18:12:14 |
vringar | No need to apologize š thanks for taking the time to help | 18:12:54 |