/build.sh Secret
Created
January 29, 2020 08:54
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
#!/usr/bin/env bash | |
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage --option system aarch64-linux -I nixos-config=./default.nix |
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
{ pkgs, config, lib, ... }: | |
let | |
users = import ../common/users.nix { pkgs = pkgs; }; | |
in | |
{ | |
imports = [ | |
<nixpkgs/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix> | |
./hardware-configuration.nix | |
]; | |
sdImage = { | |
compressImage = false; | |
}; | |
users.extraUsers = users; | |
networking = { | |
hostName = "chii"; | |
domain = "jaen.me"; | |
dhcpcd.enable = false; | |
useDHCP = false; | |
wireless.enable = false; | |
defaultGateway = "192.168.1.1"; | |
nameservers = [ "192.168.1.2" "1.1.1.1" "8.8.8.8" "8.8.4.4" ]; | |
interfaces = { | |
eth0 = { | |
ipv4 = { | |
addresses = [{ | |
address = "192.168.1.3"; | |
prefixLength = 24; | |
}]; | |
# routes = [ | |
# { address = "192.168.1.3/24"; prefixLength = 0; via = "192.168.1.1"; } | |
# ]; | |
}; | |
}; | |
}; | |
}; | |
services.openssh = { | |
enable = true; | |
permitRootLogin = lib.mkForce "no"; | |
passwordAuthentication = false; | |
listenAddresses = [{ addr = "0.0.0.0"; }]; | |
}; | |
systemd.services.openssh.wantedBy = lib.mkOverride 10 [ | |
"default.target" | |
]; | |
} |
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
{ config, lib, pkgs, ... }: | |
{ | |
imports = [ | |
<nixpkgs/nixos/modules/installer/scan/not-detected.nix> | |
]; | |
boot.initrd.availableKernelModules = [ "usbhid" ]; | |
boot.initrd.kernelModules = [ ]; | |
boot.initrd.checkJournalingFS = false; | |
boot.kernelModules = [ ]; | |
boot.extraModulePackages = [ ]; | |
boot.loader.grub.enable = false; | |
boot.loader.raspberryPi = { | |
enable = true; | |
version = 4; | |
}; | |
hardware.enableRedistributableFirmware = true; | |
fileSystems."/" = { | |
device = "/dev/disk/by-label/NIXOS_SD"; | |
fsType = "ext4"; | |
}; | |
swapDevices = [{ | |
device = "/swapfile"; | |
size = 2048; | |
}]; | |
nix.maxJobs = lib.mkDefault 4; | |
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment