hello-from-mt300.nix (1132B)
1 { config, pkgs, lib, ... } : 2 let 3 inherit (pkgs) serviceFns; 4 svc = config.system.service; 5 6 in rec { 7 imports = [ 8 ../modules/network 9 ../modules/ssh 10 ../modules/vlan 11 ]; 12 13 boot.tftp = { 14 # IP addresses to use in the boot monitor when flashing/ booting 15 # over TFTP. If you are flashing using the stock firmware's Web UI 16 # then these dummy values are fine 17 ipaddr = "192.0.2.115"; # my address 18 serverip = "192.0.2.5"; # build machine or other tftp server 19 }; 20 21 hostname = "hello"; 22 23 services.dhcpc = svc.network.dhcp.client.build { 24 interface = config.hardware.networkInterfaces.lan; 25 26 # don't start DHCP until the hostname is configured, 27 # so it can identify itself to the DHCP server 28 dependencies = [ config.services.hostname ]; 29 }; 30 31 services.sshd = svc.ssh.build { }; 32 33 users.root = { 34 # the password is "secret". Use mkpasswd -m sha512crypt to 35 # create this hashed password string 36 passwd = "$6$y7WZ5hM6l5nriLmo$5AJlmzQZ6WA.7uBC7S8L4o19ESR28Dg25v64/vDvvCN01Ms9QoHeGByj8lGlJ4/b.dbwR9Hq2KXurSnLigt1W1"; 37 }; 38 39 defaultProfile.packages = with pkgs; [ 40 figlet 41 ]; 42 }