rimworld-mod-template/flake.nix

92 lines
2.5 KiB
Nix
Raw Normal View History

2024-02-11 17:28:50 +01:00
{
inputs = {
2024-10-16 14:11:05 +02:00
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2024-02-11 17:28:50 +01:00
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
# Dev tools
2024-10-16 14:11:05 +02:00
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-11 17:28:50 +01:00
};
2024-04-16 09:26:30 +02:00
outputs =
inputs:
2024-02-11 17:28:50 +01:00
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [ inputs.treefmt-nix.flakeModule ];
2024-04-16 09:26:30 +02:00
perSystem =
{
config,
self',
pkgs,
lib,
system,
...
}:
{
devShells.default = pkgs.mkShell {
inputsFrom = [ config.treefmt.build.devShell ];
nativeBuildInputs = with pkgs; [
2024-10-16 14:11:05 +02:00
dotnetCorePackages.dotnet_8.sdk
nixfmt-rfc-style
omnisharp-roslyn
libxslt.bin
nodePackages.npm
2024-04-16 09:26:30 +02:00
];
2024-10-16 14:11:05 +02:00
DOTNET_ROOT = "${pkgs.dotnet-sdk_8}";
2024-04-16 09:26:30 +02:00
};
2024-02-11 17:28:50 +01:00
2024-04-16 09:26:30 +02:00
# Add your auto-formatters here.
# cf. https://numtide.github.io/treefmt/
treefmt.config = {
projectRootFile = "flake.nix";
programs = {
2024-10-16 14:11:05 +02:00
csharpier = {
enable = true;
dotnet-sdk = pkgs.dotnet-sdk_6;
package = pkgs.csharpier;
};
nixfmt.enable = true;
shfmt.enable = true;
prettier = {
enable = true;
includes = [
"**/*.xml"
"**/*.xslt"
"**/*.json"
"**/*.csproj"
".github/workflows/*"
];
settings = {
plugins = [ "@prettier/plugin-xml" ];
bracketSameLine = true;
printWidth = 1000;
overrides = [
{
files = "*.xml";
options = {
xmlQuoteAttributes = "double";
xmlSortAttributesByKey = true;
xmlWhitespaceSensitivity = "preserve";
};
}
];
};
};
2024-04-16 09:26:30 +02:00
};
2024-10-16 14:11:05 +02:00
settings.global.excludes = [
".direnv"
"node_modules"
"1.4/**/*"
"*.ase"
"*.dll"
"*.png"
"About/About.xml"
];
2024-02-11 17:28:50 +01:00
};
};
};
}