1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-18 13:31:36 +03:00
mobile-nixos/lib/image-builder/tests/filesystems/default.nix
2019-08-28 15:43:28 -04:00

32 lines
788 B
Nix

# Tests all known filesystems as empty, with defaults.
# This test helps ensure the basic interface stays stable, and works.
{ pkgs ? import <nixpkgs> {} }:
let
imageBuilder = pkgs.callPackage <image-builder> {};
inherit (pkgs.lib.attrsets) mapAttrsToList;
inherit (pkgs.lib.strings) concatStringsSep removePrefix;
in
with imageBuilder;
let
cmds =
mapAttrsToList (name: fn:
let
fs = fn {
name = removePrefix "make" name;
size = size.MiB 10;
# FIXME : this is wrong. Not all partition IDs have the same format.
partitionID = "0123456789ABCDEF";
};
in
''
cp ${fs}/${fs.filename} $out/
'') fileSystem;
in
pkgs.runCommandNoCC "filesystems-test" {} ''
mkdir -p $out/
${concatStringsSep "\n" cmds}
''