git.delta.rocks / fleet / refs/commits / 3ff14079c557

difftreelog

source

modules/usbd.nix1.5 KiBsourcehistory
1{2  lib,3  fleetLib,4  config,5  ...6}:7let8  inherit (lib.options) mkOption literalExpression;9  inherit (lib.types) listOf str submodule;10  inherit (fleetLib.options) mkHostsOption;1112  _file = ./usbd.nix;1314  usbdOptions = {15    signingKeyFiles = mkOption {16      description = ''17        Nix secret key files `fleet usbd write` signs the update closure with,18        resolved relative to the fleet project directory.19        Plain strings instead of paths, so the keys are not imported into the nix store.20      '';21      type = listOf str;22      default = [ ];23    };24  };25in26{27  options = {28    usbd = usbdOptions // {29      namingSecretFile = mkOption {30        description = ''31          File with the project-wide naming secret used to derive on-stick file32          names and encryption keys, resolved relative to the fleet project33          directory. Generated by `fleet usbd write` when missing.34          A plain string instead of a path, so the secret is not imported into35          the nix store.36        '';37        type = str;38        default = "usbd/naming.secret";39      };40    };41    hosts = mkHostsOption {42      inherit _file;43      options.usbd = mkOption {44        description = ''45          fleet-usbd stick writing configuration for this host.46        '';47        type = submodule { options = usbdOptions; };48        default = {49          inherit (config.usbd) signingKeyFiles;50        };51        defaultText = literalExpression "{ inherit (fleetConfiguration.usbd) signingKeyFiles; }";52      };53    };54  };55}