treewide format

This commit is contained in:
TheWanderingCrow 2026-04-04 22:59:23 -04:00
parent 653eb2d606
commit b346790feb
31 changed files with 150 additions and 104 deletions

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
imports = [ imports = [
common/core common/core
]; ];

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
imports = [ imports = [
common/core common/core
]; ];

View file

@ -13,10 +13,15 @@
command = "${phpactor}/bin/phpactor"; command = "${phpactor}/bin/phpactor";
args = [ "language-server" ]; args = [ "language-server" ];
}; };
language = [{ language = [
{
name = "php"; name = "php";
language-servers = ["intelephense" "phpactor"]; language-servers = [
}]; "intelephense"
"phpactor"
];
}
];
}; };
}; };
} }

View file

@ -3,7 +3,8 @@
lib, lib,
hostSpec, hostSpec,
... ...
}: { }:
{
home = { home = {
preferXdgDirectories = true; preferXdgDirectories = true;
}; };

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
services.swww = { services.swww = {
enable = true; enable = true;
package = pkgs.awww; package = pkgs.awww;

View file

@ -1,4 +1,5 @@
{lib, ...}: { { lib, ... }:
{
services.avahi = lib.mkDefault { services.avahi = lib.mkDefault {
enable = true; enable = true;
nssmdns4 = true; nssmdns4 = true;

View file

@ -1,9 +1,13 @@
{pkgs, ...}: { { pkgs, ... }:
{
environment.systemPackages = [ environment.systemPackages = [
pkgs.nextdns pkgs.nextdns
]; ];
services.nextdns = { services.nextdns = {
enable = true; enable = true;
arguments = ["-config" "cc2b9b"]; arguments = [
"-config"
"cc2b9b"
];
}; };
} }

View file

@ -5,9 +5,11 @@
inputs, inputs,
config, config,
... ...
}: let }:
let
sopsFolder = builtins.toString inputs.nix-secrets + "/sops"; 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 #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 = { sops = {
@ -49,13 +51,14 @@ in {
# The containing folders are created as root and if this is the first ~/.config/ entry, # 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... # 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 # FIXME(sops): We might not need this depending on how https://github.com/Mic92/sops-nix/issues/381 is fixed
system.activationScripts.sopsSetAgeKeyOwnership = let system.activationScripts.sopsSetAgeKeyOwnership =
let
ageFolder = "${config.hostSpec.home}/.config/sops/age"; ageFolder = "${config.hostSpec.home}/.config/sops/age";
user = config.users.users.${config.hostSpec.username}.name; user = config.users.users.${config.hostSpec.username}.name;
group = config.users.users.${config.hostSpec.username}.group; group = config.users.users.${config.hostSpec.username}.group;
in '' in
''
mkdir -p ${ageFolder} || true mkdir -p ${ageFolder} || true
chown -R ${user}:${group} ${config.hostSpec.home}/.config chown -R ${user}:${group} ${config.hostSpec.home}/.config
''; '';
} }

View file

@ -34,7 +34,8 @@
services.fail2ban = { services.fail2ban = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
ignoreIP = [ # Expected internal IP ranges ignoreIP = [
# Expected internal IP ranges
"172.16.0.0/12" "172.16.0.0/12"
"192.168.0.0/16" "192.168.0.0/16"
]; ];

View file

@ -5,7 +5,8 @@
withSwap ? false, withSwap ? false,
swapSize, swapSize,
... ...
}: { }:
{
disko.devices = { disko.devices = {
disk = { disk = {
disk0 = { disk0 = {

View file

@ -5,7 +5,8 @@
swapSize, swapSize,
config, config,
... ...
}: { }:
{
fileSystems."/persist".neededForBoot = true; fileSystems."/persist".neededForBoot = true;
disko.devices = { disko.devices = {
disk = { disk = {

View file

@ -5,7 +5,8 @@
withSwap ? false, withSwap ? false,
swapSize, swapSize,
... ...
}: { }:
{
disko.devices = { disko.devices = {
disk = { disk = {
disk0 = { disk0 = {

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
services.printing = { services.printing = {
enable = true; enable = true;
drivers = with pkgs; [ drivers = with pkgs; [

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: { }:
{
services.glances = { services.glances = {
enable = true; enable = true;
}; };
} }

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
mycli mycli
]; ];

View file

@ -7,12 +7,20 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View file

@ -7,12 +7,18 @@
pkgs, pkgs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View file

@ -1,3 +1,4 @@
{lib, ...}: { { lib, ... }:
{
imports = lib.custom.scanPaths ./.; imports = lib.custom.scanPaths ./.;
} }

View file

@ -4,7 +4,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
options.hostSpec = { options.hostSpec = {
# Data variables that don't dictate configuration settings # Data variables that don't dictate configuration settings
username = lib.mkOption { username = lib.mkOption {
@ -44,12 +45,11 @@
home = lib.mkOption { home = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "The home directory of the user"; description = "The home directory of the user";
default = let default =
let
user = config.hostSpec.username; user = config.hostSpec.username;
in in
if pkgs.stdenv.isLinux if pkgs.stdenv.isLinux then "/home/${user}" else "/Users/${user}";
then "/home/${user}"
else "/Users/${user}";
}; };
persistFolder = lib.mkOption { persistFolder = lib.mkOption {
type = lib.types.str; type = lib.types.str;

View file

@ -1,4 +1,4 @@
{lib, ...}: { { lib, ... }:
{
imports = lib.custom.scanPaths ./.; imports = lib.custom.scanPaths ./.;
} }

View file

@ -2,7 +2,8 @@
lib, lib,
config, config,
... ...
}: { }:
{
options.monitors = lib.mkOption { options.monitors = lib.mkOption {
type = lib.types.listOf ( type = lib.types.listOf (
lib.types.submodule { lib.types.submodule {

View file

@ -27,7 +27,8 @@ in
}; };
}; };
systemd.services.flamesite-backup = { # TODO: Remove when replication setup systemd.services.flamesite-backup = {
# TODO: Remove when replication setup
script = '' 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 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 ${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

View file

@ -7,11 +7,13 @@
nvix.url = "github:TheWanderingCrow/nvix"; nvix.url = "github:TheWanderingCrow/nvix";
}; };
outputs = { outputs =
{
self, self,
nixpkgs, nixpkgs,
... ...
} @ inputs: { }@inputs:
{
nixosConfigurations = { nixosConfigurations = {
ISO = nixpkgs.lib.nixosSystem { ISO = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };

View file

@ -1,4 +1,7 @@
{pkgs ? import <nixpkgs> {}}: let {
pkgs ? import <nixpkgs> { },
}:
let
config = { config = {
imports = [ <nixpkgs/nixos/modules/virtualisation/digital-ocean-image.nix> ]; imports = [ <nixpkgs/nixos/modules/virtualisation/digital-ocean-image.nix> ];
}; };

View file

@ -3,7 +3,8 @@
inputs, inputs,
modulesPath, modulesPath,
... ...
}: { }:
{
imports = [ imports = [
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"