diff --git a/home/crow/Datto.nix b/home/crow/Datto.nix index 9b2069a..e7263e3 100644 --- a/home/crow/Datto.nix +++ b/home/crow/Datto.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ common/core ]; diff --git a/home/crow/HandlerOne.nix b/home/crow/HandlerOne.nix index 9b2069a..e7263e3 100644 --- a/home/crow/HandlerOne.nix +++ b/home/crow/HandlerOne.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ common/core ]; diff --git a/home/crow/common/core/helix.nix b/home/crow/common/core/helix.nix index 2971dc4..d7042e0 100644 --- a/home/crow/common/core/helix.nix +++ b/home/crow/common/core/helix.nix @@ -11,12 +11,17 @@ languages = { language-server.phpactor = with pkgs; { command = "${phpactor}/bin/phpactor"; - args = ["language-server"]; + args = [ "language-server" ]; }; - language = [{ - name = "php"; - language-servers = ["intelephense" "phpactor"]; - }]; + language = [ + { + name = "php"; + language-servers = [ + "intelephense" + "phpactor" + ]; + } + ]; }; }; } diff --git a/home/crow/common/core/xdg.nix b/home/crow/common/core/xdg.nix index 0e4575f..9ba4f99 100644 --- a/home/crow/common/core/xdg.nix +++ b/home/crow/common/core/xdg.nix @@ -3,7 +3,8 @@ lib, hostSpec, ... -}: { +}: +{ home = { preferXdgDirectories = true; }; diff --git a/home/crow/common/optional/desktops/awww/default.nix b/home/crow/common/optional/desktops/awww/default.nix index 3cbbdce..0fc8e87 100644 --- a/home/crow/common/optional/desktops/awww/default.nix +++ b/home/crow/common/optional/desktops/awww/default.nix @@ -1,5 +1,6 @@ -{pkgs, ...}: { - services.swww= { +{ pkgs, ... }: +{ + services.swww = { enable = true; package = pkgs.awww; }; diff --git a/hosts/common/core/avahi.nix b/hosts/common/core/avahi.nix index aeb5d62..5119853 100644 --- a/hosts/common/core/avahi.nix +++ b/hosts/common/core/avahi.nix @@ -1,4 +1,5 @@ -{lib, ...}: { +{ lib, ... }: +{ services.avahi = lib.mkDefault { enable = true; nssmdns4 = true; diff --git a/hosts/common/core/darwin.nix b/hosts/common/core/darwin.nix index 0967ef4..ffcd441 100644 --- a/hosts/common/core/darwin.nix +++ b/hosts/common/core/darwin.nix @@ -1 +1 @@ -{} +{ } diff --git a/hosts/common/core/dns.nix b/hosts/common/core/dns.nix index b589d97..766ac86 100644 --- a/hosts/common/core/dns.nix +++ b/hosts/common/core/dns.nix @@ -1,9 +1,13 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ environment.systemPackages = [ pkgs.nextdns ]; services.nextdns = { enable = true; - arguments = ["-config" "cc2b9b"]; + arguments = [ + "-config" + "cc2b9b" + ]; }; } diff --git a/hosts/common/core/sops.nix b/hosts/common/core/sops.nix index 1c0bbfb..e600f64 100644 --- a/hosts/common/core/sops.nix +++ b/hosts/common/core/sops.nix @@ -5,9 +5,11 @@ inputs, config, ... -}: let +}: +let sopsFolder = builtins.toString inputs.nix-secrets + "/sops"; -in { +in +{ #the import for inputs.sops-nix.nixosModules.sops is handled in hosts/common/core/default.nix so that it can be dynamically input according to the platform sops = { @@ -16,7 +18,7 @@ in { validateSopsFiles = false; age = { # automatically import host SSH keys as age keys - sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; + sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; }; # secrets will be output to /run/secrets # e.g. /run/secrets/msmtp-password @@ -49,13 +51,14 @@ in { # The containing folders are created as root and if this is the first ~/.config/ entry, # the ownership is busted and home-manager can't target because it can't write into .config... # FIXME(sops): We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed - system.activationScripts.sopsSetAgeKeyOwnership = let - ageFolder = "${config.hostSpec.home}/.config/sops/age"; - user = config.users.users.${config.hostSpec.username}.name; - group = config.users.users.${config.hostSpec.username}.group; - in '' - mkdir -p ${ageFolder} || true - chown -R ${user}:${group} ${config.hostSpec.home}/.config - ''; + system.activationScripts.sopsSetAgeKeyOwnership = + let + ageFolder = "${config.hostSpec.home}/.config/sops/age"; + user = config.users.users.${config.hostSpec.username}.name; + group = config.users.users.${config.hostSpec.username}.group; + in + '' + mkdir -p ${ageFolder} || true + chown -R ${user}:${group} ${config.hostSpec.home}/.config + ''; } - diff --git a/hosts/common/core/ssh.nix b/hosts/common/core/ssh.nix index 7169fdc..ecdc477 100644 --- a/hosts/common/core/ssh.nix +++ b/hosts/common/core/ssh.nix @@ -34,7 +34,8 @@ services.fail2ban = { enable = lib.mkDefault true; - ignoreIP = [ # Expected internal IP ranges + ignoreIP = [ + # Expected internal IP ranges "172.16.0.0/12" "192.168.0.0/16" ]; diff --git a/hosts/common/disks/btrfs-disk.nix b/hosts/common/disks/btrfs-disk.nix index a872ea2..9201726 100644 --- a/hosts/common/disks/btrfs-disk.nix +++ b/hosts/common/disks/btrfs-disk.nix @@ -5,7 +5,8 @@ withSwap ? false, swapSize, ... -}: { +}: +{ disko.devices = { disk = { disk0 = { @@ -24,14 +25,14 @@ type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = ["defaults"]; + mountOptions = [ "defaults" ]; }; }; root = { size = "100%"; content = { type = "btrfs"; - extraArgs = ["-f"]; # Override existing partition + extraArgs = [ "-f" ]; # Override existing partition # Subvolumes must set a mountpoint in order to be mounted, # unless their parent is mounted subvolumes = { diff --git a/hosts/common/disks/btrfs-impermanence-disk.nix b/hosts/common/disks/btrfs-impermanence-disk.nix index 4fbe1b8..80d439f 100644 --- a/hosts/common/disks/btrfs-impermanence-disk.nix +++ b/hosts/common/disks/btrfs-impermanence-disk.nix @@ -5,7 +5,8 @@ swapSize, config, ... -}: { +}: +{ fileSystems."/persist".neededForBoot = true; disko.devices = { disk = { @@ -25,14 +26,14 @@ type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = ["defaults"]; + mountOptions = [ "defaults" ]; }; }; root = { size = "100%"; content = { type = "btrfs"; - extraArgs = ["-f"]; # Override existing partition + extraArgs = [ "-f" ]; # Override existing partition # Subvolumes must set a mountpoint in order to be mounted, # unless their parent is mounted subvolumes = { diff --git a/hosts/common/disks/btrfs-over-mbr-disk.nix b/hosts/common/disks/btrfs-over-mbr-disk.nix index 32ee2c4..bbf04c1 100644 --- a/hosts/common/disks/btrfs-over-mbr-disk.nix +++ b/hosts/common/disks/btrfs-over-mbr-disk.nix @@ -5,7 +5,8 @@ withSwap ? false, swapSize, ... -}: { +}: +{ disko.devices = { disk = { disk0 = { @@ -26,14 +27,14 @@ type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = ["umask=0077"]; + mountOptions = [ "umask=0077" ]; }; }; root = { size = "100%"; content = { type = "btrfs"; - extraArgs = ["-f"]; # Override existing partition + extraArgs = [ "-f" ]; # Override existing partition # Subvolumes must set a mountpoint in order to be mounted, # unless their parent is mounted subvolumes = { diff --git a/hosts/common/optional/keyd.nix b/hosts/common/optional/keyd.nix index 3f04b89..46aa11c 100644 --- a/hosts/common/optional/keyd.nix +++ b/hosts/common/optional/keyd.nix @@ -2,7 +2,7 @@ services.keyd = { enable = true; keyboards.default = { - ids = ["*"]; + ids = [ "*" ]; settings = { main = { capslock = "layer(standardL2)"; diff --git a/hosts/common/optional/mysql.nix b/hosts/common/optional/mysql.nix index 867072e..a0f20cf 100644 --- a/hosts/common/optional/mysql.nix +++ b/hosts/common/optional/mysql.nix @@ -1,6 +1,6 @@ { - services.mysql = { - enable = true; - package = pkgs.mariadb_118; - }; + services.mysql = { + enable = true; + package = pkgs.mariadb_118; + }; } diff --git a/hosts/common/optional/printing.nix b/hosts/common/optional/printing.nix index cbf2526..2da9f42 100644 --- a/hosts/common/optional/printing.nix +++ b/hosts/common/optional/printing.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ services.printing = { enable = true; drivers = with pkgs; [ diff --git a/hosts/common/optional/services/glances.nix b/hosts/common/optional/services/glances.nix index b289387..d8abf85 100644 --- a/hosts/common/optional/services/glances.nix +++ b/hosts/common/optional/services/glances.nix @@ -2,9 +2,9 @@ config, lib, ... -}: { +}: +{ services.glances = { enable = true; }; } - diff --git a/hosts/nixos/HandlerOne/database.nix b/hosts/nixos/HandlerOne/database.nix index 06b4748..b734b57 100644 --- a/hosts/nixos/HandlerOne/database.nix +++ b/hosts/nixos/HandlerOne/database.nix @@ -1,4 +1,5 @@ -{pkgs, ...}: { +{ pkgs, ... }: +{ environment.systemPackages = with pkgs; [ mycli ]; @@ -6,7 +7,7 @@ networking.firewall.allowedTCPPorts = [ 3306 ]; - + services.mysql = { enable = true; package = pkgs.mariadb_118; diff --git a/hosts/nixos/HandlerOne/hardware-configuration.nix b/hosts/nixos/HandlerOne/hardware-configuration.nix index 7f425b1..a476bf1 100644 --- a/hosts/nixos/HandlerOne/hardware-configuration.nix +++ b/hosts/nixos/HandlerOne/hardware-configuration.nix @@ -7,15 +7,23 @@ pkgs, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = []; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; hardware.coral.usb.enable = true; } diff --git a/hosts/nixos/Incarceron/hardware-configuration.nix b/hosts/nixos/Incarceron/hardware-configuration.nix index 80b15e5..9e8a6ee 100644 --- a/hosts/nixos/Incarceron/hardware-configuration.nix +++ b/hosts/nixos/Incarceron/hardware-configuration.nix @@ -7,15 +7,21 @@ pkgs, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; hardware.graphics.extraPackages = with pkgs; [ rocmPackages.clr.icd ]; diff --git a/modules/common/default.nix b/modules/common/default.nix index 63db315..b23287b 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -1,3 +1,4 @@ -{lib, ...}: { +{ lib, ... }: +{ imports = lib.custom.scanPaths ./.; } diff --git a/modules/common/host-spec.nix b/modules/common/host-spec.nix index c303dc3..4d4c7e8 100644 --- a/modules/common/host-spec.nix +++ b/modules/common/host-spec.nix @@ -4,7 +4,8 @@ pkgs, lib, ... -}: { +}: +{ options.hostSpec = { # Data variables that don't dictate configuration settings username = lib.mkOption { @@ -20,7 +21,7 @@ description = "The email of the user"; }; networking = lib.mkOption { - default = {}; + default = { }; type = lib.types.attrsOf lib.types.anything; description = "An attribute set of networking information"; }; @@ -44,12 +45,11 @@ home = lib.mkOption { type = lib.types.str; description = "The home directory of the user"; - default = let - user = config.hostSpec.username; - in - if pkgs.stdenv.isLinux - then "/home/${user}" - else "/Users/${user}"; + default = + let + user = config.hostSpec.username; + in + if pkgs.stdenv.isLinux then "/home/${user}" else "/Users/${user}"; }; persistFolder = lib.mkOption { type = lib.types.str; diff --git a/modules/home/default.nix b/modules/home/default.nix index 9e48608..b23287b 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,4 +1,4 @@ -{lib, ...}: { +{ lib, ... }: +{ imports = lib.custom.scanPaths ./.; } - diff --git a/modules/home/monitors.nix b/modules/home/monitors.nix index eb4e604..5d47934 100644 --- a/modules/home/monitors.nix +++ b/modules/home/monitors.nix @@ -2,7 +2,8 @@ lib, config, ... -}: { +}: +{ options.monitors = lib.mkOption { type = lib.types.listOf ( lib.types.submodule { @@ -69,7 +70,7 @@ }; } ); - default = []; + default = [ ]; }; config = { assertions = [ diff --git a/modules/quadlets/flamesites/default.nix b/modules/quadlets/flamesites/default.nix index 8ac24f2..57d079e 100644 --- a/modules/quadlets/flamesites/default.nix +++ b/modules/quadlets/flamesites/default.nix @@ -27,7 +27,8 @@ in }; }; - systemd.services.flamesite-backup = { # TODO: Remove when replication setup + systemd.services.flamesite-backup = { + # TODO: Remove when replication setup script = '' ${pkgs.podman}/bin/podman exec swgal_db_1 sh -c 'exec mysqldump --no-tablespaces -usgr_user -psgr_pass sgr_db' > ${volumePath}/flamesites/swgalaxyproject/dbBackups/db.sql ${pkgs.podman}/bin/podman exec nnsbluegrass_db_1 sh -c 'exec mysqldump --no-tablespaces -unns_user -pnns_pass nns_db' > ${volumePath}/flamesites/nnsbluegrass/dbBackups/db.sql diff --git a/modules/quadlets/grimmory/default.nix b/modules/quadlets/grimmory/default.nix index 9314992..9d17ec1 100644 --- a/modules/quadlets/grimmory/default.nix +++ b/modules/quadlets/grimmory/default.nix @@ -5,7 +5,7 @@ in { sops.secrets = { - "mariadb/users/grimmory" = {}; + "mariadb/users/grimmory" = { }; }; sops.templates."grimmory-secrets".content = '' @@ -17,7 +17,7 @@ in "grimmory" ]; }; - + systemd.tmpfiles.rules = [ "d /var/lib/grimmory 774 1000 1000" "d /var/lib/grimmory/data 774 1000 1000" @@ -37,13 +37,13 @@ in "${builtins.toString port}:6060" ]; environments = { - TZ="Etc/UTC"; - APP_USER_ID="1000"; - APP_GROUP_ID="1000"; - BOOKLORE_PORT="6060"; + TZ = "Etc/UTC"; + APP_USER_ID = "1000"; + APP_GROUP_ID = "1000"; + BOOKLORE_PORT = "6060"; - DATABASE_URL="jdbc:mariadb://host.containers.internal:3306/grimmory"; - DATABASE_USERNAME="grimmory"; + DATABASE_URL = "jdbc:mariadb://host.containers.internal:3306/grimmory"; + DATABASE_USERNAME = "grimmory"; }; environmentFiles = [ config.sops.templates."grimmory-secrets".path diff --git a/modules/services/flamesites/default.nix b/modules/services/flamesites/default.nix index 8c3901f..6a90975 100644 --- a/modules/services/flamesites/default.nix +++ b/modules/services/flamesites/default.nix @@ -40,10 +40,10 @@ in enable = true; virtualHosts = { # "swgalaxyproject.com".extraConfig = '' - # reverse_proxy http://localhost:8080 + # reverse_proxy http://localhost:8080 # ''; # "nnsbluegrass.com".extraConfig = '' - # reverse_proxy http://localhost:9821 + # reverse_proxy http://localhost:9821 # ''; "swgalaxyproject.com".extraConfig = '' file_server { diff --git a/modules/services/matrix/default.nix b/modules/services/matrix/default.nix index f5ef97f..6aaaec9 100644 --- a/modules/services/matrix/default.nix +++ b/modules/services/matrix/default.nix @@ -38,11 +38,11 @@ in users.users.caddy.extraGroups = [ "tuwunel" ]; services.caddy = { - enable = true; - virtualHosts = { - "psychal.link, psychal.link:8448".extraConfig = '' - reverse_proxy unix//run/tuwunel/tuwunel.sock - ''; - }; - }; + enable = true; + virtualHosts = { + "psychal.link, psychal.link:8448".extraConfig = '' + reverse_proxy unix//run/tuwunel/tuwunel.sock + ''; + }; + }; } diff --git a/nixos-bootstrap/flake.nix b/nixos-bootstrap/flake.nix index 51d1413..7a23044 100644 --- a/nixos-bootstrap/flake.nix +++ b/nixos-bootstrap/flake.nix @@ -7,19 +7,21 @@ nvix.url = "github:TheWanderingCrow/nvix"; }; - outputs = { - self, - nixpkgs, - ... - } @ inputs: { - nixosConfigurations = { - ISO = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; - modules = [ - ./installers/ISO.nix - ./installer-config.nix - ]; + outputs = + { + self, + nixpkgs, + ... + }@inputs: + { + nixosConfigurations = { + ISO = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + ./installers/ISO.nix + ./installer-config.nix + ]; + }; }; }; - }; } diff --git a/nixos-bootstrap/installers/DigitalOcean.nix b/nixos-bootstrap/installers/DigitalOcean.nix index b8da12e..ca09368 100644 --- a/nixos-bootstrap/installers/DigitalOcean.nix +++ b/nixos-bootstrap/installers/DigitalOcean.nix @@ -1,6 +1,9 @@ -{pkgs ? import {}}: let +{ + pkgs ? import { }, +}: +let config = { - imports = []; + imports = [ ]; }; in - (pkgs.nixos config).digitalOceanImage +(pkgs.nixos config).digitalOceanImage diff --git a/nixos-bootstrap/installers/ISO.nix b/nixos-bootstrap/installers/ISO.nix index d67b647..827df78 100644 --- a/nixos-bootstrap/installers/ISO.nix +++ b/nixos-bootstrap/installers/ISO.nix @@ -3,7 +3,8 @@ inputs, modulesPath, ... -}: { +}: +{ imports = [ inputs.disko.nixosModules.disko "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"