mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 23:14:57 +08:00
treefmt: gg
This commit is contained in:
parent
46354c2c22
commit
2422448c3f
5 changed files with 27 additions and 44 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
/result
|
||||
/.direnv
|
||||
/.pre-commit-config.yaml
|
||||
|
|
|
|||
56
flake.lock
generated
56
flake.lock
generated
|
|
@ -569,6 +569,22 @@
|
|||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1732021966,
|
||||
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks_2": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
"nixvim",
|
||||
|
|
@ -1314,22 +1330,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_11": {
|
||||
"locked": {
|
||||
"lastModified": 1680945546,
|
||||
"narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d9f759f2ea8d265d974a6e1259bd510ac5844c5d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1716542732,
|
||||
|
|
@ -1458,7 +1458,7 @@
|
|||
"devshell": "devshell",
|
||||
"flake-compat": "flake-compat_3",
|
||||
"flake-parts": "flake-parts_3",
|
||||
"git-hooks": "git-hooks",
|
||||
"git-hooks": "git-hooks_2",
|
||||
"home-manager": "home-manager_3",
|
||||
"nix-darwin": "nix-darwin_2",
|
||||
"nixpkgs": [
|
||||
|
|
@ -1643,6 +1643,7 @@
|
|||
"bevel": "bevel",
|
||||
"disko": "disko",
|
||||
"flake-parts": "flake-parts_2",
|
||||
"git-hooks": "git-hooks",
|
||||
"github-nix-ci": "github-nix-ci",
|
||||
"home-manager": "home-manager_2",
|
||||
"hyprland": "hyprland",
|
||||
|
|
@ -1656,8 +1657,7 @@
|
|||
"nixvim": "nixvim",
|
||||
"nuenv": "nuenv",
|
||||
"omnix": "omnix",
|
||||
"ragenix": "ragenix",
|
||||
"treefmt-nix": "treefmt-nix_4"
|
||||
"ragenix": "ragenix"
|
||||
}
|
||||
},
|
||||
"rust-flake": {
|
||||
|
|
@ -1961,24 +1961,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix_4": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_11"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689243103,
|
||||
"narHash": "sha256-IfBt2AD8qCwZs+m6BlOGEitBIkVJ0iMscMueb6QYUk4=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "f1dca68b908f3dd656b923b9fb62f7d755133662",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"validity": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@
|
|||
nix-doom-emacs-unstraightened.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# Devshell
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
git-hooks.flake = false;
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, ... }:
|
||||
|
|
|
|||
2
justfile
2
justfile
|
|
@ -13,4 +13,4 @@ deploy:
|
|||
|
||||
# Format the nix source tree
|
||||
fmt:
|
||||
treefmt
|
||||
pre-commit run --all-files
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
(inputs.git-hooks + /flake-module.nix)
|
||||
];
|
||||
perSystem = { inputs', config, pkgs, ... }: {
|
||||
devShells.default = pkgs.mkShell {
|
||||
name = "nixos-config-shell";
|
||||
meta.description = "Dev environment for nixos-config";
|
||||
inputsFrom = [ config.treefmt.build.devShell ];
|
||||
inputsFrom = [ config.pre-commit.devShell ];
|
||||
packages = with pkgs; [
|
||||
just
|
||||
colmena
|
||||
|
|
@ -16,9 +16,8 @@
|
|||
];
|
||||
};
|
||||
|
||||
treefmt.config = {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.nixpkgs-fmt.enable = true;
|
||||
pre-commit.settings = {
|
||||
hooks.nixpkgs-fmt.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue