1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/modules/initrd-network.nix

44 lines
831 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.mobile.boot.stage-1.networking;
IP = cfg.IP;
hostIP = cfg.hostIP;
in
{
options.mobile.boot.stage-1.networking = {
enable = mkOption {
type = types.bool;
2018-07-08 03:22:39 +03:00
default = false;
description = ''
Enables networking.
'';
};
IP = mkOption {
type = types.str;
default = "172.16.42.1";
description = ''
IP address for the USB networking gadget.
'';
};
hostIP = mkOption {
type = types.str;
default = "172.16.42.2";
description = ''
IP address for the USB networking gadget.
'';
};
};
config.mobile.boot.stage-1 = lib.mkIf cfg.enable {
tasks = [
./stage-1/tasks/dhcpd-task.rb
];
bootConfig = {
boot.networking = cfg;
};
};
}