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