diff options
author | EuAndreh <eu@euandre.org> | 2019-06-12 22:25:05 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-06-12 22:25:05 -0300 |
commit | b48400a6b1ab7595ac0c2dbac461d02217d18888 (patch) | |
tree | 732e633a7e44eb5b2ec74fa1be9ceddf7bcd3c77 | |
parent | deploy.sh: assert dir before running finish-phase (diff) | |
download | toph-b48400a6b1ab7595ac0c2dbac461d02217d18888.tar.gz toph-b48400a6b1ab7595ac0c2dbac461d02217d18888.tar.xz |
default.nix: Use shell helper functions from utils.nix
-rw-r--r-- | default.nix | 31 | ||||
-rw-r--r-- | utils.nix | 14 |
2 files changed, 24 insertions, 21 deletions
diff --git a/default.nix b/default.nix index cc64016..98d73d4 100644 --- a/default.nix +++ b/default.nix @@ -32,33 +32,22 @@ in rec { touch $out ''; }); - shellEnvironment = utils.baseTask.overrideAttrs (baseAttrs: { - name = "${baseAttrs.name}-shell-inputs"; - buildInputs = with pkgs; [ - gitMinimal - git-crypt - gettext - terraform-providers.digitalocean - terraform - ansible - ]; - buildPhase = '' - echo "Can build shell environment buildInputs!" - echo noop > $out - ''; - }); + shellBuildInputs = with pkgs; [ + gitMinimal + git-crypt + gettext + terraform-providers.digitalocean + terraform + ansible + ]; }; test = utils.test [ (utils.shellcheck null) (utils.fixme null) + (utils.shellEnvironmentBuild subtasks.shellBuildInputs) utils.formatNix subtasks.formatTerraform subtasks.dockerComposeLint - subtasks.shellEnvironment ]; - # Used in .build.yml to run Bash scripts - shell = pkgs.mkShell rec { - name = "vps-shell"; - buildInputs = subtasks.shellEnvironment.buildInputs; - }; + shell = utils.shellEnvironment subtasks.shellBuildInputs; } @@ -81,6 +81,20 @@ in rec { touch $out ''; }); + shellEnvironmentBuild = shellBuildInputs: + baseTask.overrideAttrs (baseAttrs: { + name = "${baseAttrs.name}-shell-build-inputs"; + buildPhase = '' + echo "Can build shell environment for shellBuildInputs!" + echo noop > $out + ''; + }); + shellEnvironment = shellBuildInputs: + baseTask.overrideAttrs (baseAttrs: + pkgs.mkshell { + name = "${baseAttrs.name}-shell"; + buildInputs = shellBuildInputs; + }); overwritingPublishScript = { docsDerivation, overwrite ? true }: pkgs.writeShellScriptBin "publish.sh" '' set -euo pipefail |