explicitly define project root in treefmt (#103)

* explicitly define project root in treefmt

* define `projectRootFile` in `treefmt`

* make `treefmt.projectRoot` as `inputs.services-flake`

* use github flake url

* flake.nix as projectRootFile

* add comment

* force override-input in test flake

---------

Co-authored-by: shivaraj-bh <sbh69840@gmail.com>
This commit is contained in:
Abhishek Singh 2024-02-20 11:06:02 +05:30 committed by GitHub
parent 29781d10d0
commit dafaeb048d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 1 deletions

View File

@ -88,9 +88,25 @@
"flake-parts": "flake-parts",
"flake-root": "flake-root",
"nixpkgs": "nixpkgs",
"services-flake": "services-flake",
"treefmt-nix": "treefmt-nix"
}
},
"services-flake": {
"locked": {
"lastModified": 1708321363,
"narHash": "sha256-8tyA4VIUrbYJaF/eOnx5fzvw3jSskQ622XPUqSoAEGU=",
"owner": "juspay",
"repo": "services-flake",
"rev": "29781d10d08ab704dacf58cad35cddac7d19d5bd",
"type": "github"
},
"original": {
"owner": "juspay",
"repo": "services-flake",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_2"

View File

@ -4,6 +4,8 @@
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
treefmt-nix.url = "github:numtide/treefmt-nix";
# CI will override `services-flake` to run checks on the latest source
services-flake.url = "github:juspay/services-flake";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
@ -14,6 +16,7 @@
];
perSystem = { pkgs, lib, config, ... }: {
treefmt = {
projectRoot = inputs.services-flake;
projectRootFile = "flake.nix";
programs = {
nixpkgs-fmt.enable = true;

View File

@ -21,6 +21,7 @@
dir = "./test";
};
dev = {
inherit overrideInputs;
dir = "./dev";
};
doc = {

View File

@ -4,7 +4,7 @@
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
services-flake.url = "github:juspay/services-flake";
services-flake = { };
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {