From ce32eab8877b9837cf576e0b44deaea90096093c Mon Sep 17 00:00:00 2001 From: cy Date: Sun, 15 Dec 2024 01:59:29 -0500 Subject: [PATCH] nix fmt --- nix/home/yt/foot.nix | 4 +- nix/home/yt/tmux.nix | 5 +- nix/home/yt/ytnix.nix | 2 +- nix/home/yt/zsh/default.nix | 12 ++- nix/hosts/chunk/default.nix | 93 +++++++++++----------- nix/hosts/chunk/hardware-configuration.nix | 32 ++++---- nix/hosts/ytnix/default.nix | 8 +- 7 files changed, 78 insertions(+), 78 deletions(-) diff --git a/nix/home/yt/foot.nix b/nix/home/yt/foot.nix index dcd22d5..a382532 100644 --- a/nix/home/yt/foot.nix +++ b/nix/home/yt/foot.nix @@ -1,6 +1,4 @@ -{ -... -}: { +{...}: { programs.foot = { enable = true; settings = { diff --git a/nix/home/yt/tmux.nix b/nix/home/yt/tmux.nix index aaf53e8..2d66ae2 100644 --- a/nix/home/yt/tmux.nix +++ b/nix/home/yt/tmux.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: { +{pkgs, ...}: { programs.tmux = { enable = true; baseIndex = 1; diff --git a/nix/home/yt/ytnix.nix b/nix/home/yt/ytnix.nix index 061d9ca..ee46ec4 100644 --- a/nix/home/yt/ytnix.nix +++ b/nix/home/yt/ytnix.nix @@ -123,7 +123,7 @@ borderRadius = 10; font = "DejaVu Sans Mono 11"; padding = "10"; - textColor= "#777777"; + textColor = "#777777"; extraConfig = '' background-color=#c00000 border-color=#ff0000 diff --git a/nix/home/yt/zsh/default.nix b/nix/home/yt/zsh/default.nix index 3318ed1..e8aef67 100644 --- a/nix/home/yt/zsh/default.nix +++ b/nix/home/yt/zsh/default.nix @@ -1,15 +1,13 @@ -{ - ... -}: { +{...}: { programs.zsh = { enable = true; autosuggestion = { enable = true; - strategy = [ "history" "completion" ]; + strategy = ["history" "completion"]; }; syntaxHighlighting = { enable = true; - highlighters = [ "brackets" ]; + highlighters = ["brackets"]; }; autocd = true; defaultKeymap = "emacs"; @@ -31,7 +29,7 @@ size = 50000; append = true; }; - historySubstringSearch= { + historySubstringSearch = { enable = true; searchUpKey = "^p"; searchDownKey = "^n"; @@ -87,7 +85,7 @@ programs.zoxide = { enable = true; enableZshIntegration = true; - options = [ "--cmd cd" ]; + options = ["--cmd cd"]; }; programs.eza = { diff --git a/nix/hosts/chunk/default.nix b/nix/hosts/chunk/default.nix index ccd2670..77de3f2 100644 --- a/nix/hosts/chunk/default.nix +++ b/nix/hosts/chunk/default.nix @@ -1,26 +1,30 @@ -{ config, lib, pkgs, inputs, ... }: { - disabledModules = [ "services/web-servers/caddy/default.nix" ]; - imports = - [ - ./hardware-configuration.nix - "${inputs.testpkgs}/nixos/modules/services/web-servers/caddy" - ../common.nix - ]; + config, + lib, + pkgs, + inputs, + ... +}: { + disabledModules = ["services/web-servers/caddy/default.nix"]; + imports = [ + ./hardware-configuration.nix + "${inputs.testpkgs}/nixos/modules/services/web-servers/caddy" + ../common.nix + ]; sops.defaultSopsFile = ./secrets.yaml; sops.age.keyFile = "/root/.config/sops/age/keys.txt"; sops.secrets = { - "borg/crash" = { }; - "ntfy" = { }; - "rclone" = { }; - "vaultwarden" = { }; - "caddy" = { }; - "hedgedoc" = { }; - "wireguard/private" = { }; - "wireguard/psk" = { }; - "wireguard/pskphone" = { }; - "miniflux" = { }; + "borg/crash" = {}; + "ntfy" = {}; + "rclone" = {}; + "vaultwarden" = {}; + "caddy" = {}; + "hedgedoc" = {}; + "wireguard/private" = {}; + "wireguard/psk" = {}; + "wireguard/pskphone" = {}; + "miniflux" = {}; "gitlab/root" = { owner = config.users.users.git.name; group = config.users.users.git.group; @@ -52,21 +56,23 @@ networking.networkmanager.enable = true; networking.firewall = { enable = true; - allowedTCPPorts = [ 22 80 443 53 853 ]; - allowedUDPPorts = [ 443 51820 53 853 ]; # 51820 is wireguard - trustedInterfaces = [ "wg0" "br-2a019a56bbcc" ]; # the second one is docker, idk if this changes + allowedTCPPorts = [22 80 443 53 853]; + allowedUDPPorts = [443 51820 53 853]; # 51820 is wireguard + trustedInterfaces = ["wg0" "br-2a019a56bbcc"]; # the second one is docker, idk if this changes }; networking.interfaces.ens18 = { - ipv6.addresses = [{ - address = "2a0f:85c1:840:2bfb::1"; - prefixLength = 64; - }]; + ipv6.addresses = [ + { + address = "2a0f:85c1:840:2bfb::1"; + prefixLength = 64; + } + ]; }; networking.defaultGateway6 = { address = "2a0f:85c1:840::1"; interface = "ens18"; }; - networking.nameservers = [ "127.0.0.1" "::1" ]; + networking.nameservers = ["127.0.0.1" "::1"]; time.timeZone = "America/Toronto"; @@ -78,14 +84,12 @@ users.users.yt = { isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "docker"]; - openssh.authorizedKeys.keys = - [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux" ]; + extraGroups = ["wheel" "networkmanager" "docker"]; + openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux"]; shell = pkgs.zsh; }; programs.zsh.enable = true; - users.users.root.openssh.authorizedKeys.keys = - [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux" ]; + users.users.root.openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPdhAQYy0+vS+QmyCd0MAbqbgzyMGcsuuFyf6kg2yKge yt@ytlinux"]; environment.systemPackages = with pkgs; [ vim @@ -148,8 +152,8 @@ services.borgbackup.jobs = { crashRsync = { - paths = [ "/root" "/home" "/var/backup" "/var/lib" "/var/log" "/opt" "/etc" "/vw-data" ]; - exclude = [ "**/.cache" "**/node_modules" "**/cache" "**/Cache" "/var/lib/docker/overlay*" ]; + paths = ["/root" "/home" "/var/backup" "/var/lib" "/var/log" "/opt" "/etc" "/vw-data"]; + exclude = ["**/.cache" "**/node_modules" "**/cache" "**/Cache" "/var/lib/docker/overlay*"]; repo = "de3911@de3911.rsync.net:borg/crash"; encryption = { mode = "repokey-blake2"; @@ -161,7 +165,7 @@ }; compression = "auto,zstd"; startAt = "daily"; - extraCreateArgs = [ "--stats" ]; + extraCreateArgs = ["--stats"]; # warnings are often not that serious failOnWarnings = false; postHook = '' @@ -198,9 +202,9 @@ systemd.services.immich-mount = { enable = true; description = "Mount the immich data remote"; - after = [ "network-online.target" ]; - requires = [ "network-online.target" ]; - wantedBy = [ "default.target" ]; + after = ["network-online.target"]; + requires = ["network-online.target"]; + wantedBy = ["default.target"]; serviceConfig = { Type = "notify"; ExecStartPre = "/usr/bin/env mkdir -p /mnt/photos"; @@ -213,9 +217,9 @@ systemd.services.nextcloud-mount = { enable = true; description = "Mount the nextcloud data remote"; - after = [ "network-online.target" ]; - requires = [ "network-online.target" ]; - wantedBy = [ "default.target" ]; + after = ["network-online.target"]; + requires = ["network-online.target"]; + wantedBy = ["default.target"]; serviceConfig = { Type = "notify"; ExecStart = "${pkgs.rclone}/bin/rclone mount --config /home/yt/.config/rclone/rclone.conf --uid 33 --gid 0 --allow-other --file-perms 0770 --dir-perms 0770 --transfers=32 rsyncnet:nextcloud /mnt/nextcloud"; @@ -259,11 +263,11 @@ enable = true; enableIPv6 = true; externalInterface = "ens18"; - internalInterfaces = [ "wg0" ]; + internalInterfaces = ["wg0"]; }; networking.wg-quick.interfaces.wg0 = { - address = [ "10.0.0.1/24" "fdc9:281f:04d7:9ee9::1/64" ]; + address = ["10.0.0.1/24" "fdc9:281f:04d7:9ee9::1/64"]; listenPort = 51820; privateKeyFile = "/run/secrets/wireguard/private"; postUp = '' @@ -285,12 +289,12 @@ peers = [ { publicKey = "qUhWoTPVC7jJdDEJLYY92OeiwPkaf8I5pv5kkMcSW3g="; - allowedIPs = [ "10.0.0.2/32" "fdc9:281f:04d7:9ee9::2/128" ]; + allowedIPs = ["10.0.0.2/32" "fdc9:281f:04d7:9ee9::2/128"]; presharedKeyFile = "/run/secrets/wireguard/psk"; } { publicKey = "JIGi60wzLw717Cim1dSFoLCdJz5rePa5AIFfuisJI0k="; - allowedIPs = [ "10.0.0.3/32" "fdc9:281f:04d7:9ee9::3/128" ]; + allowedIPs = ["10.0.0.3/32" "fdc9:281f:04d7:9ee9::3/128"]; presharedKeyFile = "/run/secrets/wireguard/pskphone"; } ]; @@ -342,4 +346,3 @@ }; }; } - diff --git a/nix/hosts/chunk/hardware-configuration.nix b/nix/hosts/chunk/hardware-configuration.nix index acdf1e3..7ee561f 100644 --- a/nix/hosts/chunk/hardware-configuration.nix +++ b/nix/hosts/chunk/hardware-configuration.nix @@ -1,24 +1,28 @@ # 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 = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/6fff5dd4-8d7a-43fa-85be-eec74ef2089e"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/6fff5dd4-8d7a-43fa-85be-eec74ef2089e"; + fsType = "ext4"; + }; - 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 diff --git a/nix/hosts/ytnix/default.nix b/nix/hosts/ytnix/default.nix index b81e900..f9a5df6 100644 --- a/nix/hosts/ytnix/default.nix +++ b/nix/hosts/ytnix/default.nix @@ -54,8 +54,8 @@ nameservers = ["31.59.129.225" "2a0f:85c1:840:2bfb::1"]; resolvconf.enable = true; firewall = { - allowedUDPPorts = [ 51820 ]; # for wireguard - trustedInterfaces = [ "wg0" ]; + allowedUDPPorts = [51820]; # for wireguard + trustedInterfaces = ["wg0"]; }; }; programs.nm-applet.enable = true; @@ -266,12 +266,12 @@ # wireguard setup networking.wg-quick.interfaces.wg0 = { - address = [ "10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/64" ]; + address = ["10.0.0.2/24" "fdc9:281f:04d7:9ee9::2/64"]; privateKeyFile = "/run/secrets/wireguard/private"; peers = [ { publicKey = "a16/F/wP7HQIUtFywebqPSXQAktPsLgsMLH9ZfevMy0="; - allowedIPs = [ "0.0.0.0/0" "::/0" ]; + allowedIPs = ["0.0.0.0/0" "::/0"]; endpoint = "31.59.129.225:51820"; persistentKeepalive = 25; presharedKeyFile = "/run/secrets/wireguard/psk";