Created
February 14, 2018 22:24
-
-
Save telent/4d2caff9602aaae1eef78fc6d206ab33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
let | |
platform = { | |
uboot = null; | |
endian = "big"; | |
name = "yun"; | |
kernelArch = "mips"; | |
gcc = { abi = "32"; } ; | |
bfdEmulation = "elf32btsmip"; | |
kernelHeadersBaseConfig = "ath79_defconfig"; | |
}; | |
myKeys = (stdenv.lib.splitString "\n" ( builtins.readFile "/etc/ssh/authorized_keys.d/dan" ) ); | |
config = { pkgs, stdenv, ... } : { | |
interfaces = { | |
wired = { | |
device = "eth1"; | |
address = "192.168.0.251"; | |
defaultRoute = "192.168.0.254"; | |
}; | |
}; | |
etc = { | |
"resolv.conf" = { content = ( stdenv.lib.readFile "/etc/resolv.conf" );}; | |
}; | |
users = [ | |
{name="root"; uid=0; gid=0; gecos="Super User"; dir="/root"; | |
shell="/bin/sh"; authorizedKeys = myKeys;} | |
{name="store"; uid=500; gid=500; gecos="Storage owner"; dir="/srv"; | |
shell="/dev/null"; authorizedKeys = [];} | |
{name="dan"; uid=1000; gid=1000; gecos="Daniel"; dir="/home/dan"; | |
shell="/bin/sh"; authorizedKeys = myKeys;} | |
]; | |
services = { | |
dropbear = { | |
start = "${pkgs.dropbear}/bin/dropbear -s -P /run/dropbear.pid"; | |
depends = [ "wired"]; | |
hostKey = ./ssh_host_key; | |
}; | |
syslogd = { start = "/bin/syslogd -R 192.168.0.2"; | |
depends = ["wired"]; }; | |
ntpd = { start = "/bin/ntpd -p pool.ntp.org" ; | |
depends = ["wired"]; }; | |
}; | |
}; | |
in ((import ./nixwrt) platform config).tftproot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment