Skip to content

Commit

Permalink
refac(back): fluidattacks#1007 redefine cache module
Browse files Browse the repository at this point in the history
- make the cache module generic
- add priority to use the different caches
- add cache server type
- by default the server only read the cache,
  it must be specified that the cache is also written
  • Loading branch information
drestrepoatfluid authored and Diego Restrepo committed Feb 20, 2023
1 parent dcfa9a5 commit 0037227
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ David Acevedo <dacevedoa12@gmail.com> David Acevedo <dacevedoa12@gmail.com>
David Arnold <david.arnold@iohk.io> David Arnold <david.arnold@iohk.io>
David Arnold <david.arnold@iohk.io> David Arnold <dgx.arnold@gmail.com>
Diego Restrepo <drestrepo@fluidattacks.com> Diego Restrepo Mesa <36453706+drestrepom@users.noreply.github.com>
Diego Restrepo <drestrepo@fluidttacks.com> Diego Restrepo <drestrepo@fluidttacks.com>
Diego Restrepo <restrepomesadiego@gmail.com> Diego Restrepo Mesa <36453706+drestrepom@users.noreply.github.com>
Fluid Attacks <help@fluidattacks.com> Fluid Attacks <help@fluidattacks.com>
Github Dependabot <49699333+dependabot[bot]@users.noreply.github.com> dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Expand Down
40 changes: 25 additions & 15 deletions src/evaluator/modules/cache/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,38 @@
}: {
options = {
cache = {
readAndWrite = {
enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
name = lib.mkOption {
type = lib.types.str;
};
pubKey = lib.mkOption {
type = lib.types.str;
};
};
readExtra = lib.mkOption {
default = [];
type = lib.types.listOf (lib.types.submodule (_: {
extra = lib.mkOption {
default = {};
type = lib.types.attrsOf (lib.types.submodule (_: {
options = {
enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
name = lib.mkOption {
type = lib.types.str;
};
token = lib.mkOption {
type = lib.types.str;
default = "";
};
priority = lib.mkOption {
type = lib.types.int;
};
pubKey = lib.mkOption {
default = "";
type = lib.types.str;
};
type = lib.mkOption {
type = lib.types.enum ["cachix" "attic"];
};
url = lib.mkOption {
type = lib.types.str;
};
write = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
}));
};
Expand Down
1 change: 1 addition & 0 deletions src/evaluator/modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
} @ args: {
imports = [
(import ./cache/default.nix args)
(import ./cache-with-attic/default.nix args)
(import ./calculate-scorecard/default.nix args)
(import ./compute-on-aws-batch/default.nix args)
(import ./dev/default.nix args)
Expand Down

0 comments on commit 0037227

Please sign in to comment.