i staging all over
This commit is contained in:
parent
1cbeba0f18
commit
c0f591787a
3 changed files with 4 additions and 73 deletions
|
|
@ -4,8 +4,6 @@
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./sd-image.nix
|
|
||||||
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../modules
|
../../modules
|
||||||
inputs.agenix.nixosModules.default
|
inputs.agenix.nixosModules.default
|
||||||
|
|
@ -27,22 +25,6 @@
|
||||||
|
|
||||||
networking.hostName = "harmonica";
|
networking.hostName = "harmonica";
|
||||||
|
|
||||||
networking = {
|
|
||||||
interfaces."wlan0".useDHCP = true;
|
|
||||||
wireless = {
|
|
||||||
enable = true;
|
|
||||||
interfaces = ["wlan0"];
|
|
||||||
networks = {
|
|
||||||
"House_Bayram" = {
|
|
||||||
psk = "PASSWORD";
|
|
||||||
};
|
|
||||||
"it_hurts_when_IP" = {
|
|
||||||
psk = "PASSWORD";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# NTP time sync.
|
# NTP time sync.
|
||||||
services.timesyncd.enable = true;
|
services.timesyncd.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,24 +16,12 @@
|
||||||
algorithm = "zstd";
|
algorithm = "zstd";
|
||||||
};
|
};
|
||||||
|
|
||||||
sdImage = {
|
|
||||||
# bzip2 compression takes loads of time with emulation, skip it. Enable this if you're low on space.
|
|
||||||
compressImage = false;
|
|
||||||
imageName = "zero2.img";
|
|
||||||
|
|
||||||
extraFirmwareConfig = {
|
fileSystems."/" = {
|
||||||
# Give up VRAM for more Free System Memory
|
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
|
||||||
# - Disable camera which automatically reserves 128MB VRAM
|
fsType = "ext4";
|
||||||
start_x = 0;
|
|
||||||
# - Reduce allocation of VRAM to 16MB minimum for non-rotated (32MB for rotated)
|
|
||||||
gpu_mem = 16;
|
|
||||||
|
|
||||||
# Configure display to 800x600 so it fits on most screens
|
|
||||||
# * See: https://elinux.org/RPi_Configuration
|
|
||||||
hdmi_group = 2;
|
|
||||||
hdmi_mode = 8;
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
enableRedistributableFirmware = lib.mkForce false;
|
enableRedistributableFirmware = lib.mkForce false;
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
# This module extends the official sd-image.nix with the following:
|
|
||||||
# - ability to add options to the config.txt firmware
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
options.sdImage = with lib; {
|
|
||||||
extraFirmwareConfig = mkOption {
|
|
||||||
type = types.attrs;
|
|
||||||
default = {};
|
|
||||||
description = lib.mdDoc ''
|
|
||||||
Extra configuration to be added to config.txt.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
sdImage.populateFirmwareCommands =
|
|
||||||
lib.mkIf ((lib.length (lib.attrValues config.sdImage.extraFirmwareConfig)) > 0)
|
|
||||||
(
|
|
||||||
let
|
|
||||||
# Convert the set into a string of lines of "key=value" pairs.
|
|
||||||
keyValueMap = name: value: name + "=" + toString value;
|
|
||||||
keyValueList = lib.mapAttrsToList keyValueMap config.sdImage.extraFirmwareConfig;
|
|
||||||
extraFirmwareConfigString = lib.concatStringsSep "\n" keyValueList;
|
|
||||||
in
|
|
||||||
lib.mkAfter
|
|
||||||
''
|
|
||||||
config=firmware/config.txt
|
|
||||||
# The initial file has just been created without write permissions. Add them to be able to append the file.
|
|
||||||
chmod u+w $config
|
|
||||||
echo "\n# Extra configuration" >> $config
|
|
||||||
echo "${extraFirmwareConfigString}" >> $config
|
|
||||||
chmod u-w $config
|
|
||||||
''
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue