flake: add treefmt for formatting
This commit is contained in:
parent
d4c3cf917d
commit
4730e07206
3 changed files with 45 additions and 39 deletions
69
flake.lock
generated
69
flake.lock
generated
|
|
@ -253,7 +253,9 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"niri-stable": "niri-stable",
|
"niri-stable": "niri-stable",
|
||||||
"niri-unstable": "niri-unstable",
|
"niri-unstable": "niri-unstable",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
"xwayland-satellite-stable": "xwayland-satellite-stable",
|
"xwayland-satellite-stable": "xwayland-satellite-stable",
|
||||||
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
|
||||||
|
|
@ -309,7 +311,9 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734918633,
|
"lastModified": 1734918633,
|
||||||
|
|
@ -329,13 +333,13 @@
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734649271,
|
"lastModified": 1734649271,
|
||||||
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
|
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
|
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
|
|
@ -357,46 +361,15 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1713805509,
|
|
||||||
"narHash": "sha256-YgSEan4CcrjivCNO5ZNzhg7/8ViLkZ4CB/GrGBVSudo=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "1e1dc66fe68972a76679644a5577828b6a7e8be4",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1734649271,
|
|
||||||
"narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"arion": "arion",
|
"arion": "arion",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"niri": "niri",
|
"niri": "niri",
|
||||||
"nix-vscode-extensions": "nix-vscode-extensions",
|
"nix-vscode-extensions": "nix-vscode-extensions",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs",
|
||||||
"stylix": "stylix"
|
"stylix": "stylix",
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stylix": {
|
"stylix": {
|
||||||
|
|
@ -513,6 +486,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1735135567,
|
||||||
|
"narHash": "sha256-8T3K5amndEavxnludPyfj3Z1IkcFdRpR23q+T0BVeZE=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "9e09d30a644c57257715902efbb3adc56c79cf28",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xwayland-satellite-stable": {
|
"xwayland-satellite-stable": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
niri.url = "github:sodiboo/niri-flake";
|
niri.url = "github:sodiboo/niri-flake";
|
||||||
|
niri.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
|
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
|
||||||
|
nix-vscode-extensions.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
@ -30,6 +35,7 @@
|
||||||
stylix,
|
stylix,
|
||||||
niri,
|
niri,
|
||||||
nix-vscode-extensions,
|
nix-vscode-extensions,
|
||||||
|
treefmt-nix,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -84,6 +90,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
formatter.x86_64-linux =
|
||||||
|
(treefmt-nix.lib.evalModule (pkgs [ ] "x86_64-linux") ./treefmt.nix).config.build.wrapper;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
treefmt.nix
Normal file
6
treefmt.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
projectRootFile = "flake.nix";
|
||||||
|
|
||||||
|
programs.nixfmt.enable = true;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue