Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add raspberry-pi 0 and 3 #93

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions raspberry-pi/0/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ lib, pkgs, ...}:

{
boot = {
consoleLogLevel = lib.mkDefault 7;
extraTTYs = [ "ttyAMA0" ];
kernelPackages = lib.mkDefault pkgs.linuxPackages_rpi;
kernelParams = [
"dwc_otg.lpm_enable=0"
"console=ttyAMA0,115200"
"rootwait"
"elevator=deadline"
];
loader = {
grub.enable = lib.mkDefault false;
generationsDir.enable = lib.mkDefault false;
raspberryPi = {
enable = lib.mkDefault true;
version = lib.mkDefault 1;
};
};
};

nix.buildCores = 1;

nixpkgs.config.platform = lib.systems.platforms.raspberrypi;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hostPlatform?


# cpufrequtils doesn't build on ARM
powerManagement.enable = lib.mkDefault false;

services.openssh.enable = lib.mkDefault true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move the content to raspberry-pi/default.nix for all versions and only import the default.nix here for better sharing. It is still good to list every generation explicit however because then people don't need to change anything in case we change something for a particular model.

}
30 changes: 30 additions & 0 deletions raspberry-pi/3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ lib, pkgs, ...}:

{
boot = {
consoleLogLevel = lib.mkDefault 7;
extraTTYs = [ "ttyAMA0" ];
kernelPackages = lib.mkDefault pkgs.linuxPackages_rpi;
kernelParams = [
"dwc_otg.lpm_enable=0"
"console=ttyAMA0,115200"
"rootwait"
"elevator=deadline"
"cma=32M"
];
loader = {
grub.enable = lib.mkDefault false;
generationsDir.enable = lib.mkDefault false;
raspberryPi = {
enable = lib.mkDefault true;
version = lib.mkDefault 3;
};
};
};

nix.buildCores = 4;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the device has 4 cores it has less than a 1GB of memory and will run out of memory like this.


nixpkgs.config.platform = lib.systems.platforms.aarch64-multiplatform;

services.openssh.enable = lib.mkDefault true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hardware profile, so it should not include service configurations, like SSH.

}