mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-14 18:21:41 +03:00
44 lines
831 B
Nix
44 lines
831 B
Nix
{ 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;
|
|
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;
|
|
};
|
|
};
|
|
}
|