Skip to content

Commit 0b02064

Browse files
committed
develop: formatting
1 parent 46be373 commit 0b02064

File tree

5 files changed

+62
-36
lines changed

5 files changed

+62
-36
lines changed

flake.lock

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# home-manager.url = "github:nix-community/home-manager";
99
# home-manager.inputs.nixpkgs.follows = "nixpkgs";
1010

11-
pre-commit-hooks.url = "github:cachix/git-hooks.nix";
12-
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
11+
git-hooks.url = "github:cachix/git-hooks.nix";
12+
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
1313
};
1414

1515
outputs =
@@ -59,7 +59,26 @@
5959
pkgs = nixpkgs.legacyPackages.${system};
6060
in
6161
{
62-
default = import ./shell.nix { inherit pkgs; };
62+
default =
63+
let
64+
inherit (self.checks.${system}.pre-commit-check) shellHook enabledPackages;
65+
in
66+
pkgs.mkShell {
67+
inherit shellHook;
68+
nativeBuildInputs = [
69+
enabledPackages
70+
]
71+
++ (with pkgs; [
72+
(python313.withPackages (
73+
p: with p; [
74+
mkdocs
75+
mkdocs-material
76+
mkdocs-material-extensions
77+
pygments
78+
]
79+
))
80+
]);
81+
};
6382
}
6483
);
6584

@@ -80,7 +99,7 @@
8099
# };
81100
# };
82101

83-
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
102+
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree);
84103

85104
checks = forAllSystems (
86105
system:
@@ -89,10 +108,15 @@
89108
flakePkgs = self.packages.${system};
90109
in
91110
{
92-
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
111+
pre-commit-check = inputs.git-hooks.lib.${system}.run {
93112
src = ./.;
94113
hooks = {
95-
nixfmt-rfc-style.enable = true;
114+
# TODO: Change to nixfmt-tree when git-hooks supports it
115+
nixfmt-rfc-style = {
116+
enable = true;
117+
package = pkgs.nixfmt-tree;
118+
entry = "${pkgs.nixfmt-tree}/bin/treefmt";
119+
};
96120
};
97121
};
98122
build-packages = pkgs.linkFarm "flake-packages-${system}" flakePkgs;

modules/home/nixvim/plugins/lsp.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ in
4949
nil_ls = {
5050
enable = mkDefault true;
5151
settings.nix.flake.autoArchive = false;
52-
settings.formatting.command = mkDefault [ "${pkgs.nixfmt-rfc-style}/bin/nixfmt" ];
52+
settings.formatting.command = mkDefault [ "${pkgs.nixfmt-tree}/bin/treefmt" ];
5353
};
5454
pyright.enable = mkDefault true;
5555
rust_analyzer = {

modules/nixos/virtualisation/vfio.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ in
9191
"vfio_pci"
9292
"vfio_iommu_type1"
9393
"vfio"
94-
] ++ optionals (versionOlder pkgs.linux.version "6.2") [ "vfio_virqfd" ];
94+
]
95+
++ optionals (versionOlder pkgs.linux.version "6.2") [ "vfio_virqfd" ];
9596

9697
# boot.blacklistedKernelModules = optionals cfg.blacklistNvidia [
9798
# "nouveau"

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
pkgs.mkShell {
77
nativeBuildInputs = with pkgs; [
88
nixfmt-tree
9+
pre-commit
910
(python313.withPackages (
1011
p: with p; [
1112
mkdocs

0 commit comments

Comments
 (0)