Closed srid closed 1 month ago
https://github.com/srid/nixos-config/blob/ab552c356dfb19fdea55ae700b4963750b498b99/flake.nix#L51-L53 darwinConfigurations
is present but doesn’t show up in nix flake show github:srid/nixos-config —json
:
{
"checks": {
"aarch64-darwin": {
"treefmt": {
"name": "treefmt-check",
"type": "derivation"
}
},
"aarch64-linux": {
"treefmt": {}
},
"x86_64-linux": {
"treefmt": {}
}
},
"darwinConfigurations": {
"type": "unknown"
},
"darwinModules": {
"type": "unknown"
},
"darwinModules_": {
"type": "unknown"
},
"devShells": {
"aarch64-darwin": {
"default": {
"name": "nix-shell",
"type": "derivation"
}
},
"aarch64-linux": {
"default": {}
},
"x86_64-linux": {
"default": {}
}
},
"formatter": {
"aarch64-darwin": {
"description": "one CLI to format the code tree",
"name": "treefmt",
"type": "derivation"
},
"aarch64-linux": {},
"x86_64-linux": {}
},
"homeModules": {
"type": "unknown"
},
"legacyPackages": {
"aarch64-darwin": {},
"aarch64-linux": {},
"x86_64-linux": {}
},
"nixos-flake": {
"type": "unknown"
},
"nixosConfigurations": {
"immediacy": {
"type": "nixos-configuration"
}
},
"nixosModules": {
"common": {
"type": "nixos-module"
},
"default": {
"type": "nixos-module"
},
"home-manager": {
"type": "nixos-module"
},
"my-home": {
"type": "nixos-module"
},
"nixosFlake": {
"type": "nixos-module"
}
},
"packages": {
"aarch64-darwin": {
"activate": {
"description": "Activate NixOS/nix-darwin/home-manager configurations",
"name": "activate",
"type": "derivation"
},
"default": {
"description": "Activate NixOS/nix-darwin/home-manager configurations",
"name": "activate",
"type": "derivation"
},
"update": {
"name": "update-main-flake-inputs",
"type": "derivation"
}
},
"aarch64-linux": {
"activate": {},
"default": {},
"update": {}
},
"x86_64-linux": {
"activate": {},
"default": {},
"update": {}
}
}
}
Is it because the type
is unknown and nix doesn’t recognise it? how else should we fetch darwinConfigurations
?
darwinConfigurations
falls under Known but unchecked community attribute
:
https://github.com/NixOS/nix/blob/8ce4287409319e04f46ed1352deb956c30e35fc6/src/nix/flake.cc#L774-L786
We could adopt https://github.com/DeterminateSystems/flake-schemas which does (or is designed to) recognize it.
EDIT: I believe FlakeHub itself uses it.
Easiest way to use flake-schemas
probably is to use their fork of Nix, just for nix flake show
:
https://github.com/NixOS/nix/pull/8892
(Until it gets upstreamed)
nixosConfigurations
based on the current flake output schema is done here: https://github.com/juspay/omnix/pull/165
flake-schemas
is being tried out here: https://github.com/juspay/omnix/pull/166
om show
should displaynixosConfigurations
anddarwinConfigurations
as well. Currently it doesn't: