diff --git a/checks/default.nix b/checks/default.nix index 38df4ee..650148e 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -1,35 +1,23 @@ -{ - inputs, - self, - lib, - ... -}: { - imports = [ - inputs.treefmt-nix.flakeModule - inputs.pre-commit-hooks.flakeModule - ]; +{ inputs, self, lib, ... }: { + imports = [ inputs.treefmt-nix.flakeModule inputs.git-hooks-nix.flakeModule ]; - perSystem = _: { + perSystem = { pkgs, ... }: { treefmt.config = { projectRootFile = ".git/config"; - programs.alejandra.enable = true; + programs.nixfmt.enable = true; }; - pre-commit.settings.hooks = { - alejandra.enable = true; - # deadnix.enable = true; - # statix.enable = true; - }; + pre-commit.settings.hooks = { nixfmt.enable = true; }; + + formatter = pkgs.nixfmt-rfc-style; }; - flake.checks = let - build = _: nc: nc.config.system.build.toplevel; + flake.checks = let build = _: nc: nc.config.system.build.toplevel; in { - x86_64-linux = lib.mapAttrs build { - inherit (self.nixosConfigurations) picard; - }; + x86_64-linux = + lib.mapAttrs build { inherit (self.nixosConfigurations) picard; }; aarch64-linux = lib.mapAttrs build { - inherit (self.nixosConfigurations) sisko; #pbp; + inherit (self.nixosConfigurations) sisko; # pbp; }; }; } diff --git a/flake.lock b/flake.lock index 4bbbc41..6037f2b 100644 --- a/flake.lock +++ b/flake.lock @@ -241,10 +241,33 @@ "type": "github" } }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1726745158, + "narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ - "pre-commit-hooks", + "git-hooks-nix", "nixpkgs" ] }, @@ -675,11 +698,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1726447378, - "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", "type": "github" }, "original": { @@ -851,29 +874,6 @@ "type": "gitlab" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1725513492, - "narHash": "sha256-tyMUA6NgJSvvQuzB7A1Sf8+0XCHyfSPRx/b00o6K0uo=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "7570de7b9b504cfe92025dd1be797bf546f66528", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "purescript-overlay": { "inputs": { "nixpkgs": [ @@ -944,6 +944,7 @@ "disko": "disko", "dream2nix": "dream2nix", "flakeParts": "flakeParts", + "git-hooks-nix": "git-hooks-nix", "homeManager": "homeManager", "homeManagerGitWorkspace": "homeManagerGitWorkspace", "impermanence": "impermanence", @@ -955,7 +956,6 @@ "nixThePlanet": "nixThePlanet", "nixosHardware": "nixosHardware", "nixpkgs": "nixpkgs_5", - "pre-commit-hooks": "pre-commit-hooks", "rock5b": "rock5b", "treefmt-nix": "treefmt-nix_2", "vscode-server": "vscode-server" diff --git a/flake.nix b/flake.nix index 638d2af..96e3a2c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,6 @@ { - description = "A complete, declarative, and reproducible configuration of my entire Nix fleet"; + description = + "A complete, declarative, and reproducible configuration of my entire Nix fleet"; inputs = { flakeParts.url = "github:hercules-ci/flake-parts"; @@ -20,8 +21,8 @@ url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; - pre-commit-hooks = { - url = "github:cachix/pre-commit-hooks.nix"; + git-hooks-nix = { + url = "github:cachix/git-hooks.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; agenix.url = "github:ryantm/agenix"; @@ -57,8 +58,8 @@ vscode-server.url = "github:nix-community/nixos-vscode-server"; }; - outputs = inputs @ {flakeParts, ...}: - flakeParts.lib.mkFlake {inherit inputs;} { + outputs = inputs@{ flakeParts, ... }: + flakeParts.lib.mkFlake { inherit inputs; } { imports = [ # TODO export modules as flake outputs # ./modules @@ -68,6 +69,6 @@ ./shell ./checks ]; - systems = ["x86_64-linux" "aarch64-linux"]; + systems = [ "x86_64-linux" "aarch64-linux" ]; }; } diff --git a/shell/default.nix b/shell/default.nix index f8e8240..38c8fc6 100644 --- a/shell/default.nix +++ b/shell/default.nix @@ -1,9 +1,5 @@ -{inputs, ...}: { - perSystem = { - pkgs, - config, - ... - }: { +{ + perSystem = { pkgs, config, ... }: { devShells.default = pkgs.mkShell { name = "fleet-shell"; buildInputs = with pkgs; [