aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-12 22:25:05 -0300
committerEuAndreh <eu@euandre.org>2019-06-12 22:25:05 -0300
commitb48400a6b1ab7595ac0c2dbac461d02217d18888 (patch)
tree732e633a7e44eb5b2ec74fa1be9ceddf7bcd3c77
parentdeploy.sh: assert dir before running finish-phase (diff)
downloadserver-b48400a6b1ab7595ac0c2dbac461d02217d18888.tar.gz
server-b48400a6b1ab7595ac0c2dbac461d02217d18888.tar.xz
default.nix: Use shell helper functions from utils.nix
-rw-r--r--default.nix31
-rw-r--r--utils.nix14
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;
}
diff --git a/utils.nix b/utils.nix
index 3167399..438a5d8 100644
--- a/utils.nix
+++ b/utils.nix
@@ -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