-
Notifications
You must be signed in to change notification settings - Fork 1
/
sd-image.nix
58 lines (51 loc) · 1.57 KB
/
sd-image.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ config, pkgs, lib, ... }: {
nixpkgs.overlays = [
(import ./overlay.nix)
];
#nixpkgs.crossSystem.system = "aarch64-linux";
#nixpkgs.config.allowBroken = true;
# building with emulation
#nixpkgs.system = "aarch64-linux";
boot = {
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
consoleLogLevel = lib.mkDefault 7;
kernelPackages = pkgs.linuxPackagesFor (pkgs.callPackage ./kernel.nix
{
kernelPatches = [
{
name = "NanoPi-R4S-dts";
patch = ./patches/rockchip-rk3399-add-support-for-FriendlyARM-NanoPi-R4S.patch;
}
#r4s-doc = {
#name = "NanoPi-R4S-doc";
#patch = ./patches/dt-bindings-Add-doc-for-FriendlyARM-NanoPi-R4S.patch;
#};
];
#kernelPatches = [ r4s-dts r4s-doc ];
});
#pkgs.linuxPackagesNanopiR4S;
kernelParams = ["cma=32M" "console=ttyS2,115200n8" "console=tty0"];
};
sdImage = {
# bzip2 compression takes loads of time with emulation, skip it.
compressImage = false;
populateFirmwareCommands = '''';
populateRootCommands = ''
mkdir -p ./files/boot
${config.boot.loader.generic-extlinux-compatible.populateCmd} -t 3 -c ${config.system.build.toplevel} -d ./files/boot
'';
};
# Enable OpenSSH
services.sshd.enable = true;
# root autologin etc
users.users.root.password = "root";
services.openssh.permitRootLogin = lib.mkDefault "yes";
services.getty.autologinUser = lib.mkDefault "root";
#users.extraUsers.root.openssh.authorizedKeys.keys = [
# ""
#];
networking.firewall.enable = false;
}