Skip to content

Commit

Permalink
Add nix-fmt pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed Mar 20, 2024
1 parent 17cf1c9 commit 368a38f
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Pre-commit config
.pre-commit-config.yaml

# Virtual Machines Disks
*.qcow2
113 changes: 112 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};

pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { nixpkgs, nixpkgs-unstable, ... } @ inputs:
outputs = { nixpkgs, nixpkgs-unstable, pre-commit-hooks, ... } @ inputs:
let
system = "x86_64-linux";

Expand All @@ -32,9 +37,23 @@
];
});
in
{
rec {
formatter.${system} = pkgs.nixpkgs-fmt;

checks.${system}.pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt = {
enable = true;
name = pkgs.lib.mkForce "Nix files format";
};
};
};

devShells.${system}.default = pkgs.mkShell {
inherit (checks.${system}.pre-commit-check) shellHook;
};

nixosConfigurations = {
Bacon = nixpkgs.lib.nixosSystem
(import ./bacon.nix { inherit inputs system pkgs; });
Expand Down
8 changes: 4 additions & 4 deletions system/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@
description = "oui oui baguette";
languages = [ "eng" ];
symbolsFile =
let
ouioui = (pkgs.callPackage ./qwerty-fr.nix { });
in
"${ouioui}/usr/share/X11/xkb/symbols/us_qwerty-fr";
let
ouioui = (pkgs.callPackage ./qwerty-fr.nix { });
in
"${ouioui}/usr/share/X11/xkb/symbols/us_qwerty-fr";
};

libinput = {
Expand Down

0 comments on commit 368a38f

Please sign in to comment.