98 lines
2.6 KiB
Nix
98 lines
2.6 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
devshell = {
|
|
url = "github:numtide/devshell";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
nci.url = "github:yusdacra/nix-cargo-integration";
|
|
};
|
|
|
|
outputs =
|
|
inputs:
|
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
|
imports = [
|
|
inputs.devshell.flakeModule
|
|
inputs.nci.flakeModule
|
|
inputs.pre-commit-hooks.flakeModule
|
|
inputs.treefmt-nix.flakeModule
|
|
];
|
|
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
|
|
perSystem =
|
|
{
|
|
config,
|
|
pkgs,
|
|
system,
|
|
...
|
|
}:
|
|
{
|
|
_module.args.pkgs = import inputs.nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
|
|
pre-commit.settings.hooks = {
|
|
treefmt.enable = true;
|
|
deadnix.enable = true;
|
|
statix.enable = true;
|
|
shellcheck.enable = true;
|
|
};
|
|
devshells.default = {
|
|
packages = with pkgs; [
|
|
hello
|
|
config.treefmt.build.wrapper
|
|
(python3.withPackages (p: with p; [ tqdm ]))
|
|
];
|
|
commands = [
|
|
{
|
|
package = pkgs.nix;
|
|
help = "nichts";
|
|
}
|
|
];
|
|
env = [
|
|
{
|
|
name = "";
|
|
value = "";
|
|
}
|
|
];
|
|
devshell.startup.pre-commit.text = config.pre-commit.installationScript;
|
|
};
|
|
|
|
treefmt = {
|
|
projectRootFile = "flake.nix";
|
|
programs = {
|
|
asmfmt.enable = true;
|
|
beautysh.enable = true;
|
|
ruff-format.enable = true;
|
|
clang-format.enable = true;
|
|
cmake-format.enable = true;
|
|
nixfmt.enable = true;
|
|
rustfmt.enable = true;
|
|
typstfmt.enable = true;
|
|
};
|
|
};
|
|
|
|
# Rust
|
|
nci.projects.nixp-meta.path = ./.;
|
|
nci.crates.nixp-meta = { };
|
|
|
|
# devShells.default = config.nci.outputs.main.devShell.overrideAttrs (old: {
|
|
# nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.cargo-release ];
|
|
#
|
|
# shellHook = ''
|
|
# ${old.shellHook or ""}
|
|
# ${config.pre-commit.installationScript}
|
|
# '';
|
|
# });
|
|
};
|
|
};
|
|
}
|