ci(nix): drop pre-commit-hooks

Signed-off-by: seth <getchoo@tuta.io>
This commit is contained in:
seth 2024-08-20 01:47:03 -04:00
parent 4c81d8c53d
commit 7a83d0cea0
No known key found for this signature in database
GPG Key ID: D31BD0D494BBEE86
3 changed files with 25 additions and 100 deletions

51
flake.lock generated
View File

@ -36,27 +36,6 @@
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"libnbtplusplus": {
"flake": false,
"locked": {
@ -89,40 +68,12 @@
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": [
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1723803910,
"narHash": "sha256-yezvUuFiEnCFbGuwj/bQcqg7RykIEqudOy/RBrId0pc=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "bfef0ada09e2c8ac55bbcd0831bd0c9d42e651ba",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"libnbtplusplus": "libnbtplusplus",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
"nixpkgs": "nixpkgs"
}
}
},

View File

@ -12,30 +12,36 @@
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
};
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
libnbtplusplus = {
url = "github:PrismLauncher/libnbtplusplus";
flake = false;
};
/*
Inputs below this are optional and can be removed
```
{
inputs.prismlauncher = {
url = "github:PrismLauncher/PrismLauncher";
inputs = {
flake-compat.follows = "";
};
};
}
```
*/
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs =
{ flake-parts, pre-commit-hooks, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
pre-commit-hooks.flakeModule
./nix/dev.nix
./nix/distribution.nix
];

View File

@ -1,41 +1,9 @@
{
perSystem =
{ pkgs, self', ... }:
{
config,
lib,
pkgs,
...
}:
{
pre-commit.settings = {
hooks = {
markdownlint.enable = true;
deadnix.enable = true;
nil.enable = true;
nixfmt.enable = true;
clang-format = {
enable = true;
types_or = [
"c"
"c++"
"java"
"json"
"objective-c"
];
};
};
tools.clang-tools = lib.mkForce pkgs.clang-tools_18;
};
devShells.default = pkgs.mkShell {
shellHook = ''
${config.pre-commit.installationScript}
'';
inputsFrom = [ config.packages.prismlauncher-unwrapped ];
inputsFrom = [ self'.packages.prismlauncher-unwrapped ];
buildInputs = with pkgs; [
ccache
ninja