Adds orange rpi system config.

This commit is contained in:
Bailey 2024-03-25 19:15:00 -04:00
parent 9f129b4777
commit 2c857890f0
3 changed files with 100 additions and 2 deletions

View File

@ -17,7 +17,7 @@ in {
type = (types.listOf types.str);
default = [ "mtxyz" "hive" ];
};
friend = lib.mkOption {
friends = lib.mkOption {
type = types.bool;
default = false;
};
@ -37,7 +37,7 @@ in {
initialPassword = "";
linger = true;
})) // {
friends = lib.mkIf config.gg.users.friend {
friends = lib.mkIf config.gg.users.friends {
isNormalUser = true;
hashedPassword = "";
};

View File

@ -0,0 +1,58 @@
{
config,
pkgs,
...
}:
{
imports = [
./hardware.nix
];
# Localization
time.timeZone = "Etc/UTC";
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
PermitEmptyPasswords = false;
};
};
programs.mosh.enable = true;
security.sudo.wheelNeedsPassword = false; # Needed for colmena.
documentation.man.enable = false; # Takes way too long to build.
environment.systemPackages = with pkgs; [
zellij tmux minicom tio lrzsz python3Packages.pyserial btop
];
programs.fish.enable = true;
gg.users.friends = true;
users.groups.dialout.members = config.gg.users.admins ++ [ "friends" ];
# Start tmux session for serial console on boot.
systemd.services.tmux-serial = {
description = "Tmux Serial Server Service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
script = ''
${pkgs.tmux}/bin/tmux new -d \
${pkgs.python3Packages.pyserial}/bin/pyserial-miniterm /dev/ttyS1 115200 --eol lf --raw
'';
serviceConfig = {
Restart = "always";
User = "friends";
Group = "users";
Type = "forking";
WorkingDirectory = "~";
GuessMainPID = true;
};
};
system.stateVersion = "24.05";
}

View File

@ -0,0 +1,40 @@
{
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
"${modulesPath}/installer/sd-card/sd-image-aarch64.nix"
];
# Fix missing modules
# https://github.com/NixOS/nixpkgs/issues/154163
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
boot = {
supportedFilesystems.zfs = lib.mkForce false;
kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_rpi3;
initrd.availableKernelModules = [
"usbhid"
"usb_storage"
"vc4"
"bcm2835_dma" "i2c_bcm2835"
"pcie_brcmstb" # required for the pcie bus to work
"reset-raspberrypi" # required for vl805 firmware to load
];
loader.grub.enable = lib.mkDefault false;
};
hardware.enableRedistributableFirmware = true;
networking.wireless.enable = true;
hardware.deviceTree.filter = "bcm2837-rpi-3-b-plus.dtb";
}