2024-10-11 14:06:50 +00:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-10-11 18:05:14 +00:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2024-10-11 14:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = {
|
|
|
|
self,
|
2024-10-11 18:05:14 +00:00
|
|
|
flake-parts,
|
|
|
|
...
|
|
|
|
} @ inputs:
|
|
|
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
|
|
|
systems = ["x86_64-linux"];
|
|
|
|
perSystem = {
|
|
|
|
self',
|
|
|
|
inputs',
|
|
|
|
system,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (pkgs) callPackage;
|
|
|
|
in {
|
|
|
|
# Customize the pkgs instance with our desired features
|
|
|
|
# and overlays.
|
|
|
|
legacyPackages = import inputs.nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
config = {
|
|
|
|
overlays = [self.overlays.default]; # consume local overlay
|
|
|
|
};
|
|
|
|
};
|
2024-10-11 14:06:50 +00:00
|
|
|
|
2024-10-11 18:05:14 +00:00
|
|
|
# Set pkgs to the updated value, which is also exposed
|
|
|
|
# as legacyPackages in the flake schema.
|
|
|
|
_module.args.pkgs = config.legacyPackages;
|
2024-10-11 14:06:50 +00:00
|
|
|
|
2024-10-11 18:05:14 +00:00
|
|
|
# Generate packages automagically from ./nix/packages
|
|
|
|
# for each package that contains a package.nix - this
|
|
|
|
# is a flake-parts feature that makes our life easier.
|
|
|
|
packages = {
|
|
|
|
sdl3-custom = callPackage ./nix/packages/SDL3 {};
|
|
|
|
# cursed-libcxx-stdenv = callPackage ./nix/packages/cursed-libcxx-stdenv {};
|
|
|
|
gooey = callPackage ./nix/packages/gooey {
|
|
|
|
inherit self;
|
|
|
|
sdl3 = self'.packages.sdl3-custom;
|
|
|
|
};
|
|
|
|
};
|
2024-10-11 14:06:50 +00:00
|
|
|
|
2024-10-11 18:05:14 +00:00
|
|
|
# Generate an overlay containing each one of our packages that are collected
|
|
|
|
# from ./nix/packages.
|
|
|
|
# overlayAttrs = self.packages;
|
2024-10-11 14:06:50 +00:00
|
|
|
|
2024-10-11 18:05:14 +00:00
|
|
|
devShells.default = callPackage ./shells/default.nix {inherit (self'.packages) gooey;};
|
2024-10-11 14:06:50 +00:00
|
|
|
};
|
2024-10-11 18:05:14 +00:00
|
|
|
};
|
2024-10-11 14:06:50 +00:00
|
|
|
}
|