Retro68/default.nix

61 lines
1.5 KiB
Nix
Raw Normal View History

2022-01-02 19:12:11 +00:00
let sources = import ./nix/sources.nix;
2023-12-28 22:50:29 +00:00
in { system ? builtins.currentSystem
, nixpkgs ? sources.nixpkgs
, multiversal_src ? if builtins.pathExists ./multiversal/make-multiverse.rb then
./multiversal
else
sources.multiversal
, ...
}:
2020-10-04 13:35:11 +00:00
2021-11-27 00:29:55 +00:00
let
2022-01-02 11:12:58 +00:00
retroPlatforms = import nix/platforms.nix;
2021-11-27 00:29:55 +00:00
lib = ((import nixpkgs) { inherit system; }).lib;
2022-01-02 19:12:11 +00:00
2021-11-27 00:29:55 +00:00
# A Nixpkgs overlay.
2022-01-02 11:12:58 +00:00
overlay = lib.composeManyExtensions [
2022-01-02 19:12:11 +00:00
((import nix/overlay.nix) { inherit multiversal_src; })
2022-01-02 11:12:58 +00:00
(import nix/universal.nix)
(import nix/samples.nix)
];
2022-01-02 19:12:11 +00:00
2022-01-02 11:12:58 +00:00
overlaidPkgs = import nixpkgs {
2021-11-27 00:29:55 +00:00
inherit system;
overlays = [ overlay ];
};
2023-12-28 22:50:29 +00:00
crossPkgs = lib.mapAttrs
(name: plat:
import nixpkgs {
inherit system;
overlays = [ overlay ];
crossSystem = plat;
config = { allowUnsupportedSystem = true; };
})
retroPlatforms;
2023-12-28 19:57:54 +00:00
targetPkgs = lib.mapAttrs (name: cross: cross.buildPackages) crossPkgs;
2021-11-27 00:29:55 +00:00
2023-12-28 22:50:29 +00:00
shell = lib.mapAttrs
(name: cross:
cross.mkShell
{
nativeBuildInputs = with overlaidPkgs; [
retro68.hfsutils
retro68.tools
cmake
gnumake
];
buildInputs = [ cross.retro68.console ];
} // cross)
crossPkgs;
2021-11-27 00:32:30 +00:00
2023-12-28 22:50:29 +00:00
in
builtins.trace
"Warning: Retro68's default.nix is deprecated and will disappear soon. Please use the flake instead."
(shell.m68k // shell // {
inherit overlay;
inherit (overlaidPkgs) retro68;
targetPkg = targetPkgs;
})