task | reformatted with nixfmt

This commit is contained in:
Don Harper 2024-12-13 11:50:29 -06:00
parent e3fea64660
commit c3a0a0847f
119 changed files with 1010 additions and 2135 deletions

View file

@ -1,15 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
./default.nix
];
deployment = {
tags = ["server" "intel" "vps" "web"];
};
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [ ./default.nix ];
deployment = { tags = [ "server" "intel" "vps" "web" ]; };
}

View file

@ -1,11 +1,4 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
./hardware-configuration.nix
./network.nix
@ -15,8 +8,9 @@
networking.hostName = "w1";
boot = {
initrd = {
availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"];
kernelModules = ["nvme"];
availableKernelModules =
[ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
kernelModules = [ "nvme" ];
};
loader = {
grub = {

View file

@ -1,21 +1,14 @@
# 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,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = [];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules =
[ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/sda1";
@ -25,10 +18,10 @@
fileSystems."/boot" = {
device = "/dev/sda15";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [];
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,10 +1,8 @@
{lib, ...}: {
{ lib, ... }: {
# This file was populated at runtime with the networking
# details gathered from the active system.
networking = {
nameservers = [
"1.1.1.1"
];
nameservers = [ "1.1.1.1" ];
defaultGateway = "172.31.1.1";
defaultGateway6 = {
address = "fe80::1";
@ -14,12 +12,10 @@
usePredictableInterfaceNames = lib.mkForce false;
interfaces = {
eth0 = {
ipv4.addresses = [
{
address = "5.161.104.185";
prefixLength = 32;
}
];
ipv4.addresses = [{
address = "5.161.104.185";
prefixLength = 32;
}];
ipv6.addresses = [
{
address = "2a01:4ff:f0:c3e0::1";
@ -30,18 +26,14 @@
prefixLength = 64;
}
];
ipv4.routes = [
{
address = "172.31.1.1";
prefixLength = 32;
}
];
ipv6.routes = [
{
address = "fe80::1";
prefixLength = 128;
}
];
ipv4.routes = [{
address = "172.31.1.1";
prefixLength = 32;
}];
ipv6.routes = [{
address = "fe80::1";
prefixLength = 128;
}];
};
};
};

View file

@ -1,9 +1,5 @@
# Auto-generated using compose2nix v0.1.6.
{
pkgs,
lib,
...
}: {
{ pkgs, lib, ... }: {
# Runtime
virtualisation.podman = {
enable = true;
@ -35,29 +31,16 @@
"/home/don/docker/speedtest/config:/config:rw"
"/home/don/docker/speedtest/web:/etc/ssl/web:rw"
];
dependsOn = [
"bandwidth-db"
"bandwidth-ts"
];
dependsOn = [ "bandwidth-db" "bandwidth-ts" ];
log-driver = "journald";
extraOptions = [
"--network=container:bandwidth-ts"
];
extraOptions = [ "--network=container:bandwidth-ts" ];
};
systemd.services."podman-bandwidth" = {
serviceConfig = {
Restart = lib.mkOverride 500 "always";
};
partOf = [
"podman-compose-tstest-root.target"
];
unitConfig.UpheldBy = [
"podman-bandwidth-db.service"
"podman-bandwidth-ts.service"
];
wantedBy = [
"podman-compose-tstest-root.target"
];
serviceConfig = { Restart = lib.mkOverride 500 "always"; };
partOf = [ "podman-compose-tstest-root.target" ];
unitConfig.UpheldBy =
[ "podman-bandwidth-db.service" "podman-bandwidth-ts.service" ];
wantedBy = [ "podman-compose-tstest-root.target" ];
};
virtualisation.oci-containers.containers."bandwidth-db" = {
image = "mariadb:10";
@ -69,30 +52,16 @@
PGID = "1000";
PUID = "1000";
};
volumes = [
"/home/don/docker/speedtest-db:/var/lib/mysql:rw"
];
dependsOn = [
"bandwidth-ts"
];
volumes = [ "/home/don/docker/speedtest-db:/var/lib/mysql:rw" ];
dependsOn = [ "bandwidth-ts" ];
log-driver = "journald";
extraOptions = [
"--network=container:bandwidth-ts"
];
extraOptions = [ "--network=container:bandwidth-ts" ];
};
systemd.services."podman-bandwidth-db" = {
serviceConfig = {
Restart = lib.mkOverride 500 "always";
};
partOf = [
"podman-compose-tstest-root.target"
];
unitConfig.UpheldBy = [
"podman-bandwidth-ts.service"
];
wantedBy = [
"podman-compose-tstest-root.target"
];
serviceConfig = { Restart = lib.mkOverride 500 "always"; };
partOf = [ "podman-compose-tstest-root.target" ];
unitConfig.UpheldBy = [ "podman-bandwidth-ts.service" ];
wantedBy = [ "podman-compose-tstest-root.target" ];
};
virtualisation.oci-containers.containers."bandwidth-ts" = {
image = "tailscale/tailscale";
@ -100,7 +69,8 @@
PGID = "1000";
PUID = "1000";
TS_ACCEPT_DNS = "true";
TS_AUTHKEY = "tskey-auth-k6qutwuAk221CNTRL-9L2MS7sw2SVtH2kYKCcVNVsUHKYSX5UjH";
TS_AUTHKEY =
"tskey-auth-k6qutwuAk221CNTRL-9L2MS7sw2SVtH2kYKCcVNVsUHKYSX5UjH";
TS_HOSTNAME = "fred-bw";
TS_STATE_DIR = "/var/lib/tailscale";
};
@ -108,7 +78,7 @@
"/dev/net/tun:/dev/net/tun:rw"
"/home/don/docker/tailscale/var_lib:/var/lib:rw"
];
cmd = ["tailscaled"];
cmd = [ "tailscaled" ];
log-driver = "journald";
extraOptions = [
"--cap-add=net_admin"
@ -119,26 +89,16 @@
];
};
systemd.services."podman-bandwidth-ts" = {
serviceConfig = {
Restart = lib.mkOverride 500 "no";
};
after = [
"podman-network-tstest-default.service"
];
requires = [
"podman-network-tstest-default.service"
];
partOf = [
"podman-compose-tstest-root.target"
];
wantedBy = [
"podman-compose-tstest-root.target"
];
serviceConfig = { Restart = lib.mkOverride 500 "no"; };
after = [ "podman-network-tstest-default.service" ];
requires = [ "podman-network-tstest-default.service" ];
partOf = [ "podman-compose-tstest-root.target" ];
wantedBy = [ "podman-compose-tstest-root.target" ];
};
# Networks
systemd.services."podman-network-tstest-default" = {
path = [pkgs.podman];
path = [ pkgs.podman ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
@ -147,17 +107,15 @@
script = ''
podman network inspect tstest-default || podman network create tstest-default --opt isolate=true
'';
partOf = ["podman-compose-tstest-root.target"];
wantedBy = ["podman-compose-tstest-root.target"];
partOf = [ "podman-compose-tstest-root.target" ];
wantedBy = [ "podman-compose-tstest-root.target" ];
};
# Root service
# When started, this will automatically create all resources and start
# the containers. When stopped, this will teardown all resources.
systemd.targets."podman-compose-tstest-root" = {
unitConfig = {
Description = "Root target generated by compose2nix.";
};
wantedBy = ["multi-user.target"];
unitConfig = { Description = "Root target generated by compose2nix."; };
wantedBy = [ "multi-user.target" ];
};
}