File tree Expand file tree Collapse file tree 5 files changed +62
-36
lines changed Expand file tree Collapse file tree 5 files changed +62
-36
lines changed Original file line number Diff line number Diff line change 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 =
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
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 :
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 ;
Original file line number Diff line number Diff line change 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 = {
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 66pkgs . mkShell {
77 nativeBuildInputs = with pkgs ; [
88 nixfmt-tree
9+ pre-commit
910 ( python313 . withPackages (
1011 p : with p ; [
1112 mkdocs
You can’t perform that action at this time.
0 commit comments