maint: Move treefmt to dev partition
Moves treefmt-nix input and configuration from the main flake to the dev partition, since it's a development-only dependency. Also switches pre-commit hooks from individual formatter hooks to the unified treefmt hook for better consistency.
This commit is contained in:
parent
cfda626614
commit
4a1889fb0c
5 changed files with 24 additions and 105 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
inputs.pre-commit-hooks-nix.flakeModule
|
inputs.pre-commit-hooks-nix.flakeModule
|
||||||
inputs.hercules-ci-effects.flakeModule
|
inputs.hercules-ci-effects.flakeModule
|
||||||
|
inputs.treefmt-nix.flakeModule
|
||||||
];
|
];
|
||||||
perSystem =
|
perSystem =
|
||||||
{
|
{
|
||||||
|
|
@ -17,7 +18,20 @@
|
||||||
{
|
{
|
||||||
nix-bindings-rust.nixPackage = inputs'.nix.packages.default;
|
nix-bindings-rust.nixPackage = inputs'.nix.packages.default;
|
||||||
|
|
||||||
pre-commit.settings.hooks.nixfmt-rfc-style.enable = true;
|
treefmt = {
|
||||||
|
# Used to find the project root
|
||||||
|
projectRootFile = "flake.lock";
|
||||||
|
|
||||||
|
programs.rustfmt = {
|
||||||
|
enable = true;
|
||||||
|
edition = "2021";
|
||||||
|
};
|
||||||
|
programs.nixfmt.enable = true;
|
||||||
|
programs.deadnix.enable = true;
|
||||||
|
#programs.clang-format.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
pre-commit.settings.hooks.treefmt.enable = true;
|
||||||
# Temporarily disable rustfmt due to configuration issues
|
# Temporarily disable rustfmt due to configuration issues
|
||||||
# pre-commit.settings.hooks.rustfmt.enable = true;
|
# pre-commit.settings.hooks.rustfmt.enable = true;
|
||||||
pre-commit.settings.settings.rust.cargoManifestPath = "./Cargo.toml";
|
pre-commit.settings.settings.rust.cargoManifestPath = "./Cargo.toml";
|
||||||
|
|
|
||||||
72
dev/flake.lock
generated
72
dev/flake.lock
generated
|
|
@ -36,27 +36,6 @@
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-parts_2": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": [
|
|
||||||
"nix-unit",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1754487366,
|
|
||||||
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -97,26 +76,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nix-unit": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-parts": "flake-parts_2",
|
|
||||||
"nixpkgs": "nixpkgs_2",
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1754985033,
|
|
||||||
"narHash": "sha256-OLaoMtlNL5AvYuaQ5P4p7riy7M9J8XpFdWKpD5RzQfU=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nix-unit",
|
|
||||||
"rev": "388045c7bee5a2617cca8e94444bea1862df19ac",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nix-unit",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1755027561,
|
"lastModified": 1755027561,
|
||||||
|
|
@ -133,22 +92,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1754800730,
|
|
||||||
"narHash": "sha256-HfVZCXic9XLBgybP0318ym3cDnGwBs/+H5MgxFVYF4I=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "641d909c4a7538f1539da9240dedb1755c907e40",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks-nix": {
|
"pre-commit-hooks-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
|
|
@ -172,23 +115,20 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hercules-ci-effects": "hercules-ci-effects",
|
"hercules-ci-effects": "hercules-ci-effects",
|
||||||
"nix-unit": "nix-unit",
|
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
|
||||||
"pre-commit-hooks-nix": "pre-commit-hooks-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": []
|
||||||
"nix-unit",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754847726,
|
"lastModified": 1762938485,
|
||||||
"narHash": "sha256-2vX8QjO5lRsDbNYvN9hVHXLU6oMl+V/PsmIiJREG4rE=",
|
"narHash": "sha256-AlEObg0syDl+Spi4LsZIBrjw+snSVU4T8MOeuZJUJjM=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "7d81f6fb2e19bf84f1c65135d1060d829fae2408",
|
"rev": "5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@
|
||||||
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
|
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
|
||||||
pre-commit-hooks-nix.inputs.nixpkgs.follows = "";
|
pre-commit-hooks-nix.inputs.nixpkgs.follows = "";
|
||||||
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
|
hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects";
|
||||||
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
|
treefmt-nix.inputs.nixpkgs.follows = "";
|
||||||
};
|
};
|
||||||
outputs = { ... }: { };
|
outputs = { ... }: { };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
flake.lock
generated
23
flake.lock
generated
|
|
@ -344,8 +344,7 @@
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nix": "nix",
|
"nix": "nix",
|
||||||
"nix-cargo-integration": "nix-cargo-integration",
|
"nix-cargo-integration": "nix-cargo-integration",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs"
|
||||||
"treefmt-nix": "treefmt-nix"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
|
|
@ -412,26 +411,6 @@
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"treefmt-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1762938485,
|
|
||||||
"narHash": "sha256-AlEObg0syDl+Spi4LsZIBrjw+snSVU4T8MOeuZJUJjM=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"rev": "5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
16
flake.nix
16
flake.nix
|
|
@ -8,8 +8,6 @@
|
||||||
nix-cargo-integration.url = "github:yusdacra/nix-cargo-integration";
|
nix-cargo-integration.url = "github:yusdacra/nix-cargo-integration";
|
||||||
nix-cargo-integration.inputs.nixpkgs.follows = "nixpkgs";
|
nix-cargo-integration.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
||||||
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
@ -164,7 +162,6 @@
|
||||||
inputs.nix-cargo-integration.flakeModule
|
inputs.nix-cargo-integration.flakeModule
|
||||||
inputs.flake-parts.flakeModules.partitions
|
inputs.flake-parts.flakeModules.partitions
|
||||||
inputs.flake-parts.flakeModules.modules
|
inputs.flake-parts.flakeModules.modules
|
||||||
inputs.treefmt-nix.flakeModule
|
|
||||||
# dogfood
|
# dogfood
|
||||||
flake-parts-modules.tested
|
flake-parts-modules.tested
|
||||||
./nci.nix
|
./nci.nix
|
||||||
|
|
@ -182,19 +179,6 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
packages.nix = inputs'.nix.packages.nix;
|
packages.nix = inputs'.nix.packages.nix;
|
||||||
|
|
||||||
treefmt = {
|
|
||||||
# Used to find the project root
|
|
||||||
projectRootFile = "flake.lock";
|
|
||||||
|
|
||||||
programs.rustfmt = {
|
|
||||||
enable = true;
|
|
||||||
edition = "2021";
|
|
||||||
};
|
|
||||||
programs.nixfmt.enable = true;
|
|
||||||
programs.deadnix.enable = true;
|
|
||||||
#programs.clang-format.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
partitionedAttrs.devShells = "dev";
|
partitionedAttrs.devShells = "dev";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue