Skip to content

Commit

Permalink
Merge pull request #90 from hercules-ci/cleanups
Browse files Browse the repository at this point in the history
Cleanups
  • Loading branch information
roberth authored Nov 11, 2022
2 parents 692309d + 6ecbe19 commit 244595b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
5 changes: 2 additions & 3 deletions effects/flake-update/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let
};
in

args@{ gitRemote
{ gitRemote
, tokenSecret ? { type = "GitToken"; }
, user ? "git"
, updateBranch ? "flake-update"
Expand All @@ -27,8 +27,7 @@ mkEffect ({
inherit (url) scheme host path;

name = "flake-update";
dontUnpack = true;
nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [
inputs = [
pkgs.git
pkgs.nix
];
Expand Down
10 changes: 5 additions & 5 deletions effects/flake-update/flake-module.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{ config, lib, withSystem, ... }:
let
inherit (lib) mkOption types optionalAttrs;
cfg = config.flake-update;
cfg = config.hercules-ci.flake-update;
in
{
options = {
flake-update = {
hercules-ci.flake-update = {
enable = lib.mkEnableOption "Scheduled flake update job";
updateBranch = mkOption {
type = types.str;
default = "flake-update";
example = "update";
description = lib.mdDoc ''
description = ''
To which branch to push the updated flake lock.
'';
};
when = mkOption {
type = types.raw;
description = lib.mdDoc ''
description = ''
See `herculesCI.onSchedule.<name>.when` for details.
'';
};
Expand All @@ -26,7 +26,7 @@ in
default = config.defaultEffectSystem;
defaultText = lib.literalExpression "config.defaultEffectSystem";
example = "aarch64-linux";
description = lib.mdDoc ''
description = ''
The [system](https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-system) on which to run the flake update job.
'';
};
Expand Down
11 changes: 4 additions & 7 deletions flake-modules/herculesCI-attribute.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ let
_Since hercules-ci-agent 0.9.8_
'';
defaultText = lib.literalMD "";
default = throw "repo.remoteHttpUrl requires hercules-ci-agent >=0.9.8. If you run hci effect run, make sure your repository remote has an http(s) URL.";
};
remoteSshUrl = mkOption {
type = types.str;
Expand All @@ -70,7 +69,6 @@ let
_Since hercules-ci-agent 0.9.8_
'';
defaultText = lib.literalMD "";
default = throw "repo.remoteHttpUrl requires hercules-ci-agent >=0.9.8. If you run hci effect run, make sure your repository remote has an ssh URL.";
};
webUrl = mkOption {
type = types.str;
Expand All @@ -81,7 +79,6 @@ let
_Since hercules-ci-agent 0.9.8_
'';
defaultText = lib.literalMD "";
default = throw "repo.webUrl requires hercules-ci-agent >=0.9.8. If you run hci effect run, make sure your repository remote has an http URL.";
};
forgeType = mkOption {
type = types.str;
Expand All @@ -95,7 +92,6 @@ let
'';
example = "github";
defaultText = lib.literalMD "";
default = throw "repo.forgeType requires hercules-ci-agent >=0.9.8.";
};
owner = mkOption {
type = types.str;
Expand All @@ -106,7 +102,6 @@ let
'';
readOnly = true;
defaultText = lib.literalMD "";
default = throw "repo.owner requires hercules-ci-agent >=0.9.8.";
};
name = mkOption {
type = types.str;
Expand All @@ -117,7 +112,6 @@ let
'';
readOnly = true;
defaultText = lib.literalMD "";
default = throw "repo.name requires hercules-ci-agent >=0.9.8.";
};
};
};
Expand Down Expand Up @@ -232,7 +226,10 @@ let
ciSystems = mkOption {
type = types.listOf types.str;
default = flakeParts.config.systems;
defaultText = lib.literalExpressions "config.systems # from flake parts";
defaultText = lib.literalExpression "config.systems # from flake parts";
description = ''
Flake systems for which to generate attributes in `herculesCI.onPush.default.outputs`.
'';
};
};
config = {
Expand Down
6 changes: 3 additions & 3 deletions flake-modules/module-argument.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ in
herculesCIEffects.pkgs = mkOption {
type = types.raw or types.unspecified;
description = ''
Nixpkgs instance to use for <literal>hercules-ci-effects</literal>.
Nixpkgs instance to use for `hercules-ci-effects`.
The effects functions, etc, will be provided as the <literal>effects</literal> module argument of <literal>perSystem</literal>.
The effects functions, etc, will be provided as the `effects` module argument of `perSystem`.
'';
default = pkgs;
defaultText = lib.literalDocBook "<literal>pkgs</literal> (module argument)";
defaultText = lib.literalMD "`pkgs` (module argument)";
};
};
config = {
Expand Down

0 comments on commit 244595b

Please sign in to comment.