!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

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

Load older messages


SenderMessageTime
16 Apr 2026
@esperlily:matrix.orgEsperLily [she/her] does it give you some sort of error? I'm digging into the code but there's a lot here. it looks to me like perSystem is a deferred module (which is a thing i haven't really explored how it works yet) and it uses that to construct config.allSystems as a lazy attrset where each attr is a system and the value is the perSystem module module set evaluated with that system. And then for each of the options defined in perSystem it also defines flake.${option}.${system} = config.allSystems.${system}.${option}. The packages attrset is lazy so you can't write packages.foo = mkIf (or rather if you do I think what will happen is accessing that package from any system where that evaluates false will throw an error as package doesn't define an empty value). But defining packages.${if stdenv.hostPlatform.isDarwin then "aerospace-focus-fzf" else null} = aerospace-focus-fzf; still seems like it should work? and similarly, just defining flake.packages.aarch64-darwin.aerospace-focus-fzf should also work? 19:45:39
@esperlily:matrix.orgEsperLily [she/her] * does it give you some sort of error? I'm digging into the code but there's a lot here. it looks to me like perSystem is a deferred module and it uses that to construct config.allSystems as a lazy attrset where each attr is a system and the value is the perSystem module module set evaluated with that system. And then for each of the options defined in perSystem it also defines flake.${option}.${system} = config.allSystems.${system}.${option}. The packages attrset is lazy so you can't write packages.foo = mkIf (or rather if you do I think what will happen is accessing that package from any system where that evaluates false will throw an error as package doesn't define an empty value). But defining packages.${if stdenv.hostPlatform.isDarwin then "aerospace-focus-fzf" else null} = aerospace-focus-fzf; still seems like it should work? and similarly, just defining flake.packages.aarch64-darwin.aerospace-focus-fzf should also work? 19:46:21
@esperlily:matrix.orgEsperLily [she/her] * does it give you some sort of error? I'm digging into the code but there's a lot here. it looks to me like perSystem is a deferred module and it uses that to construct config.allSystems as a lazy attrset where each attr is a system and the value is the perSystem module set evaluated with that system. And then for each of the options defined in perSystem it also defines flake.${option}.${system} = config.allSystems.${system}.${option}. The packages attrset is lazy so you can't write packages.foo = mkIf (or rather if you do I think what will happen is accessing that package from any system where that evaluates false will throw an error as package doesn't define an empty value). But defining packages.${if stdenv.hostPlatform.isDarwin then "aerospace-focus-fzf" else null} = aerospace-focus-fzf; still seems like it should work? and similarly, just defining flake.packages.aarch64-darwin.aerospace-focus-fzf should also work? 19:46:34
@xored:xored.lolxoredwhen i tried it back with mkIf I got option packages.aarch64-darwin.foo option was accessed but not defined kind of error19:47:30
@esperlily:matrix.orgEsperLily [she/her]with mkIf I'd expect an error that looks like "The option `${showOption loc}' was accessed but has no value defined. Try setting the option."19:48:02
@xored:xored.lolxoredyeah19:48:09
@xored:xored.lolxoredi'll try in a sec fixing my rust crap :P19:48:19
@xored:xored.lolxoredi meant crab, surely :kappa:19:48:25
@esperlily:matrix.orgEsperLily [she/her]that's what happens with a lazyAttrsOf when the element type doesn't define an empty value19:48:26
@esperlily:matrix.orgEsperLily [she/her]* that's what happens with a lazyAttrsOf when the element type doesn't define an empty value and you use mkIf19:48:40
@esperlily:matrix.orgEsperLily [she/her] but if you got it accessing packages.aarch64-darwin.foo then that means your mkIf condition was wrong 19:49:28
@esperlily:matrix.orgEsperLily [she/her] because that error should only show up when the mkIf condition evaluates to false 19:49:43
@esperlily:matrix.orgEsperLily [she/her] but again i'm recommending you do the dynamic attribute approach rather than the mkIf so that way it's simply not defined in non-darwin package sets 19:50:14
@esperlily:matrix.orgEsperLily [she/her] you only need mkIf if you're relying on other parts of the config. it looks like for perSystem, the argument system is a specialArgs so you can use that strictly. actually I suggested before writing ${if stdenv.hostPlatform.isDarwin then … } but you can't actually do that as stdenv comes from pkgs which is presumably not a special arg. you can refer to the system arg safely this way though 19:52:37
@xored:xored.lolxored EsperLily [she/her] Randy Eckenrode that seems to have worked, thank you both 20:09:41
@xored:xored.lolxored now i just need to figure out the hellhole that is packagesFromDirectoryRecursive to make the auto packages exclude a platform somehow 20:10:55
@xored:xored.lolxoredbut for manual packages seems to have done the trick20:11:06
@esperlily:matrix.orgEsperLily [she/her] in the general case it may be better to just use meta.platforms to mark platform-specific packages, so that way the attribute path itself exists on other platforms, which interacts better with callPackage (it's generally simpler for a package to declare the argument and then just conditionally use it, than to mark the argument as nullable and assert that it has a value on the expected platform) 20:12:39
@xored:xored.lolxoredright, but I remember reading something about not having to eval20:13:53
@xored:xored.lolxoredso what i'm thinking is to have a directory with the platform name and somehow filter these out, so you'd have packages/x86_64-linux/foo for platform-specific packages20:14:31
@xored:xored.lolxoredonly if you're curious: https://github.com/drupol/pkgs-by-name-for-flake-parts/blob/main/flake-module.nix20:16:32
@xored:xored.lolxored I'd have access to system 20:16:52
@xored:xored.lolxoredi just need to find a way to have them filtered out from packages and legacyPackages, nix flake show:_20:17:24
@xored:xored.lolxored
 └───x86_64-linux
        ├───nvim omitted (use '--all-systems' to show)
        ├───prometheus-opnsense-exporter omitted (use '--all-systems' to show)
        ├───write-flake omitted (use '--all-systems' to show)
        ├───write-inputs omitted (use '--all-systems' to show)
        ├───write-lock omitted (use '--all-systems' to show)
        ├───x86_64-linux/arrs/prowlarr omitted (use '--all-systems' to show)
        ├───x86_64-linux/arrs/radarr omitted (use '--all-systems' to show)
        ├───x86_64-linux/arrs/seerr omitted (use '--all-systems' to show)
        └───x86_64-linux/arrs/sonarr omitted (use '--all-systems' to show)_
20:17:58
17 Apr 2026
@logn:zirco.devLogN changed their display name from LogN [unavailable @ CinemaCon -> 4/18] to LogN.01:24:09
@reckenrode:matrix.orgRandy EckenrodeGot network_cmds building finally. It ended up being easier to restore the XNU headers build than to try to keep scraping structs out of files. Unfortunately, the XNU headers still have to be copied because some conflict with the SDK.04:03:48
@viraptor:tchncs.deviraptor @reckenrode:matrix.org i finally got to compile your swift-update-mk2 branch to play with hammerspoon, but even with your settings.json and the posted command for swbuild, it still tries to run xcodebuild -dumpPIF almost immediately. I tried a few different things and playing with DEVELOPER_DIR to get to where you were but no luck. Have you got a branch from your experiments? It could save me some head-desk time 😀 12:03:14
@viraptor:tchncs.deviraptor * @reckenrode:matrix.org i finally got to compile your swift-update-mk2 branch to play with hammerspoon, but even with your settings.json and the posted command for swbuild, it still tries to run xcodebuild -dumpPIF almost immediately. I tried a few different things with the build service location and playing with DEVELOPER_DIR to get to where you were but no luck yet. Have you got a branch from your experiments? It could save me some head-desk time 😀 12:13:48
@viraptor:tchncs.deviraptor * @reckenrode:matrix.org i finally got to compile your swift-update-mk2 branch to play with hammerspoon, but even with your settings.json and the posted command for swbuild, it still tries to run xcodebuild -dumpPIF almost immediately. I tried a few different things with the build service location and playing with DEVELOPER_DIR to get to where you were but no luck yet. Have you got a branch from your experiments? It could save me some head-desk time 😀
Edit: just having a bad feeling - you didn't shim the whole xcbbuildservice for this, right?...
12:17:18
@viraptor:tchncs.deviraptor * @reckenrode:matrix.org i finally got to compile your swift-update-mk2 branch to play with hammerspoon, but even with your settings.json and the posted command for swbuild, it still tries to run xcodebuild -dumpPIF almost immediately. I tried a few different things with the build service location and playing with DEVELOPER_DIR to get to where you were but no luck yet. Have you got a branch from your experiments? It could save me some head-desk time 😀
Edit: just having a bad feeling - you didn't custom shim the whole xcbbuildservice for this, right?...
12:17:43

Show newer messages


Back to Room ListRoom Version: 6