mirror of
https://github.com/nix-community/raspberry-pi-nix.git
synced 2025-11-15 23:12:45 +01:00
use make-disk-image instead of sd-image
This commit is contained in:
parent
aaec735faf
commit
fb248c0047
17 changed files with 570 additions and 229 deletions
81
example/common.nix
Normal file
81
example/common.nix
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{ config, inputs, lib, modulesPath, pkgs, ... }: {
|
||||
time.timeZone = "America/New_York";
|
||||
users.users.root.initialPassword = "root";
|
||||
networking = {
|
||||
hostName = "example";
|
||||
useDHCP = false;
|
||||
interfaces = {
|
||||
wlan0.useDHCP = true;
|
||||
eth0.useDHCP = true;
|
||||
};
|
||||
};
|
||||
raspberry-pi-nix = {
|
||||
board = "bcm2711";
|
||||
};
|
||||
hardware = {
|
||||
raspberry-pi = {
|
||||
config = {
|
||||
all = {
|
||||
base-dt-params = {
|
||||
BOOT_UART = {
|
||||
value = 1;
|
||||
enable = true;
|
||||
};
|
||||
uart_2ndstage = {
|
||||
value = 1;
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
dt-overlays = {
|
||||
disable-bt = {
|
||||
enable = true;
|
||||
params = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
fileSystems = {
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/ESP";
|
||||
fsType = "vfat";
|
||||
};
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
autoResize = true;
|
||||
};
|
||||
};
|
||||
boot.growPartition = true;
|
||||
system.build.image = (import "${toString modulesPath}/../lib/make-disk-image.nix" {
|
||||
inherit lib config pkgs;
|
||||
format = "raw";
|
||||
partitionTableType = "efi";
|
||||
copyChannel = false;
|
||||
diskSize = "auto";
|
||||
additionalSpace = "64M";
|
||||
bootSize = "128M";
|
||||
touchEFIVars = false;
|
||||
installBootLoader = true;
|
||||
label = "nixos";
|
||||
deterministic = true;
|
||||
});
|
||||
|
||||
nix.settings.substituters = lib.mkForce config.nix.settings.trusted-substituters;
|
||||
nix.settings.trusted-substituters = [
|
||||
"https://cache.nixos.org/"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
nix.settings.trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
time.timeZone = "America/New_York";
|
||||
users.users.root.initialPassword = "root";
|
||||
networking = {
|
||||
hostName = "example";
|
||||
useDHCP = false;
|
||||
interfaces = {
|
||||
wlan0.useDHCP = true;
|
||||
eth0.useDHCP = true;
|
||||
};
|
||||
};
|
||||
raspberry-pi-nix.board = "bcm2711";
|
||||
hardware = {
|
||||
raspberry-pi = {
|
||||
config = {
|
||||
all = {
|
||||
base-dt-params = {
|
||||
BOOT_UART = {
|
||||
value = 1;
|
||||
enable = true;
|
||||
};
|
||||
uart_2ndstage = {
|
||||
value = 1;
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
dt-overlays = {
|
||||
disable-bt = {
|
||||
enable = true;
|
||||
params = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
}
|
||||
6
example/direct.nix
Normal file
6
example/direct.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, inputs, lib, modulesPath, pkgs, ... }: {
|
||||
imports = [
|
||||
./common.nix
|
||||
];
|
||||
raspberry-pi-nix.uboot.enable = false;
|
||||
}
|
||||
6
example/uboot.nix
Normal file
6
example/uboot.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ config, inputs, lib, modulesPath, pkgs, ... }: {
|
||||
imports = [
|
||||
./common.nix
|
||||
];
|
||||
raspberry-pi-nix.uboot.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue