| 6 Mar 2026 |
alexfmpe | trying to build pkgsStatic.perl on aarch64-darwin gives me
/nix/store/3zrx6av2d1141igkcn8477cvbfqpcmcf-bash-5.3p9/bin/bash: line 1: ranlib: command not found | 11:55:40 |
alexfmpe | and sure enough, ranlib is present in nix-shell for perl but not pkgsStatic.perl | 11:56:10 |
alexfmpe | is this expected? intended? | 11:56:26 |
symphorien | it's probably prefixed, as it is cross | 13:00:05 |
symphorien | maybe replace by $RANLIB | 13:00:22 |
| ragdoc joined the room. | 15:12:36 |
ragdoc | Greetings. I am currently struggling with getting a package.nix I created tied into my nix-darwin flake.nix. Is this documented somewhere I might have missed? I can build the package manually, but I would prefer to have that happen as part of each darwin-rebuild operation. | 15:20:39 |
samasaur | as in you have a package.nix file and you have a packages flake output that calls that package, so you can nix build it, but you want to know how to call that package from your nix-darwin configuration? | 15:22:28 |
samasaur | probably easiest is to just pkgs.callPackage ./relative/path/to/package.nix but you can get it from the flake output with something like inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-package | 15:23:38 |
ragdoc | As in: I can call "nix build..." and end up with a result softlink in the directory where package.nix resides. There is no surrounding additional wrapper/infrastructure for the package beyond that at this point in time. | 15:26:24 |
ragdoc | Oh, the package.nix uses pkgs.buildGoModule, just in case this matters in terms of dependencies or suchlike. | 15:32:11 |
samasaur | it shouldn't | 15:33:34 |
samasaur | I'd need to see the package.nix file/your configuration to be 100% sure, but im pretty confident pkgs.callPackage should work | 15:34:19 |
samasaur | just stick (pkgs.callPackage ./path/to/package.nix {}) in environment.systemPackages or wherever you want it | 15:34:57 |
ragdoc | Thanks @samasaur, I'll try that first. Also, for further reading, https://nix.dev/tutorials/callpackage.html looks like a reasonable starting point, I guess. | 15:39:09 |
ragdoc | Sorry, customer call in progress, and it might take a while. | 15:40:43 |
ragdoc | I have tried several variants, but keep running into the following:
error: A definition for option `environment.systemPackages."[definition 14-entry 1]"' is not of type `package'.
Unfortunately my searches for this error didn't return a solution so far. Did I miss something painfully obvious?
| 16:57:31 |
ragdoc | As a side note, I also wonder if the efforts spent on this are worth it, what with x86_64-darwin being discontinued. I'm using an Intel-based Mac. | 17:03:07 |
samasaur | paste the excerpt of your config where you're trying to call the package? | 17:25:53 |
samasaur | a common issue is not including the parentheses, you need them in a list | 17:26:11 |
ragdoc | Here we go:
outputs =
inputs@{ self, nix-darwin, ... }:
let
# myp = { pkgs, ... }: pkgs.callPackage ./package.nix { };
configuration =
{ pkgs, ... }:
{
# List packages installed in system profile. To search by name, run:
# nix-env -qaP | grep wget
environment = {
systemPackages = with pkgs; [
# myp
(callPackage ./package.nix {
inherit pkgs;
})
aerc
... more packages follow ... | 17:48:35 |
ragdoc | The "myp" lines are remnants of using a different syntax. | 17:49:12 |
ragdoc | Not sure about Matrix etiquette, should I mention samasaur ? | 17:56:36 |
samasaur | not sure about general etiquette but I don't mind :) | 18:00:29 |
samasaur | That syntax looks right to me, im not sure why you're getting that error | 18:01:21 |
ragdoc | I think I'll need to get some rest and look at things with a fresh mind. Over the last few days, I was surprised by nix-darwin not reacting identically to NixOS, and I kept trying different things on different platforms to see if I could figure out the details. I can't rule out that I screwed something up with the package.nix file during these experiments. Long shot maybe, but who knows? | 18:05:16 |
alexfmpe | ah, indeed | 18:24:26 |
alexfmpe | thanks | 18:24:33 |
| Theuni changed their display name from Christian Theune to Theuni. | 19:58:12 |
| 7 Mar 2026 |
alexfmpe | there we go: https://github.com/NixOS/nixpkgs/pull/497424 | 02:30:01 |