72 lines
1.9 KiB
Nix
72 lines
1.9 KiB
Nix
{
|
|
description = "Common setup for mfgames-writing projects.";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "nixpkgs/nixos-24.11";
|
|
mfgames-project-setup.url = "git+https://src.mfgames.com/nixos-contrib/mfgames-project-setup-flake.git";
|
|
mfgames-project-setup.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = inputs @ { self, nixpkgs, mfgames-project-setup, ... }:
|
|
let
|
|
# Helpers for producing system-specific outputs
|
|
supportedSystems = [ "x86_64-linux" ];
|
|
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
|
inherit system;
|
|
pkgs = import nixpkgs { inherit system; };
|
|
});
|
|
in
|
|
rec
|
|
{
|
|
# Expose the configuration information.
|
|
lib = {
|
|
mkConfig =
|
|
{ system
|
|
, pkgs
|
|
, ...
|
|
}:
|
|
{
|
|
packages = [
|
|
pkgs.pandoc
|
|
pkgs.nodejs_22
|
|
|
|
# EPUB
|
|
pkgs.epubcheck
|
|
|
|
# PDF
|
|
pkgs.pdftk
|
|
pkgs.python312Full
|
|
pkgs.python312Packages.weasyprint
|
|
];
|
|
};
|
|
};
|
|
|
|
# Set up the developer shell.
|
|
devShells = forEachSupportedSystem ({ system, pkgs }:
|
|
let
|
|
project-config = mfgames-project-setup.lib.mkConfig {
|
|
inherit system pkgs;
|
|
contributorCovenant.enable = true;
|
|
contributorCovenant.contact = "contact@mfgames.com";
|
|
developerCertificateOfOrigin.enable = true;
|
|
};
|
|
|
|
writing-config = lib.mkConfig {
|
|
inherit system pkgs;
|
|
};
|
|
in
|
|
{
|
|
# Shell
|
|
default = pkgs.mkShell {
|
|
packages = [ ]
|
|
++ project-config.packages
|
|
++ writing-config.packages;
|
|
|
|
shellHook = project-config.shellHook;
|
|
};
|
|
});
|
|
|
|
# Formatting for the Nix files
|
|
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixpkgs-fmt);
|
|
};
|
|
}
|