!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1191 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org199 Servers

Load older messages


SenderMessageTime
6 Mar 2026
@samasaur:matrix.orgsamasaurprobably 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-package15:23:38
@ragdoc:matrix.orgragdocAs 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:matrix.orgragdocOh, the package.nix uses pkgs.buildGoModule, just in case this matters in terms of dependencies or suchlike.15:32:11
@samasaur:matrix.orgsamasaurit shouldn't15:33:34
@samasaur:matrix.orgsamasaurI'd need to see the package.nix file/your configuration to be 100% sure, but im pretty confident pkgs.callPackage should work15:34:19
@samasaur:matrix.orgsamasaurjust stick (pkgs.callPackage ./path/to/package.nix {}) in environment.systemPackages or wherever you want it15:34:57
@ragdoc:matrix.orgragdocThanks @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:matrix.orgragdocSorry, customer call in progress, and it might take a while.15:40:43
@ragdoc:matrix.orgragdoc

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:matrix.orgragdocAs 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:matrix.orgsamasaurpaste the excerpt of your config where you're trying to call the package?17:25:53
@samasaur:matrix.orgsamasaura common issue is not including the parentheses, you need them in a list17:26:11
@ragdoc:matrix.orgragdocHere 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:matrix.orgragdocThe "myp" lines are remnants of using a different syntax.17:49:12
@ragdoc:matrix.orgragdoc Not sure about Matrix etiquette, should I mention samasaur ? 17:56:36
@samasaur:matrix.orgsamasaurnot sure about general etiquette but I don't mind :)18:00:29
@samasaur:matrix.orgsamasaurThat syntax looks right to me, im not sure why you're getting that error18:01:21
@ragdoc:matrix.orgragdocI 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:matrix.orgalexfmpeah, indeed18:24:26
@alexfmpe:matrix.orgalexfmpethanks18:24:33
@ctheune:matrix.flyingcircus.ioTheuni changed their display name from Christian Theune to Theuni.19:58:12
7 Mar 2026
@alexfmpe:matrix.orgalexfmpethere we go: https://github.com/NixOS/nixpkgs/pull/49742402:30:01
@copumpkin:matrix.orgcopumpkinhow's the Darwin Nix sandbox these days?23:22:42
8 Mar 2026
@reckenrode:matrix.orgRandy EckenrodeIIRC it still comes with caveats.01:25:22
@reckenrode:matrix.orgRandy Eckenrodehttps://gist.github.com/milseman/dcb166afbc623bf414f1aad1f417646a01:25:25
@reckenrode:matrix.orgRandy EckenrodeDarwin apparently has some interesting filesystem paths.01:25:36
@reckenrode:matrix.orgRandy Eckenrode e.g., if you ls /.nofollow/etc/, it fails because /etc is a symlink to /private/etc. 01:27:42
@antifuchs:asf.computerantifuchs…fascinating02:09:40
@bestlem:matrix.orgbestlemFor some more info on that https://developer.apple.com/forums/thread/798402?page=208:59:07
@reckenrode:matrix.orgRandy EckenrodeAlso https://forums.swift.org/t/pitch-add-filepath-to-the-standard-library/84812, which is where it came up.11:01:31

Show newer messages


Back to Room ListRoom Version: 6