profiles: raspi init, aarch64 init, oracle/common improved, shared

This commit is contained in:
kat witch 2021-09-04 02:47:02 +01:00
parent 70e56f4e3f
commit 4102b381f0
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
10 changed files with 118 additions and 159 deletions

View file

@ -0,0 +1,5 @@
{ config, ... }: {
nixpkgs.localSystem = systems.examples.aarch64-multiplatform // {
system = "aarch64-linux";
};
}

View file

@ -56,6 +56,48 @@ in
nixos.oracle
];
config = {
networking.interfaces = let
interface = attrByPath [cfg.specs.shape] (throw "Unsupported shape") {
"VM.Standard.A1.Flex" = "enp0s3";
"VM.Standard.E2.1.Micro" = "ens3";
};
in {
${interface} = {
useDHCP = true;
ipv6 = {
addresses = mkIf (config.network.addresses.public.nixos.ipv6.enable) [{
address = config.network.addresses.public.nixos.ipv6.address;
prefixLength = 64;
}];
routes = [{
address = "::";
prefixLength = 0;
}];
};
};
};
network = {
addresses = {
public = let
addr_ipv6_nix =
let
prefix = head (splitString "/" (oci-root.resources.oci_kw_subnet.importAttr "ipv6cidr_block"));
in
assert hasSuffix "::" prefix; prefix + toString config.kw.oci.network.publicV6;
in {
enable = true;
nixos.ipv6.address = mkIf (tf.state.resources ? ${tf.resources.${config.networking.hostName}.out.reference}) addr_ipv6_nix;
tf.ipv6.address = tf.resources.rinnosuke_ipv6.refAttr "ip_address";
};
};
firewall.public.interfaces singleton interface;
tf = {
enable = true;
ipv4_attr = "public_ip";
};
};
deploy.tf =
let
compartment_id = oci-root.resources.oci_kw_compartment.importAttr "id";

View file

@ -0,0 +1,52 @@
{ config, ... }: {
deploy.profil.hardware.raspi = true;
nixpkgs.crossOverlays = [
(import ../../../overlays/pi)
];
boot = {
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
consoleLogLevel = lib.mkDefault 7;
kernelPackages = pkgs.linuxPackages_rpi1;
kernelModules = mkForce [ "loop" "atkbd" ];
initrd = {
includeDefaultModules = false;
availableKernelModules = mkForce [
"mmc_block"
"usbhid"
"ext4"
"hid_generic"
"hid_lenovo"
"hid_apple"
"hid_roccat"
"hid_logitech_hidpp"
"hid_logitech_dj"
"hid_microsoft"
];
};
};
environment.noXlibs = true;
documentation.info.enable = false;
documentation.man.enable = false;
programs.command-not-found.enable = false;
security.polkit.enable = false;
security.audit.enable = false;
services.udisks2.enable = false;
boot.enableContainers = false;
nixpkgs.crossSystem = systems.examples.raspberryPi // {
system = "armv6l-linux";
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
};
}