mirror of
https://codeberg.org/spire/nix.git
synced 2026-06-03 18:04:10 +02:00
flake reorg
This commit is contained in:
parent
40d16cd6e9
commit
67537a38e0
15 changed files with 70 additions and 96 deletions
72
flake.nix
72
flake.nix
|
|
@ -1,55 +1,41 @@
|
|||
{
|
||||
inputs = {
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "nixpkgs/release-24.11";
|
||||
flakelight.url = "github:nix-community/flakelight";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
}: let
|
||||
inherit (nixpkgs.lib.lists) concatMap;
|
||||
inherit (builtins) map;
|
||||
systems = with utils.lib.system; [x86_64-linux i686-linux];
|
||||
outputs = {flakelight, ...}: let
|
||||
inherit (builtins) listToAttrs map;
|
||||
inheritPkgs = names:
|
||||
listToAttrs (map (name: {
|
||||
inherit name;
|
||||
value = {pkgs, ...}: pkgs.${name};
|
||||
})
|
||||
names);
|
||||
in
|
||||
utils.lib.eachSystem systems (system: let
|
||||
inherit (builtins) mapAttrs attrNames elem;
|
||||
inherit (pkgs) lib;
|
||||
inherit (lib.attrsets) filterAttrs;
|
||||
overlays = [(import ./pkgs)];
|
||||
pkgs = (import nixpkgs) {
|
||||
inherit system overlays;
|
||||
# crossSystem = { config = "i686-unknown-linux-gnu"; };
|
||||
};
|
||||
testScript = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/spiretf/nocheats/master/plugin/nocheats.sp";
|
||||
sha256 = "sha256-Z3RJhuc9c8YQTo9gnLTBrqL4JpADZgDttrJVyE/MWdM=";
|
||||
};
|
||||
platformSdks = filterAttrs (name: sdk: elem system sdk.meta.platforms) pkgs.hl2sdk;
|
||||
in rec {
|
||||
packages = rec {
|
||||
inherit (pkgs) ambuild sourcemod sourcepawn sourcemod-includes buildSourcePawnScript hl2sdk sourcemod-include-library;
|
||||
sourcemods = mapAttrs (name: sdk: pkgs.sourcemod.override {sdks = {${name} = sdk;};}) hl2sdk;
|
||||
buildTestScript = buildSourcePawnScript {
|
||||
name = "test";
|
||||
src = testScript;
|
||||
flakelight ./. {
|
||||
systems = ["x86_64-linux" "i686-linux"];
|
||||
withOverlays = [(import ./nix/overlay.nix)];
|
||||
|
||||
formatters = pkgs:
|
||||
with pkgs; {
|
||||
"*.nix" = pkgs.lib.getExe alejandra;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [clangStdenv];
|
||||
perSystem = pkgs: {
|
||||
sourcemods = pkgs.lib.mapAttrs (name: sdk: pkgs.sourcemod.override {sdks = {${name} = sdk;};}) pkgs.hl2sdk;
|
||||
metamods = pkgs.lib.mapAttrs (name: sdk: pkgs.metamod-source.override {sdks = {${name} = sdk;};}) pkgs.hl2sdk;
|
||||
};
|
||||
packages = inheritPkgs ["ambuild" "sourcemod" "sourcepawn" "sourcemod-includes" "sourcemod-include-library"];
|
||||
|
||||
sdks = attrNames platformSdks;
|
||||
|
||||
overlays.default = import ./pkgs;
|
||||
})
|
||||
// {
|
||||
matrix = {
|
||||
include = concatMap (system: map (sdk: {inherit system sdk;}) self.sdks.${system}) systems;
|
||||
checks = {
|
||||
buildTestScript = {pkgs, ...}:
|
||||
pkgs.buildSourcePawnScript {
|
||||
name = "test";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://codeberg.org/spire/nocheats/raw/commit/5e0e21c241fdf8907d83d9bcf3cce37711b83d14/plugin/nocheats.sp";
|
||||
sha256 = "sha256-Z3RJhuc9c8YQTo9gnLTBrqL4JpADZgDttrJVyE/MWdM=";
|
||||
};
|
||||
};
|
||||
};
|
||||
overlays.default = import ./pkgs;
|
||||
inherit systems;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue