From b9d4d5cafb6fc63c073c86f047844c9475c9f2ff Mon Sep 17 00:00:00 2001 From: Victor Borja Date: Sun, 30 Nov 2025 18:50:54 -0600 Subject: [PATCH] use providerType in aspects Change-Id: rzvnnpxmltzyqtmvzqmsowxzmooxsmom --- .github/workflows/test.yml | 3 ++- checkmate/flake.lock | 16 ++++++++++------ checkmate/flake.nix | 2 +- nix/types.nix | 12 +++--------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7d582d..04c4d43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,4 +8,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: cachix/install-nix-action@v30 - - run: nix flake check -L github:$GITHUB_REPOSITORY/$GITHUB_SHA?dir=checkmate --override-input target github:$GITHUB_REPOSITORY/$GITHUB_SHA + - uses: actions/checkout@v5 + - run: nix flake check -L ./checkmate --override-input target . diff --git a/checkmate/flake.lock b/checkmate/flake.lock index c493ca5..dca23fb 100644 --- a/checkmate/flake.lock +++ b/checkmate/flake.lock @@ -128,14 +128,18 @@ }, "target": { "locked": { - "path": "..", - "type": "path" + "lastModified": 1763763502, + "narHash": "sha256-J78S02ZbBclWz7WKF8C+kHUca9/KdHtSeRgO/WF9LjY=", + "owner": "vic", + "repo": "flake-aspects", + "rev": "83c8e44186bc9631509a55cf5a053950ecd3dc30", + "type": "github" }, "original": { - "path": "..", - "type": "path" - }, - "parent": [] + "owner": "vic", + "repo": "flake-aspects", + "type": "github" + } }, "treefmt-nix": { "inputs": { diff --git a/checkmate/flake.nix b/checkmate/flake.nix index f46efc7..93c1369 100644 --- a/checkmate/flake.nix +++ b/checkmate/flake.nix @@ -3,7 +3,7 @@ outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); inputs = { - target.url = "path:.."; + target.url = "github:vic/flake-aspects"; flake-parts = { inputs.nixpkgs-lib.follows = "nixpkgs-lib"; url = "github:hercules-ci/flake-parts"; diff --git a/nix/types.nix b/nix/types.nix index b7c124c..ed2c5eb 100644 --- a/nix/types.nix +++ b/nix/types.nix @@ -5,7 +5,7 @@ let aspectsType = lib.types.submodule ( { config, ... }: { - freeformType = lib.types.attrsOf (lib.types.either aspectSubmoduleAttrs providerType); + freeformType = lib.types.attrsOf providerType; config._module.args.aspects = config; } ); @@ -30,7 +30,7 @@ let ); functionProviderType = lib.types.either functionToAspect (lib.types.functionTo providerType); - providerType = lib.types.either functionProviderType aspectSubmodule; + providerType = lib.types.either aspectSubmoduleAttrs functionProviderType; aspectSubmoduleAttrs = lib.types.addCheck aspectSubmodule ( m: (!builtins.isFunction m) || (isAspectSubmoduleFn m) @@ -78,13 +78,7 @@ let options.provides = lib.mkOption { description = "Providers of aspect for other aspects"; default = { }; - type = lib.types.submodule ( - { config, ... }: - { - freeformType = lib.types.attrsOf providerType; - config._module.args.provides = config; - } - ); + type = aspectsType; }; options.__functor = lib.mkOption { internal = true; -- 2.43.0