mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
types,module,tests: run shellcheck on scripts before running them in NixOS tests
This commit is contained in:
parent
9afae0ba36
commit
0accdf4e20
5 changed files with 38 additions and 25 deletions
19
default.nix
19
default.nix
|
|
@ -1,5 +1,6 @@
|
|||
{ lib ? import <nixpkgs/lib>
|
||||
, rootMountPoint ? "/mnt"
|
||||
, checked ? false
|
||||
}:
|
||||
let
|
||||
types = import ./types { inherit lib rootMountPoint; };
|
||||
|
|
@ -18,33 +19,27 @@ in
|
|||
{
|
||||
types = types;
|
||||
create = cfg: types.diskoLib.create (eval cfg).config.devices;
|
||||
createScript = cfg: pkgs: pkgs.writeScript "disko-create" ''
|
||||
#!/usr/bin/env bash
|
||||
createScript = cfg: pkgs: (types.diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko-create" ''
|
||||
export PATH=${lib.makeBinPath (types.diskoLib.packages (eval cfg).config.devices pkgs)}:$PATH
|
||||
${types.diskoLib.create (eval cfg).config.devices}
|
||||
'';
|
||||
createScriptNoDeps = cfg: pkgs: pkgs.writeScript "disko-create" ''
|
||||
#!/usr/bin/env bash
|
||||
createScriptNoDeps = cfg: pkgs: (types.diskoLib.writeCheckedBash { inherit pkgs checked; noDeps = true; }) "disko-create" ''
|
||||
${types.diskoLib.create (eval cfg).config.devices}
|
||||
'';
|
||||
mount = cfg: types.diskoLib.mount (eval cfg).config.devices;
|
||||
mountScript = cfg: pkgs: pkgs.writeScript "disko-mount" ''
|
||||
#!/usr/bin/env bash
|
||||
mountScript = cfg: pkgs: (types.diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko-mount" ''
|
||||
export PATH=${lib.makeBinPath (types.diskoLib.packages (eval cfg).config.devices pkgs)}:$PATH
|
||||
${types.diskoLib.mount (eval cfg).config.devices}
|
||||
'';
|
||||
mountScriptNoDeps = cfg: pkgs: pkgs.writeScript "disko-mount" ''
|
||||
#!/usr/bin/env bash
|
||||
mountScriptNoDeps = cfg: pkgs: (types.diskoLib.writeCheckedBash { inherit pkgs checked; noDeps = true; }) "disko-mount" ''
|
||||
${types.diskoLib.mount (eval cfg).config.devices}
|
||||
'';
|
||||
zapCreateMount = cfg: types.diskoLib.zapCreateMount (eval cfg).config.devices;
|
||||
zapCreateMountScript = cfg: pkgs: pkgs.writeScript "disko-zap-create-mount" ''
|
||||
#!/usr/bin/env bash
|
||||
zapCreateMountScript = cfg: pkgs: (types.diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko-zap-create-mount" ''
|
||||
export PATH=${lib.makeBinPath (types.diskoLib.packages (eval cfg).config.devices pkgs)}:$PATH
|
||||
${types.diskoLib.zapCreateMount (eval cfg).config.devices}
|
||||
'';
|
||||
zapCreateMountScriptNoDeps = cfg: pkgs: pkgs.writeScript "disko-zap-create-mount" ''
|
||||
#!/usr/bin/env bash
|
||||
zapCreateMountScriptNoDeps = cfg: pkgs: (types.diskoLib.writeCheckedBash { inherit pkgs checked; noDeps = true; }) "disko-zap-create-mount" ''
|
||||
${types.diskoLib.zapCreateMount (eval cfg).config.devices}
|
||||
'';
|
||||
config = cfg: { imports = types.diskoLib.config (eval cfg).config.devices; };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue