start working on router config
This commit is contained in:
parent
600654b33f
commit
3a46dc3c2a
|
@ -69,6 +69,13 @@
|
||||||
./hosts/nixserver
|
./hosts/nixserver
|
||||||
] ++ common "nixserver";
|
] ++ common "nixserver";
|
||||||
};
|
};
|
||||||
|
router = {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
modules = [
|
||||||
|
./hardware/bpi_r3.nix
|
||||||
|
./hosts/router
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
35
system/hardware/bpi_r3.nix
Normal file
35
system/hardware/bpi_r3.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, ... }:
|
||||||
|
|
||||||
|
# WIP
|
||||||
|
{
|
||||||
|
boot.loader = {
|
||||||
|
grub.enable = false;
|
||||||
|
generic-extlinux-compatible.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://github.com/frank-w/BPI-Router-Linux
|
||||||
|
boot.kernelPackages = pkgs.linuxPackagesFor ((pkgs.buildLinux ({
|
||||||
|
version = "6.3";
|
||||||
|
modDirVersion = "6.3.0";
|
||||||
|
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "frank-w";
|
||||||
|
repo = "BPI-Router-Linux";
|
||||||
|
rev = "6.3-main";
|
||||||
|
hash = lib.fakeHash;
|
||||||
|
};
|
||||||
|
|
||||||
|
defconfig = "mt7986a_bpi-r3";
|
||||||
|
})).overrideAttrs (old: {
|
||||||
|
postConfigure = ''
|
||||||
|
sed -i "$buildRoot/.config" -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||||
|
sed -i "$buildRoot/include/config/auto.conf" -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
|
||||||
|
'';
|
||||||
|
}));
|
||||||
|
|
||||||
|
hardware.deviceTree.enable = true;
|
||||||
|
hardware.deviceTree.filter = "mt7986a-bananapi-bpi-r3*.dtb";
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
}
|
|
@ -70,10 +70,10 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
path = /persist;
|
path = /persist;
|
||||||
directories = [
|
directories = [
|
||||||
{ directory = /var/www/${cfg.domainName}; }
|
{ directory = /home/${config.common.mainUsername}; user = config.common.mainUsername; group = config.common.mainUsername; mode = "0700"; }
|
||||||
{ directory = /home/${config.common.mainUsername}; }
|
|
||||||
{ directory = /root; }
|
{ directory = /root; }
|
||||||
{ directory = /nix; }
|
{ directory = /nix; }
|
||||||
|
{ directory = /var/www/${cfg.domainName}; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
services.beesd = {
|
services.beesd = {
|
||||||
|
|
28
system/hosts/router/default.nix
Normal file
28
system/hosts/router/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{ config
|
||||||
|
, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
rootUuid = "00000000-0000-0000-0000-000000000000";
|
||||||
|
rootPart = "/dev/disk/by-uuid/${rootUuid}";
|
||||||
|
in {
|
||||||
|
system.stateVersion = "22.11";
|
||||||
|
# TODO
|
||||||
|
fileSystems = {
|
||||||
|
# mount root on tmpfs
|
||||||
|
"/" = { device = "none"; fsType = "tmpfs"; neededForBoot = true;
|
||||||
|
options = [ "defaults" "size=2G" "mode=755" ]; };
|
||||||
|
"/persist" =
|
||||||
|
{ device = rootPart; fsType = "btrfs"; neededForBoot = true;
|
||||||
|
options = [ ]; };
|
||||||
|
};
|
||||||
|
impermanence = {
|
||||||
|
enable = true;
|
||||||
|
path = /persist;
|
||||||
|
directories = [
|
||||||
|
{ directory = /home/${config.common.mainUsername}; user = config.common.mainUsername; group = config.common.mainUsername; mode = "0700"; }
|
||||||
|
{ directory = /root; mode = "0700"; }
|
||||||
|
/nix
|
||||||
|
/boot
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -12,7 +12,7 @@ in {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Enable GPU passthrough config (probably no intel/nvidia support since I can't test it)";
|
description = "Enable GPU passthrough + VM config (probably no intel/nvidia support since I can't test it)";
|
||||||
};
|
};
|
||||||
libvirtdGroup = mkOption {
|
libvirtdGroup = mkOption {
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
|
|
Loading…
Reference in a new issue