summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2024-06-30 09:53:01 -0400
committerseth <[email protected]>2024-06-30 09:53:01 -0400
commitb4d966fe359ef889c3ba1441af01683a549f147b (patch)
tree28ff0e5fde73aff7a2aec88714a2de7fd653f74c
parente00e18b05f519c7f82031477d5759665abd890d1 (diff)
chore: drop flake-checks
-rw-r--r--flake.lock16
-rw-r--r--flake.nix90
2 files changed, 57 insertions, 49 deletions
diff --git a/flake.lock b/flake.lock
index 70607d3..6af95cc 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,20 +1,5 @@
{
"nodes": {
- "flake-checks": {
- "locked": {
- "lastModified": 1716193450,
- "narHash": "sha256-wIbyIQRoLAfGe2v8W7LM6zEZ9Oy0jKuUX0HMUCLQJsM=",
- "owner": "getchoo",
- "repo": "flake-checks",
- "rev": "842c3f225677aa55e44b94342f19c8f3e6f2be06",
- "type": "github"
- },
- "original": {
- "owner": "getchoo",
- "repo": "flake-checks",
- "type": "github"
- }
- },
"nixpkgs": {
"locked": {
"lastModified": 1719468428,
@@ -33,7 +18,6 @@
},
"root": {
"inputs": {
- "flake-checks": "flake-checks",
"nixpkgs": "nixpkgs"
}
}
diff --git a/flake.nix b/flake.nix
index 71f63ed..68234c8 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,17 +1,10 @@
{
description = "getchoo's neovim config";
- inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- flake-checks.url = "github:getchoo/flake-checks";
- };
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs =
- {
- self,
- nixpkgs,
- flake-checks,
- }:
+ { self, nixpkgs }:
let
systems = [
"x86_64-linux"
@@ -20,38 +13,67 @@
"aarch64-darwin"
];
- forAllSystems =
- fn:
- nixpkgs.lib.genAttrs systems (
- system:
- fn {
- inherit system;
- pkgs = nixpkgs.legacyPackages.${system};
- }
- );
+ forAllSystems = nixpkgs.lib.genAttrs systems;
+ nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system});
in
{
checks = forAllSystems (
- { pkgs, ... }:
+ system:
let
- flake-checks' = flake-checks.lib.mkChecks {
- root = ./.;
- inherit pkgs;
- };
+ pkgs = nixpkgsFor.${system};
in
{
- inherit (flake-checks')
- actionlint
- alejandra
- selene
- statix
- stylua
- ;
+ check-formatting =
+ pkgs.runCommand "check-formatting"
+ {
+ nativeBuildInputs = [
+ pkgs.actionlint
+ pkgs.nixfmt-rfc-style
+ pkgs.stylua
+ ];
+ }
+ ''
+ cd ${./.}
+
+ echo "running actionlint..."
+ actionlint ./.github/workflows/*
+
+ echo "running nixfmt..."
+ nixfmt --check .
+
+ echo "running stylua..."
+ stylua --check .
+
+ touch $out
+ '';
+
+ check-lint =
+ pkgs.runCommand "check-lint"
+ {
+ nativeBuildInputs = [
+ pkgs.selene
+ pkgs.statix
+ ];
+ }
+ ''
+ cd ${./.}
+
+ echo "running selene..."
+ selene .
+
+ echo "running statix..."
+ statix check .
+
+ touch $out
+ '';
}
);
devShells = forAllSystems (
- { pkgs, system }:
+ system:
+ let
+ pkgs = nixpkgsFor.${system};
+ in
{
default = pkgs.mkShellNoCC {
packages = [
@@ -72,11 +94,13 @@
}
);
- formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-rfc-style);
+ formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style);
packages = forAllSystems (
- { pkgs, system }:
+ system:
let
+ pkgs = nixpkgsFor.${system};
+
packages' = self.packages.${system};
version = self.shortRev or self.dirtyShortRev or "unknown";
in