style: format files

+7 -4
flake.nix
···
};
};
-
outputs = { nixpkgs, home-manager, ... }@inputs:
-
let
+
outputs = {
+
nixpkgs,
+
home-manager,
+
...
+
} @ inputs: let
# pkgs = import nixpkgs {};
_utils = import ./global/utils.nix {};
lib = nixpkgs.lib;
in {
nixosConfigurations = {
-
koumakan = (import ./systems/koumakan { inherit _utils lib inputs; });
+
koumakan = import ./systems/koumakan {inherit _utils lib inputs;};
};
-
# formatter.x86_64-linux = pkgs.alejendra;
+
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
}
+2 -3
global/core.nix
···
-
{ pkgs, ... }:
-
{
+
{pkgs, ...}: {
imports = [
./upgrade-diff.nix
];
···
# };
# Lock root account
-
users.users.root.shell = pkgs.shadow; # basically /bin/nologin
+
users.users.root.shell = pkgs.shadow; # basically /bin/nologin
}
+1 -2
global/programs/compilers.nix
···
-
{ pkgs, ... }:
-
{
+
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
luajit
binutils
+1 -2
global/programs/default.nix
···
-
{ ... }:
-
{
+
{...}: {
imports = [
./nix.nix
./editors.nix
+1 -3
global/programs/editors.nix
···
-
{ pkgs, ... }:
-
-
{
+
{...}: {
programs.neovim = {
enable = true;
defaultEditor = true;
+2 -4
global/programs/gpg.nix
···
-
{ pkgs, ... }:
-
-
{
-
environment.systemPackages = with pkgs; [ gnupg pinentry ];
+
{pkgs, ...}: {
+
environment.systemPackages = with pkgs; [gnupg pinentry];
programs.gnupg.agent.enable = true;
# ideally this should be set automatically but in case that doesn't work
+1 -3
global/programs/misc.nix
···
-
{ pkgs, ... }:
-
-
{
+
{pkgs, ...}: {
# Miscellaneous packages that do not have an option.
# It is recommended to use packages.<package>.enable when possible.
+1 -3
global/programs/multiplexers.nix
···
-
{ pkgs, ... }:
-
-
{
+
{pkgs, ...}: {
programs.tmux = {
enable = true;
newSession = true;
+1 -2
global/programs/nix.nix
···
-
{ pkgs, ... }:
-
+
{pkgs, ...}:
# some items are sourced from https://jackson.dev/post/nix-reasonable-defaults/
{
nix.settings = {
+1 -2
global/programs/scm.nix
···
-
{ ... }:
-
{
+
{...}: {
programs.git = {
enable = true;
config = {
+1 -3
global/programs/shells.nix
···
-
{ pkgs, ... }:
-
-
{
+
{pkgs, ...}: {
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
+1 -3
global/programs/ssh.nix
···
-
{ pkgs, ... }:
-
-
{
+
{...}: {
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
+1 -2
global/upgrade-diff.nix
···
# Thank you https://github.com/luishfonseca/dotfiles/blob/ab7625ec406b48493eda701911ad1cd017ce5bc1/modules/upgrade-diff.nix
-
-
{ pkgs, ... }: {
+
{pkgs, ...}: {
system.activationScripts.diff = {
supportsDryActivation = true;
text = ''
+17 -16
global/utils.nix
···
# see /docs/utils.md for a usage guide
-
-
{ ... }:
-
+
{...}:
# let
-
# lib = pkgs.lib;
+
# lib = pkgs.lib;
# in
rec {
-
mkVhost = opts: {
-
# ideally mkOverride/mkDefault would be used, but i have 0 idea how it works.
-
forceSSL = true;
-
useACMEHost = "global.c.soopy.moe";
-
kTLS = true;
-
} // opts;
+
mkVhost = opts:
+
{
+
# ideally mkOverride/mkDefault would be used, but i have 0 idea how it works.
+
forceSSL = true;
+
useACMEHost = "global.c.soopy.moe";
+
kTLS = true;
+
}
+
// opts;
mkSimpleProxy = {
port,
protocol ? "http",
location ? "/",
-
websockets ? false
-
}: mkVhost {
-
locations."${location}" = {
-
proxyPass = "${protocol}://localhost:${toString port}";
-
proxyWebsockets = websockets;
+
websockets ? false,
+
}:
+
mkVhost {
+
locations."${location}" = {
+
proxyPass = "${protocol}://localhost:${toString port}";
+
proxyWebsockets = websockets;
+
};
};
-
};
}
+3 -5
systems/koumakan/certificates/default.nix
···
-
{ ... }:
-
-
{
+
{...}: {
imports = [
./global.nix
./postgresql.nix
···
# == lego Configuration ==
credentialsFile = "/etc/lego/desec";
dnsProvider = "desec";
-
# In an more ideal world we would have an eddsa algo here but oh well
-
keyType = "ec256"; # Ensure we use ec keys
+
# In a more ideal world we would have an eddsa algo here but oh well
+
keyType = "ec256"; # Ensure we use ec keys
dnsResolver = "8.8.8.8:53";
+1 -3
systems/koumakan/certificates/global.nix
···
-
{ ... }:
-
-
{
+
{...}: {
# Global certificate
security.acme.certs."global.c.soopy.moe" = {
group = "nginx";
+1 -3
systems/koumakan/certificates/postgresql.nix
···
-
{ config, ... }:
-
-
{
+
{config, ...}: {
# PostgreSQL only certificate
security.acme.certs."phant.soopy.moe" = {
group = "postgres";
+18 -18
systems/koumakan/configuration.nix
···
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
-
-
{ inputs, ... }:
-
-
{
-
imports = [ # Include the results of the hardware scan.
-
./hardware-configuration.nix
+
{inputs, ...}: {
+
imports = [
+
# Include the results of the hardware scan.
+
./hardware-configuration.nix
-
../../global/core.nix
-
../../global/programs
+
../../global/core.nix
+
../../global/programs
-
./networking
-
./certificates
-
./security
-
./services
+
./networking
+
./certificates
+
./security
+
./services
];
-
nixpkgs.overlays = import ../../overlays ++ (with inputs; [
-
mystia.overlays.default
-
attic.overlays.default
-
]);
+
nixpkgs.overlays =
+
import ../../overlays
+
++ (with inputs; [
+
mystia.overlays.default
+
attic.overlays.default
+
]);
boot.loader.efi = {
canTouchEfiVariables = true;
···
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.cassie = {
isNormalUser = true;
-
extraGroups = [ "wheel" ];
+
extraGroups = ["wheel"];
openssh = {
-
authorizedKeys.keyFiles = [ ../../creds/ssh/cassie ];
+
authorizedKeys.keyFiles = [../../creds/ssh/cassie];
};
# packages = with pkgs; [];
};
+6 -2
systems/koumakan/default.nix
···
-
{ lib, _utils, inputs, ... }:
-
+
{
+
lib,
+
_utils,
+
inputs,
+
...
+
}:
lib.nixosSystem {
system = "x86_64-linux";
+48 -44
systems/koumakan/hardware-configuration.nix
···
# 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 + "/installer/scan/not-detected.nix")
-
];
+
config,
+
lib,
+
pkgs,
+
modulesPath,
+
...
+
}: {
+
imports = [
+
(modulesPath + "/installer/scan/not-detected.nix")
+
];
-
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sr_mod" ];
-
boot.initrd.kernelModules = [ "dm-snapshot" ];
-
boot.kernelModules = [ "kvm-intel" ];
-
boot.extraModulePackages = [ ];
+
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "sr_mod"];
+
boot.initrd.kernelModules = ["dm-snapshot"];
+
boot.kernelModules = ["kvm-intel"];
+
boot.extraModulePackages = [];
-
fileSystems."/" =
-
{ device = "/dev/disk/by-uuid/0b38be0c-5365-4f02-85b8-72f37bb2ddf8";
-
fsType = "btrfs";
-
};
+
fileSystems."/" = {
+
device = "/dev/disk/by-uuid/0b38be0c-5365-4f02-85b8-72f37bb2ddf8";
+
fsType = "btrfs";
+
};
-
fileSystems."/var/log" =
-
{ device = "/dev/disk/by-uuid/e6ff7c96-3bef-4a17-9114-64ef1460fc00";
-
fsType = "btrfs";
-
};
+
fileSystems."/var/log" = {
+
device = "/dev/disk/by-uuid/e6ff7c96-3bef-4a17-9114-64ef1460fc00";
+
fsType = "btrfs";
+
};
-
fileSystems."/var/log/audit" =
-
{ device = "/dev/disk/by-uuid/a20e2995-7297-4f69-af89-b58ff314e029";
-
fsType = "btrfs";
-
};
+
fileSystems."/var/log/audit" = {
+
device = "/dev/disk/by-uuid/a20e2995-7297-4f69-af89-b58ff314e029";
+
fsType = "btrfs";
+
};
-
fileSystems."/srv/osm-data" =
-
{ device = "/dev/disk/by-uuid/3c1a8b58-fbe6-4522-8e27-72419b3c2d6f";
-
fsType = "btrfs";
-
};
+
fileSystems."/srv/osm-data" = {
+
device = "/dev/disk/by-uuid/3c1a8b58-fbe6-4522-8e27-72419b3c2d6f";
+
fsType = "btrfs";
+
};
-
fileSystems."/boot" =
-
{ device = "/dev/disk/by-uuid/9E0F-3FDE";
-
fsType = "vfat";
-
};
+
fileSystems."/boot" = {
+
device = "/dev/disk/by-uuid/9E0F-3FDE";
+
fsType = "vfat";
+
};
-
fileSystems."/boot/efi" =
-
{ device = "/dev/disk/by-uuid/9EB1-FA5A";
-
fsType = "vfat";
-
};
+
fileSystems."/boot/efi" = {
+
device = "/dev/disk/by-uuid/9EB1-FA5A";
+
fsType = "vfat";
+
};
-
fileSystems."/srv/www/keine" =
-
{ device = "/dev/disk/by-uuid/0a0e102a-b1ac-44a2-947b-2ec505b532ad";
-
fsType = "btrfs";
-
};
+
fileSystems."/srv/www/keine" = {
+
device = "/dev/disk/by-uuid/0a0e102a-b1ac-44a2-947b-2ec505b532ad";
+
fsType = "btrfs";
+
};
-
fileSystems."/home" =
-
{ device = "/dev/disk/by-uuid/50165105-6b82-4228-9640-2d32ce45f76e";
-
fsType = "btrfs";
-
};
+
fileSystems."/home" = {
+
device = "/dev/disk/by-uuid/50165105-6b82-4228-9640-2d32ce45f76e";
+
fsType = "btrfs";
+
};
-
swapDevices =
-
[ { device = "/dev/disk/by-uuid/efd68464-2e0c-4aaf-8264-519dd7d05ddf"; }
-
];
+
swapDevices = [
+
{device = "/dev/disk/by-uuid/efd68464-2e0c-4aaf-8264-519dd7d05ddf";}
+
];
# 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
+1 -3
systems/koumakan/networking/default.nix
···
-
{ ... }:
-
-
{
+
{...}: {
imports = [
./firewall.nix
./interface.nix
+3 -4
systems/koumakan/networking/firewall.nix
···
-
{ pkgs, ... }:
-
-
{
+
{...}: {
networking.firewall = {
enable = true;
allowedTCPPorts = [
22 # ssh
-
80 443 # http[s]
+
80
+
443 # http[s]
];
};
}
+1 -2
systems/koumakan/networking/interface.nix
···
-
{ ... } :
-
{
+
{...}: {
networking.networkmanager.ethernet.macAddress = builtins.readFile ./nma.cry;
}
+1 -2
systems/koumakan/security/default.nix
···
-
{ ... }:
-
{
+
{...}: {
imports = [
./pam.nix
./sudo.nix
+1 -2
systems/koumakan/security/pam.nix
···
-
{ ... }:
-
{
+
{...}: {
security.pam.yubico = {
enable = true;
id = builtins.readFile ./ykid.cry;
+4 -2
systems/koumakan/security/secureboot.nix
···
-
{ pkgs, lib, ... }:
-
{
+
pkgs,
+
lib,
+
...
+
}: {
environment.systemPackages = with pkgs; [
cryptsetup
sbctl
+2 -3
systems/koumakan/security/sudo.nix
···
-
{ pkgs, ... }:
-
{
+
{pkgs, ...}: {
security.sudo.extraConfig = ''
Defaults insults
'';
-
security.sudo.package = (pkgs.sudo.override {withInsults = true;});
+
security.sudo.package = pkgs.sudo.override {withInsults = true;};
}
+15 -13
systems/koumakan/services/attic.nix
···
-
{ _utils, pkgs, ... }:
-
-
let
+
{
+
_utils,
+
pkgs,
+
...
+
}: let
# where tf are the docs for pkgs.formats??
toml = pkgs.formats.toml {};
in {
···
};
};
-
services.nginx.virtualHosts."nonbunary.soopy.moe" = _utils.mkSimpleProxy {
-
port = 38191;
-
} // {
-
extraConfig = ''
-
client_max_body_size 1G;
-
proxy_read_timeout 3h;
-
proxy_connect_timeout 3h;
-
proxy_send_timeout 3h;
-
'';
-
};
+
services.nginx.virtualHosts."nonbunary.soopy.moe" =
+
_utils.mkSimpleProxy {port = 38191;}
+
// {
+
extraConfig = ''
+
client_max_body_size 1G;
+
proxy_read_timeout 3h;
+
proxy_connect_timeout 3h;
+
proxy_send_timeout 3h;
+
'';
+
};
}
+1 -3
systems/koumakan/services/default.nix
···
-
{ ... }:
-
-
{
+
{...}: {
imports = [
./nginx.nix
+1 -3
systems/koumakan/services/nginx.nix
···
-
{ pkgs, ... }:
-
-
{
+
{pkgs, ...}: {
services.nginx = {
enable = true;
enableReload = true;
+2 -4
systems/koumakan/services/postgresql.nix
···
-
{ pkgs, ... }:
-
-
{
+
{pkgs, ...}: {
services.postgresql = {
enable = true;
package = pkgs.postgresql_15;
dataDir = "/var/lib/postgresql/15";
-
logLinePrefix = "%m [%p] %h "; # bollocks to that
+
logLinePrefix = "%m [%p] %h ";
authentication = ''
# unix socket connection
+1 -3
systems/koumakan/services/proxies/default.nix
···
-
{ ... }:
-
-
{
+
{...}: {
imports = [
./nitter.nix
];
+5 -3
systems/koumakan/services/proxies/nitter.nix
···
-
{ _utils, pkgs, ... }:
-
{
+
_utils,
+
pkgs,
+
...
+
}: {
services.nitter = {
enable = true;
-
redisCreateLocally = false; # why is the default of this `true`??
+
redisCreateLocally = false; # why is the default of this `true`??
server = {
title = "NSM";
port = 36325;
+1 -2
systems/koumakan/services/redis.nix
···
-
{ ... }:
-
{
+
{...}: {
services.redis.servers."" = {
enable = true;
};
+2 -4
systems/koumakan/services/static-sites/default.nix
···
-
{ ... }:
-
{
+
{...}: {
imports = [
./keine.nix
];
···
"~ ^/(index.html|splash.png)".root = "/srv/www/maintenance";
};
extraConfig = ''
-
error_page 503 /index.html;
+
error_page 503 /index.html;
'';
-
};
}
+2 -3
systems/koumakan/services/static-sites/keine.nix
···
-
{ ... }:
-
{
+
{...}: {
services.nginx.virtualHosts."keine.soopy.moe" = {
useACMEHost = "global.c.soopy.moe";
-
addSSL = true; # Don't force SSL on a mirror (implications TBD)
+
addSSL = true; # Don't force SSL on a mirror (implications TBD)
root = "/srv/www/keine";
locations = {