Skip to content

Commit 324dd86

Browse files
committed
feat: stock sources subset
1 parent e4f689f commit 324dd86

5 files changed

Lines changed: 63 additions & 0 deletions

File tree

flake.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
datasources = self;
2525
};*/
2626
sourcesToml = callPackage self.lib.datasources.config.output.get.file {};
27+
stockSourcesToml = callPackage self.lib.datasources.config.stock.output.get.file {};
2728

2829
default = packages.sourcesToml;
2930
};
@@ -101,12 +102,14 @@
101102
sources = {
102103
datasources = ./modules/sources/datasources.nix;
103104
output-settings = ./modules/sources/output/settings.nix;
105+
stock = ./modules/sources/output/stock.nix;
104106
default = let
105107
inherit (self.datasourceModules) sources;
106108
in _: {
107109
imports = [
108110
sources.datasources
109111
sources.output-settings
112+
sources.stock
110113
];
111114
};
112115
};

markers/config.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
name = "BlishHUD Commander's Markers Internal Markers";
1414
fileName = "Extracted.markers";
1515
description = "Markers that were embedded into the source code of BlishHUD's Commander's Markers.";
16+
stock.enable = true;
1617
remote.github = {
1718
owner = "TaimiHUD";
1819
repo = "CommandersMarkersInternalMarkers";

modules/sources/output/stock.nix

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{ datasourceModules, config, lib, ... }: let
2+
inherit (lib.attrsets) mapAttrs filterAttrs;
3+
inherit (lib.modules) mkOptionDefault;
4+
inherit (lib.options) mkOption mkEnableOption;
5+
inherit (lib) types;
6+
filterStockSources = _: sources: let
7+
sources' = filterAttrs (_: source: source.stock.enable or false) sources;
8+
in sources';
9+
datasourcesProxy = { sourcesConfig, ... }: {
10+
imports = [
11+
datasourceModules.generic.specialargs
12+
];
13+
options = {
14+
datasources = mkOption {
15+
type = types.attrs;
16+
};
17+
};
18+
config = {
19+
datasources = mkOptionDefault (mapAttrs filterStockSources {
20+
inherit (sourcesConfig.datasources) markers pathing timers;
21+
});
22+
};
23+
};
24+
datasourceModule = { ... }: {
25+
options.stock = {
26+
enable = mkEnableOption "stock datasource";
27+
};
28+
};
29+
in {
30+
options = {
31+
stock = mkOption {
32+
type = config.special.submoduleType [
33+
datasourcesProxy
34+
datasourceModules.sources.output-settings
35+
];
36+
default = {};
37+
};
38+
datasources = {
39+
markers = mkOption {
40+
type = types.attrsOf (types.submodule [
41+
datasourceModule
42+
]);
43+
};
44+
pathing = mkOption {
45+
type = types.attrsOf (types.submodule [
46+
datasourceModule
47+
]);
48+
};
49+
timers = mkOption {
50+
type = types.attrsOf (types.submodule [
51+
datasourceModule
52+
]);
53+
};
54+
};
55+
};
56+
}

pathing/taco/sources.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
name = "Teh's Trails - Map Completion";
55
fileName = "TehsTrails.taco";
66
description = "A collection of xTeh.7146's marker packs.";
7+
stock.enable = true;
78
remote.github = {
89
owner = "xrandox";
910
repo = "TehsTrails";
@@ -254,6 +255,7 @@
254255
tekkits-aio = {
255256
name = "Tekkit's All-In-One";
256257
fileName = "tw_ALL_IN_ONE.taco";
258+
stock.enable = true;
257259
remote.direct = {
258260
#url = "https://www.tekkitsworkshop.net/download?download=1:tw-all-in-one";
259261
url = "https://www.tekkitsworkshop.net/downloads/tw_ALL_IN_ONE.taco";

timers/config.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
name = "Hero's Timers";
55
fileName = "Hero.Timer.Pack.zip";
66
description = "These are timers by QuitarHero created for Charr's Timer Module.";
7+
stock.enable = true;
78
remote.github = {
89
owner = "QuitarHero";
910
repo = "Hero-Timers";

0 commit comments

Comments
 (0)