Skip to content

Commit

Permalink
nixfmt
Browse files Browse the repository at this point in the history
wew rfc style
  • Loading branch information
ifd3f committed Oct 18, 2024
1 parent b5d9c62 commit e0fcc5d
Show file tree
Hide file tree
Showing 143 changed files with 3,077 additions and 1,878 deletions.
22 changes: 16 additions & 6 deletions ca/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
{ lib }:
with builtins;
with lib; {
with lib;
{
root = readFile ./ifd3f.crt;

intermediates = concatMapAttrs (file: _:
intermediates = concatMapAttrs (
file: _:
let
m = match "(.*)\\.(.*)" file;
serial = elemAt m 0;
ext = elemAt m 1;
in if m != null && elem ext [ "crt" "pem" ] then {
"${serial}" = readFile ./certs/${file};
} else
{ }) (builtins.readDir ./certs);
in
if
m != null
&& elem ext [
"crt"
"pem"
]
then
{ "${serial}" = readFile ./certs/${file}; }
else
{ }
) (builtins.readDir ./certs);
}
2 changes: 1 addition & 1 deletion k8s/talos/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ rec {

# All hosts only have one interface. This will pick the interface
# https://www.talos.dev/v1.6/talos-guides/network/predictable-interface-names/#single-network-interface
network.interfaces = [{ deviceSelector.busPath = "0*"; }];
network.interfaces = [ { deviceSelector.busPath = "0*"; } ];
};
}
10 changes: 7 additions & 3 deletions k8s/talos/controlplane.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
let common = import ./common.nix;
in {
let
common = import ./common.nix;
in
{
cluster = common.clusterBase // {
apiServer = { certSANs = [ common.controlPlaneVIP ]; };
apiServer = {
certSANs = [ common.controlPlaneVIP ];
};
clusterName = "ca7dc";
};
machine = common.machineBase;
Expand Down
6 changes: 4 additions & 2 deletions k8s/talos/worker.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
let common = import ./common.nix;
in {
let
common = import ./common.nix;
in
{
cluster = common.clusterBase;
machine = common.machineBase;
}
22 changes: 17 additions & 5 deletions machines/__basePC/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
inputs:
{ config, pkgs, lib, modulesPath, ... }:
with lib; {
{
config,
pkgs,
lib,
modulesPath,
...
}:
with lib;
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
inputs.self.nixosModules.pc
Expand All @@ -13,8 +20,14 @@ with lib; {
tailscale.oneOffKey = "this isn't used ever lol";
};

boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
Expand Down Expand Up @@ -71,4 +84,3 @@ with lib; {
};
};
}

23 changes: 17 additions & 6 deletions machines/__baseServer/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
inputs:
{ config, pkgs, lib, modulesPath, ... }:
with lib; {
{
config,
pkgs,
lib,
modulesPath,
...
}:
with lib;
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
inputs.self.nixosModules.server
Expand All @@ -13,8 +20,13 @@ with lib; {
tailscale.oneOffKey = "this isn't used ever lol";
};

boot.initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" ];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
Expand All @@ -28,8 +40,7 @@ with lib; {
networking.useDHCP = lib.mkDefault true;
networking.domain = "h.astrid.tech";

hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

boot.cleanTmpDir = true;
zramSwap.enable = true;
Expand Down
27 changes: 14 additions & 13 deletions machines/ajinomoto/boot.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
inputs:
{ config, lib, pkgs, ... }:
let constants = import ./constants.nix;
in {
{
config,
lib,
pkgs,
...
}:
let
constants = import ./constants.nix;
in
{
boot.initrd.availableKernelModules = [
"ehci_pci"
"ata_piix"
Expand All @@ -16,13 +23,10 @@ in {
boot.extraModulePackages = [ ];

# legacy boot moment
boot.loader.grub.devices = [
"/dev/disk/by-id/usb-Generic_Flash_Disk_5AF232B0-0:0"
];
boot.loader.grub.devices = [ "/dev/disk/by-id/usb-Generic_Flash_Disk_5AF232B0-0:0" ];

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

# because we want to be able to decrypt host keys over SSH
boot.initrd.network = {
Expand All @@ -44,13 +48,10 @@ in {
enable = true;
port = 2222; # because we are using a different host key
hostKeys = [
(pkgs.writeText "ssh_host_rsa_key"
(builtins.readFile ./initrd/ssh_host_rsa_key))
(pkgs.writeText "ssh_host_ed25519_key"
(builtins.readFile ./initrd/ssh_host_ed25519_key))
(pkgs.writeText "ssh_host_rsa_key" (builtins.readFile ./initrd/ssh_host_rsa_key))
(pkgs.writeText "ssh_host_ed25519_key" (builtins.readFile ./initrd/ssh_host_ed25519_key))
];
authorizedKeys = inputs.self.lib.sshKeyDatabase.users.astrid;
};
};
}

11 changes: 9 additions & 2 deletions machines/ajinomoto/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
inputs:
{ config, lib, pkgs, modulesPath, ... }:
with lib; {
{
config,
lib,
pkgs,
modulesPath,
...
}:
with lib;
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")

Expand Down
4 changes: 2 additions & 2 deletions machines/ajinomoto/constants.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
/**
Interface on the management port
*/
*/
mgmt_if = "enp3s0";
}
}
6 changes: 5 additions & 1 deletion machines/ajinomoto/fs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
fileSystems."/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=256M" "mode=755" ];
options = [
"defaults"
"size=256M"
"mode=755"
];
};

fileSystems."/boot" = {
Expand Down
46 changes: 32 additions & 14 deletions machines/amiya/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
inputs:
{ config, pkgs, lib, ... }:
with lib; {
{
config,
pkgs,
lib,
...
}:
with lib;
{
imports = [
./hardware-configuration.nix

Expand Down Expand Up @@ -38,21 +44,29 @@ with lib; {
};

interfaces.enp3s0 = {
ipv4.addresses = [{
address = "208.87.130.175";
prefixLength = 24;
}];
ipv6.addresses = [{
address = "2605:a141:2108:6306::1";
prefixLength = 64;
}];
ipv4.addresses = [
{
address = "208.87.130.175";
prefixLength = 24;
}
];
ipv6.addresses = [
{
address = "2605:a141:2108:6306::1";
prefixLength = 64;
}
];
};
};

services.resolved = {
enable = true;
domains =
[ "8.8.8.8" "8.8.4.4" "2001:4860:4860::8888" "2001:4860:4860::8844" ];
domains = [
"8.8.8.8"
"8.8.4.4"
"2001:4860:4860::8888"
"2001:4860:4860::8844"
];
};

services.year-of-bot = {
Expand Down Expand Up @@ -82,8 +96,12 @@ with lib; {

boot = {
loader.grub.device = "/dev/sda";
initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"xen_blkfront"
"vmw_pvscsi"
];
initrd.kernelModules = [ "nvme" ];
};

Expand Down
20 changes: 15 additions & 5 deletions machines/amiya/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];

boot.initrd.availableKernelModules =
[ "ahci" "xhci_pci" "virtio_pci" "sd_mod" ];
boot.initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
Expand All @@ -24,6 +35,5 @@
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;

hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
13 changes: 9 additions & 4 deletions machines/banana/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
inputs:
{ config, pkgs, lib, ... }:
with lib; {
{
config,
pkgs,
lib,
...
}:
with lib;
{
imports = [
./hardware-configuration.nix
inputs.self.nixosModules.pc
Expand All @@ -15,8 +21,7 @@ with lib; {
pci-devs = [ ];
};

astral.tailscale.oneOffKey =
"tskey-auth-kQpYuB2CNTRL-krpVu4TaHhBfxV7SWg3LgBtPG8t3QKyh4";
astral.tailscale.oneOffKey = "tskey-auth-kQpYuB2CNTRL-krpVu4TaHhBfxV7SWg3LgBtPG8t3QKyh4";

# so i can be a *gamer*
programs.steam.enable = true;
Expand Down
20 changes: 15 additions & 5 deletions machines/banana/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:

{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];

boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
Expand Down Expand Up @@ -65,6 +76,5 @@

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
Loading

0 comments on commit e0fcc5d

Please sign in to comment.