1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-15 13:07:52 +00:00
flake-parts/dev/flake-module.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

flakeModuleArgs@{ config, lib, ... }:
{
imports = [
];
systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = system: { config, self', inputs', pkgs, ... }: {
_module.args.pkgs = inputs'.nixpkgs.legacyPackages;
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.nixpkgs-fmt ];
};
packages = {
inherit (pkgs.nixosOptionsDoc { inherit (flakeModuleArgs) options; })
optionsDocBook;
optionsMarkdown = pkgs.runCommand "options-markdown"
{
inherit (config.packages) optionsDocBook;
nativeBuildInputs = [ pkgs.pandoc ];
} ''
mkdir $out
pandoc \
--from docbook \
--to markdown \
--output $out/options.md \
$optionsDocBook
'';
};
};
flake = {
options.herculesCI = lib.mkOption { type = lib.types.raw; };
config.herculesCI = {
onPush.default.outputs = {
inherit (config.flake) packages checks;
};
};
# for repl exploration / debug
config.config = config;
options.mySystem = lib.mkOption { default = config.allSystems.${builtins.currentSystem}; };
};
}