modules/nixpkgs: add hostPlatform & buildPlatform options

This commit is contained in:
Matt Sturgeon 2024-10-19 23:45:28 +01:00
parent 5bd04ce09a
commit 8dc8fa38b0
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 58 additions and 3 deletions

View file

@ -32,11 +32,20 @@ let
evalArgs
// {
modules = evalArgs.modules or [ ] ++ [
# Use global packages by default in nixvim's submodule
# TODO: `useGlobalPackages` option and/or deprecate using host packages?
{
_file = ./_shared.nix;
nixpkgs.pkgs = lib.mkDefault pkgs;
nixpkgs = {
# Use global packages by default in nixvim's submodule
# TODO: `useGlobalPackages` option and/or deprecate using host packages?
pkgs = lib.mkDefault pkgs;
# Inherit platform spec
# FIXME: buildPlatform can't use option-default because it already has a default
# (it defaults to hostPlatform)...
hostPlatform = lib.mkOptionDefault pkgs.stdenv.hostPlatform;
buildPlatform = lib.mkDefault pkgs.stdenv.buildPlatform;
};
}
];
}