Nixfmt, unvendor Rory user

This commit is contained in:
Rory& 2024-07-19 06:16:51 +02:00
parent 42c65b27b5
commit 0d980840a4
21 changed files with 554 additions and 2468 deletions

Binary file not shown.

View file

@ -1,30 +1,45 @@
{
description = "Chris' services flake";
description = "LiteNet services flake";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
#url="path:/Rory-Open-Architecture/nixpkgs";
};
home-manager = {
home-manager = {
url = "github:nix-community/home-manager/master";
};
};
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
nixosConfigurations = {
matrix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./host/matrix/configuration.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
];
specialArgs = {
inherit home-manager;
};
};
Rory-Open-Architecture = {
url = "git+https://cgit.rory.gay/Rory-Open-Architecture.git";
flake = false;
};
};
outputs =
inputs: with inputs; {
nixosConfigurations = {
matrix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./host/matrix/configuration.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager
# Rory&'s user
(
{ config, ... }:
{
programs.dconf.enable = true;
}
) # Fix for home-manager failing to deploy
(Rory-Open-Architecture + "/modules/users/Rory.nix")
];
specialArgs = {
inherit home-manager;
};
};
};
};
}

View file

@ -1,22 +1,30 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
imports =
[
../../modules/base-server.nix
imports = [
../../modules/base-server.nix
./services/postgres.nix
./services/matrix/root.nix
./services/nginx/nginx.nix
];
./services/postgres.nix
./services/matrix/root.nix
./services/nginx/nginx.nix
];
networking = {
hostName = "matrix";
interfaces.ens18.ipv4.addresses = [ {
address = "10.10.0.3";
prefixLength = 8;
} ];
interfaces.ens18.ipv4.addresses = [
{
address = "10.10.0.3";
prefixLength = 8;
}
];
defaultGateway.interface = "ens18";
};
hardware.enableAllFirmware = false;
hardware.enableRedistributableFirmware = false;
system.stateVersion = "22.11"; # DO NOT EDIT!
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
# coturn (WebRTC)
@ -50,4 +55,3 @@
#};
}

View file

@ -1,10 +1,15 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
# Alicia - doesnt work yet... until in nixpkgs...
services.draupnir = {
enable = true;
pantalaimon = {
enable = true;
username = "draupnir";
@ -24,7 +29,7 @@
backgroundDelayMS = 10; # delay isn't needed, I don't mind the performance hit
pollReports = false; # this is a single person homeserver... let's save ourself the work
admin.enableMakeRoomAdminCommand = true;
commands.ban.defaultReasons = [
"spam"
@ -46,10 +51,9 @@
};
};
# services.pantalaimon-headless.instances.draupnir = {
# homeserver = "http://localhost:8008";
# ssl = false;
# };
# services.pantalaimon-headless.instances.draupnir = {
# homeserver = "http://localhost:8008";
# ssl = false;
# };
}

View file

@ -1,11 +1,16 @@
{ config, pkgs, lib, botcore-v4, ... }:
{
config,
pkgs,
lib,
botcore-v4,
...
}:
{
imports =
[
./synapse.nix
# ./coturn.nix
# ./draupnir.nix
];
imports = [
./synapse.nix
# ./coturn.nix
# ./draupnir.nix
];
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
services.matrix-synapse = {
@ -6,12 +11,11 @@
withJemalloc = true;
dataDir = "/mnt/synapse-media";
# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html
settings = {
server_name = "litenet.tel";
enable_registration = true;
registration_requires_token = true;
@ -28,35 +32,40 @@
max_long_retry_delay = "30s";
};
# event_cache_size = "1200K"; #defaults to 10K
# caches = {
# global_factor = 5000.0;
# cache_entry_ttl = "12h";
# expire_caches = true;
# sync_response_cache_duration = "6h";
# cache_autotuning = {
# max_cache_memory_usage = "65536M";
# target_cache_memory_usage = "32768M";
# min_cache_ttl = "6h";
# };
# };
# event_cache_size = "1200K"; #defaults to 10K
# caches = {
# global_factor = 5000.0;
# cache_entry_ttl = "12h";
# expire_caches = true;
# sync_response_cache_duration = "6h";
# cache_autotuning = {
# max_cache_memory_usage = "65536M";
# target_cache_memory_usage = "32768M";
# min_cache_ttl = "6h";
# };
# };
# Alicia - figure this out later...
#registration_shared_secret = builtins.exec ["cat" "/dev/urandom" "|" "tr" "-dc" "a-zA-Z0-9" "|" "fold" "-w" "256" "|" "head" "-n" "1"];
# registration_shared_secret_path = "/mnt/synapse-media/registration_shared_secret.txt";
# registration_shared_secret_path = "/mnt/synapse-media/registration_shared_secret.txt";
registration_shared_secret = "fuck";
listeners = [
{
{
port = 8008;
bind_addresses = [ "127.0.0.1" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [ {
names = [ "client" "federation" ];
compress = true;
} ];
resources = [
{
names = [
"client"
"federation"
];
compress = true;
}
];
}
];
dynamic_thumbnails = true;
@ -81,63 +90,63 @@
};
app_service_config_files = [
#"/etc/matrix-synapse/appservice-registration.yaml"
# "/var/lib/matrix-synapse/modas-registration.yaml"
# "/var/lib/matrix-synapse/modas-registration.yaml"
];
# rc_message = {
# per_second = 1000;
# burst_count = 1000;
# };
# rc_login = {
# address = {
# per_second = 1000;
# burst_count = 1000;
# };
# account = {
# per_second = 1000;
# burst_count = 1000;
# };
# failed_attempts = {
# per_second = 0.1;
# burst_count = 3;
# };
# };
# rc_joins = {
# local = {
# per_second = 1000;
# burst_count = 1000;
# };
# remote = {
# per_second = 1000;
# burst_count = 1000;
# };
# };
# rc_joins_per_room = {
# per_second = 1000;
# burst_count = 1000;
# };
# rc_invites = {
# per_room = {
# per_second = 1000;
# burst_count = 1000;
# };
# per_user = {
# per_second = 1000;
# burst_count = 1000;
# };
# per_issuer = {
# per_second = 1000;
# burst_count = 1000;
# };
# };
# rc_federation = {
# window_size = 10;
# sleep_limit = 1000;
# sleep_delay = 100;
# reject_limit = 1000;
# concurrent = 100;
# };
# federation_rr_transactions_per_room_per_second = 1;
# rc_message = {
# per_second = 1000;
# burst_count = 1000;
# };
# rc_login = {
# address = {
# per_second = 1000;
# burst_count = 1000;
# };
# account = {
# per_second = 1000;
# burst_count = 1000;
# };
# failed_attempts = {
# per_second = 0.1;
# burst_count = 3;
# };
# };
# rc_joins = {
# local = {
# per_second = 1000;
# burst_count = 1000;
# };
# remote = {
# per_second = 1000;
# burst_count = 1000;
# };
# };
# rc_joins_per_room = {
# per_second = 1000;
# burst_count = 1000;
# };
# rc_invites = {
# per_room = {
# per_second = 1000;
# burst_count = 1000;
# };
# per_user = {
# per_second = 1000;
# burst_count = 1000;
# };
# per_issuer = {
# per_second = 1000;
# burst_count = 1000;
# };
# };
# rc_federation = {
# window_size = 10;
# sleep_limit = 1000;
# sleep_delay = 100;
# reject_limit = 1000;
# concurrent = 100;
# };
# federation_rr_transactions_per_room_per_second = 1;
max_image_pixels = "100M";
@ -175,42 +184,41 @@
plugins = with pkgs.matrix-synapse-plugins; [
# Alicia - need to port draupnir...
#matrix-synapse-mjolnir-antispam
# matrix-synapse-pam
# matrix-synapse-pam
];
# extraConfigFiles = [
# (pkgs.writeTextFile {
# name = "matrix-synapse-extra-config.yml";
# text = ''
# modules:
# - module: "pam_auth_provider.PAMAuthProvider"
# config:
# create_users: true
# skip_user_check: false
# '';
# })
# ];
# extraConfigFiles = [
# (pkgs.writeTextFile {
# name = "matrix-synapse-extra-config.yml";
# text = ''
# modules:
# - module: "pam_auth_provider.PAMAuthProvider"
# config:
# create_users: true
# skip_user_check: false
# '';
# })
# ];
};
systemd.services.matrix-synapse-reg-token = {
description = "Random registration token for Synapse.";
before = ["matrix-synapse.service"]; # So the registration can be used by Synapse
wantedBy = ["multi-user.target"];
after = ["network.target"];
systemd.services.matrix-synapse-reg-token = {
description = "Random registration token for Synapse.";
before = [ "matrix-synapse.service" ]; # So the registration can be used by Synapse
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
script = ''
script = ''
if [ ! -f "registration_shared_secret.txt" ]
then
cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt
else
echo Not generating key, key exists;
fi'';
serviceConfig = {
User = "matrix-synapse";
Group = "matrix-synapse";
WorkingDirectory = "/mnt/synapse-media/";
};
if [ ! -f "registration_shared_secret.txt" ]
then
cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt
else
echo Not generating key, key exists;
fi'';
serviceConfig = {
User = "matrix-synapse";
Group = "matrix-synapse";
WorkingDirectory = "/mnt/synapse-media/";
};
};
}

View file

@ -26,34 +26,34 @@
locations."= /.well-known/matrix/server".extraConfig = ''
more_set_headers 'Content-Type application/json';
more_set_headers 'Access-Control-Allow-Origin *';
return 200 '${builtins.toJSON {
"m.server" = "matrix.litenet.tel:443";
}}';
'';
return 200 '${builtins.toJSON { "m.server" = "matrix.litenet.tel:443"; }}';
'';
locations."= /.well-known/matrix/client".extraConfig = ''
more_set_headers 'Content-Type application/json';
more_set_headers 'Access-Control-Allow-Origin *';
return 200 '${builtins.toJSON {
"m.homeserver".base_url = "https://matrix.litenet.tel";
"m.identity_server".base_url = "https://matrix.litenet.tel";
}
return 200 '${
builtins.toJSON {
"m.homeserver".base_url = "https://matrix.litenet.tel";
"m.identity_server".base_url = "https://matrix.litenet.tel";
}
}';
'';
'';
locations."= /.well-known/matrix/support".extraConfig = ''
more_set_headers 'Content-Type application/json';
more_set_headers 'Access-Control-Allow-Origin *';
return 200 '${builtins.toJSON {
admins = [
{
matrix_id = "@emma:rory.gay";
role = "admin";
}
{
matrix_id = "@chris:litenet.tel";
role = "admin";
}
];
}
return 200 '${
builtins.toJSON {
admins = [
{
matrix_id = "@emma:rory.gay";
role = "admin";
}
{
matrix_id = "@chris:litenet.tel";
role = "admin";
}
];
}
}';
'';
}

View file

@ -22,227 +22,227 @@
# '';
# };
# https://matrix-org.github.io/synapse/latest/workers.html#synapseappgeneric_worker
locations."~ ^/_matrix/client/(r0|v3)/sync$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
# https://matrix-org.github.io/synapse/latest/workers.html#synapseappgeneric_worker
locations."~ ^/_matrix/client/(r0|v3)/sync$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
extraConfig = ''
proxy_read_timeout 3600;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
'';
};
locations."~ ^/_matrix/client/(api/v1|r0|v3)/events$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3)/initialSync$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/createRoom$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/publicRooms$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/joined_members$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/rooms/.*/hierarchy$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(v1|unstable)/rooms/.*/relations/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/rooms/.*/threads$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/unstable/org.matrix.msc2716/rooms/.*/batch_send$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/account/3pid$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/account/whoami$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/devices$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/versions$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/rooms/.*/timestamp_to_event$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/search$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/query$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/changes$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/claim$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/room_keys/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/upload/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/login$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/register$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/register/m.login.registration_token/validity$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/join/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
proxy_read_timeout 3600;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
'';
};
locations."~ ^/_matrix/client/(api/v1|r0|v3)/events$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3)/initialSync$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/createRoom$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/publicRooms$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/joined_members$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/rooms/.*/hierarchy$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(v1|unstable)/rooms/.*/relations/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/rooms/.*/threads$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/unstable/org.matrix.msc2716/rooms/.*/batch_send$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/account/3pid$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/account/whoami$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/devices$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/versions$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/rooms/.*/timestamp_to_event$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/search$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/query$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/changes$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/claim$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/room_keys/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/keys/upload/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/login$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/register$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/v1/register/m.login.registration_token/validity$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/join/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-typing-stream
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing" = {
proxyPass = "http://stream_writer_typing_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-typing-stream
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing" = {
proxyPass = "http://stream_writer_typing_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-to_device-stream
locations."~ ^/_matrix/client/(r0|v3|unstable)/sendToDevice/" = {
proxyPass = "http://stream_writer_to_device_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-to_device-stream
locations."~ ^/_matrix/client/(r0|v3|unstable)/sendToDevice/" = {
proxyPass = "http://stream_writer_to_device_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-account_data-stream
locations."~ ^/_matrix/client/(r0|v3|unstable)/.*/tags" = {
proxyPass = "http://stream_writer_account_data_stream_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/.*/account_data" = {
proxyPass = "http://stream_writer_account_data_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-receipts-stream
locations."~ ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt" = {
proxyPass = "http://stream_writer_receipts_stream_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers" = {
proxyPass = "http://stream_writer_receipts_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-presence-stream
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/" = {
proxyPass = "http://stream_writer_presence_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-account_data-stream
locations."~ ^/_matrix/client/(r0|v3|unstable)/.*/tags" = {
proxyPass = "http://stream_writer_account_data_stream_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/.*/account_data" = {
proxyPass = "http://stream_writer_account_data_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-receipts-stream
locations."~ ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt" = {
proxyPass = "http://stream_writer_receipts_stream_workers_upstream$request_uri";
};
locations."~ ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers" = {
proxyPass = "http://stream_writer_receipts_stream_workers_upstream$request_uri";
};
# https://matrix-org.github.io/synapse/latest/workers.html#the-presence-stream
locations."~ ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/" = {
proxyPass = "http://stream_writer_presence_stream_workers_upstream$request_uri";
};
### DUPLICATES????
# https://matrix-org.github.io/synapse/latest/workers.html#updating-the-user-directory
locations."~ ^/_matrix/client/(r0|v3|unstable)/user_directory/search$" = {
proxyPass = "http://user_dir_workers_upstream$request_uri";
};
proxyPass = "http://user_dir_workers_upstream$request_uri";
};
# ???
locations."/" = {
#resolver 127.0.0.11 valid=5s;
#set $backend "matrix-synapse:8008";
#proxyPass = "http://$backend";
locations."/" = {
#resolver 127.0.0.11 valid=5s;
#set $backend "matrix-synapse:8008";
#proxyPass = "http://$backend";
proxyPass = "http://127.0.0.1:8008";
};
};
locations."~ ^/_matrix/federation/v1/event/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/state/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/state_ids/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/backfill/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/get_missing_events/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/publicRooms" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/query/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/make_join/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/make_leave/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/(v1|v2)/send_join/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/(v1|v2)/send_leave/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/(v1|v2)/invite/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/event_auth/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/timestamp_to_event/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/exchange_third_party_invite/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/user/devices/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/key/v2/query" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/hierarchy/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/send/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/event/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/state/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/state_ids/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/backfill/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/get_missing_events/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/publicRooms" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/query/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/make_join/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/make_leave/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/(v1|v2)/send_join/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/(v1|v2)/send_leave/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/(v1|v2)/invite/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/event_auth/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/timestamp_to_event/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/exchange_third_party_invite/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/user/devices/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/key/v2/query" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/hierarchy/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
locations."~ ^/_matrix/federation/v1/send/" = {
proxyPass = "http://generic_workers_upstream$request_uri";
};
##### media repo
@ -269,12 +269,11 @@
proxyPass = "http://media_repository_workers_upstream$request_uri";
};
#locations."/" = {
#resolver 127.0.0.11 valid=5s;
#set $backend "matrix-synapse:8048";
#proxyPass = "http://$backend";
#};
#locations."/" = {
#resolver 127.0.0.11 valid=5s;
#set $backend "matrix-synapse:8048";
#proxyPass = "http://$backend";
#};
locations."/_synapse/client".proxyPass = "http://127.0.0.1:8008";
locations."/_synapse/client".proxyPass = "http://127.0.0.1:8008";
}

View file

@ -23,4 +23,4 @@
user_dir_workers_upstream.servers = {
"127.0.0.1:18661" = { };
};
}
}

View file

@ -23,4 +23,4 @@
user_dir_workers_upstream.servers = {
"127.0.0.1:8008" = { };
};
}
}

View file

@ -1,10 +1,15 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
services = {
nginx = {
enable = true;
package = pkgs.nginxQuic;
#package = pkgs.nginxMainline;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedZstdSettings = true;
@ -14,19 +19,17 @@
defaultMimeTypes = ../../../../modules/packages/nginx/mime.types;
appendConfig = ''
worker_processes 16;
'';
eventsConfig = ''
'';
eventsConfig = ''
#use kqueue;
worker_connections 512;
'';
'';
appendHttpConfig = ''
#sendfile on;
disable_symlinks off;
'';
upstreams = import ./matrix-upstreams.nix;
additionalModules = with pkgs.nginxModules; [
moreheaders
];
additionalModules = with pkgs.nginxModules; [ moreheaders ];
virtualHosts = {
#matrix...
"matrix.litenet.tel" = import ./litenet.tel/matrix.nix;
@ -35,14 +38,6 @@
};
};
systemd.services.nginx.serviceConfig = {
LimitNOFILE=5000000;
LimitNOFILE = 5000000;
};
# systemd.services.nginx.requires = [ "data.mount" ];
# security.acme.acceptTerms = true;
# security.acme.defaults.email = "root@thearcanebrony.net";
# environment.systemPackages = with pkgs; [
#gitfs
# ];
}

View file

@ -1,7 +1,12 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
systemd.tmpfiles.rules = [ "d /mnt/postgres/data 0750 postgres postgres" ];
systemd.tmpfiles.rules = [ "d /mnt/postgres/data 0750 postgres postgres" ];
services.postgresql = {
enable = true;
@ -26,58 +31,57 @@
max_connections = 250;
superuser_reserved_connections = 3;
# shared_buffers = "32565MB";
# work_mem = "512MB";
# maintenance_work_mem = "1024MB";
# huge_pages = "try";
# effective_cache_size = "60GB"; #was 22
# effective_io_concurrency = "8";
# random_page_cost = 4;
# shared_buffers = "32565MB";
# work_mem = "512MB";
# maintenance_work_mem = "1024MB";
# huge_pages = "try";
# effective_cache_size = "60GB"; #was 22
# effective_io_concurrency = "8";
# random_page_cost = 4;
# can use this to view stats: SELECT query, total_time, calls, rows FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
# shared_preload_libraries = "pg_stat_statements";
# track_io_timing = "on";
# track_functions = "pl";
# "pg_stat_statements.max" = "10000"; # additional
# "pg_stat_statements.track" = "all"; # additional
# shared_preload_libraries = "pg_stat_statements";
# track_io_timing = "on";
# track_functions = "pl";
# "pg_stat_statements.max" = "10000"; # additional
# "pg_stat_statements.track" = "all"; # additional
# wal_level = "replica";
# max_wal_senders = 0;
# synchronous_commit = "off"; #was on
# wal_level = "replica";
# max_wal_senders = 0;
# synchronous_commit = "off"; #was on
# checkpoint_timeout = "15min";
# checkpoint_completion_target = "0.9";
# max_wal_size = "1GB";
# min_wal_size = "512MB";
#
# wal_compression = "on";
# wal_buffers = "-1";
# wal_writer_delay = "200ms";
# wal_writer_flush_after = "1MB";
# #checkpoint_segments = "64"; # additional
# default_statistics_target = "250"; # additional
# checkpoint_timeout = "15min";
# checkpoint_completion_target = "0.9";
# max_wal_size = "1GB";
# min_wal_size = "512MB";
#
# wal_compression = "on";
# wal_buffers = "-1";
# wal_writer_delay = "200ms";
# wal_writer_flush_after = "1MB";
# #checkpoint_segments = "64"; # additional
# default_statistics_target = "250"; # additional
# bgwriter_delay = "200ms";
# bgwriter_lru_maxpages = "100";
# bgwriter_lru_multiplier = "2.0";
# bgwriter_flush_after = "0";
# bgwriter_delay = "200ms";
# bgwriter_lru_maxpages = "100";
# bgwriter_lru_multiplier = "2.0";
# bgwriter_flush_after = "0";
# max_worker_processes = "32"; #was 14
# max_parallel_workers_per_gather = "16"; #was 7
# max_parallel_maintenance_workers = "16"; #was 7
# max_parallel_workers = "32"; #was 14
# parallel_leader_participation = "on";
# max_worker_processes = "32"; #was 14
# max_parallel_workers_per_gather = "16"; #was 7
# max_parallel_maintenance_workers = "16"; #was 7
# max_parallel_workers = "32"; #was 14
# parallel_leader_participation = "on";
# enable_partitionwise_join = "on";
# enable_partitionwise_aggregate = "on";
# jit = "on";
# max_slot_wal_keep_size = "1GB";
# track_wal_io_timing = "on";
# maintenance_io_concurrency = "4";
# wal_recycle = "on";
# enable_partitionwise_join = "on";
# enable_partitionwise_aggregate = "on";
# jit = "on";
# max_slot_wal_keep_size = "1GB";
# track_wal_io_timing = "on";
# maintenance_io_concurrency = "4";
# wal_recycle = "on";
};
};
}

View file

@ -1,40 +1,33 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
imports =
[
./base.nix
./users/chris.nix
];
imports = [
./base.nix
./users/chris.nix
];
documentation.nixos.enable = false;
documentation.enable = false;
documentation.info.enable = false;
documentation.man.enable = false;
environment.variables.BROWSER = "echo";
nix.settings.trusted-users = [ "root" "@wheel" ];
nix.settings.trusted-users = [
"root"
"@wheel"
];
time.timeZone = lib.mkDefault "UTC";
systemd = {
# Given that our systems are headless, emergency mode is useless.
# We prefer the system to attempt to continue booting so
# that we can hopefully still access it remotely.
enableEmergencyMode = false;
# For more detail, see:
# https://0pointer.de/blog/projects/watchdog.html
watchdog = {
# systemd will send a signal to the hardware watchdog at half
# the interval defined here, so every 10s.
# If the hardware watchdog does not get a signal for 20s,
# it will forcefully reboot the system.
runtimeTime = "20s";
# Forcefully reboot if the final stage of the reboot
# hangs without progress for more than 30s.
# For more info, see:
# https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog
rebootTime = "30s";
};
@ -46,8 +39,8 @@
systemd.services.NetworkManager-wait-online.enable = false;
systemd.network.wait-online.enable = false;
# systemd.services.systemd-networkd.stopIfChanged = false;
# systemd.services.systemd-resolved.stopIfChanged = false;
# systemd.services.systemd-networkd.stopIfChanged = false;
# systemd.services.systemd-resolved.stopIfChanged = false;
nix.settings.max-free = lib.mkDefault (1000 * 1000 * 1000);
nix.settings.min-free = lib.mkDefault (128 * 1000 * 1000);
@ -82,8 +75,15 @@
};
useDHCP = false;
# nameservers = [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ];
nameservers = [ "10.0.0.1" "10.5.0.1" "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ];
# nameservers = [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ];
nameservers = [
"10.0.0.1"
"10.5.0.1"
"1.1.1.1"
"1.0.0.1"
"8.8.8.8"
"8.4.4.8"
];
defaultGateway = "10.0.0.1";
};
@ -91,4 +91,3 @@
i18n.defaultLocale = "en_US.UTF-8";
}

View file

@ -1,15 +1,16 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
imports =
[
./packages/vim.nix
./users/Rory.nix
];
imports = [ ./packages/vim.nix ];
boot = {
initrd.systemd.enable = true;
kernelParams = [
kernelParams = [
"memory_hotplug.memmap_on_memory=1"
"memhp_default_state=online"
"net.core.default_qdisc=fq"
@ -60,7 +61,12 @@
# allowedTCPPorts = [ ... ];
# allowedUDPPorts = [ ... ];
};
nameservers = [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ];
nameservers = [
"1.1.1.1"
"1.0.0.1"
"8.8.8.8"
"8.4.4.8"
];
};
i18n.defaultLocale = "en_US.UTF-8";
@ -71,7 +77,7 @@
#allow more logins in cases where i have many ssh keys on a system
extraConfig = ''
MaxAuthTries 32
'';
'';
};
resolved = {
enable = true;
@ -84,7 +90,7 @@
sleep.extraConfig = ''
AllowSuspend=no
AllowHibernation=no
'';
'';
};
environment.systemPackages = with pkgs; [
@ -114,7 +120,6 @@
unzip
brotli
# - zsh
zsh
zsh-powerlevel10k
@ -129,7 +134,10 @@
'';
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
trusted-users = [ "@wheel" ];
};

View file

@ -1,14 +1,20 @@
{ pkgs, ... }:
{
environment.variables = { EDITOR = "vim"; };
environment.variables = {
EDITOR = "vim";
};
environment.systemPackages = with pkgs; [
(neovim.override {
vimAlias = true;
configure = {
packages.myPlugins = with pkgs.vimPlugins; {
start = [ vim-lastplace vim-nix vim-airline ];
opt = [];
start = [
vim-lastplace
vim-nix
vim-airline
];
opt = [ ];
};
customRC = ''
" your custom vimrc
@ -17,6 +23,6 @@
" ...
'';
};
}
)];
})
];
}

View file

@ -1,53 +0,0 @@
{ config, lib, pkgs, home-manager, ... }:
{
programs = {
ssh = {
startAgent = true;
setXAuthLocation = true;
enableAskPassword = true;
};
};
home-manager.users.Rory = {
services.gnome-keyring.enable = lib.mkForce false;
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
# keepassxc, maybe?
systemd.user.services.keepassxc = {
Unit = {
Description = "KeePassXC password manager";
#After = [ "graphical-session-pre.target" ];
PartOf = [ "default.target" ];
};
Install = { WantedBy = [ "default.target" ]; };
Service = {
ExecStart = "${pkgs.keepassxc}/bin/keepassxc ~/.secrets.kdbx";
Restart = "always";
};
};
systemd.user.services.easyeffects = {
Unit = {
Description = "EasyEffects";
#After = [ "graphical-session-pre.target" ];
PartOf = [ "default.target" ];
};
Install = { WantedBy = [ "default.target" ]; };
Service = {
ExecStart = "${pkgs.easyeffects}/bin/easyeffects";
Restart = "always";
};
};
home.stateVersion = "22.11";
};
}

View file

@ -1,190 +0,0 @@
{ config, lib, pkgs, home-manager, ... }:
{
users.users.Rory = {
isNormalUser = true;
extraGroups = [ "wheel" "libvirtd" "ocp" ];
packages = with pkgs; [
lnav
age
git
lsd
duf
btop
htop
kitty.terminfo
tmux
jq
dig
# - zsh
zsh
zsh-powerlevel10k
zsh-nix-shell
zsh-you-should-use
zsh-syntax-highlighting
zsh-completions
];
openssh.authorizedKeys.keys = [
#"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICT+53Hy3wbIlNVIomK2RroaimMWrTlUkndjHt1dFuyh root@pfSense-arcane-home.localdomain"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILF2IuNu//0DP/wKMuDvBgVT3YBS2uULsipbdrhJCTM7 thearcanebrony@tab-linux-desktop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN/kNkY/E5b6rvCQLMaSbpLQ/xoyywIwVVu9uo2j/B6p Rory@RoryNix"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJPRTuz83dVThuDVXhDz3w3uYBGJ+JPzdZFT6wvhQXQ3 Rory@Rory-wsl" # work laptop
];
useDefaultShell = true;
shell = pkgs.zsh;
};
programs.zsh.enable = true;
environment.shells = with pkgs; [ zsh ];
home-manager.users.Rory = {
programs = {
git = {
enable = true;
userName = "Rory&";
userEmail = "root@rory.gay";
extraConfig = {
safe = {
directory = "/";
};
};
};
zsh = {
enable = true;
enableAutosuggestions = true;
enableVteIntegration = true;
autocd = true;
initExtraFirst = ''
export EDITOR=nvim
export SYSTEMD_EDITOR=$EDITOR
export GIT_EDITOR=$EDITOR
export QT_QPA_PLATFORMTHEME=xdgdesktopportal
export GTK_USE_PORTAL=1
export _JAVA_AWT_WM_NONREPARENTING=1
export WINEDEBUG=-all
export DOTPROFILE_LOADED='yes'
export CHOKIDAR_USEPOLLING=true
export MSBUILDLIVELOGGER=auto
export DOTNET_WATCH_SUPPRESS_LAUNCH_BROWSER=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
function mkkey() {
echo "Making key for $1"
ssh-keygen -t ed25519 -C "$HOST -> $1" -f ~/.ssh/id_ed25519_$1
(
echo "Host $1"
echo " IdentityFile ~/.ssh/id_ed25519_$1"
) >> ~/.ssh/config
echo 'Done! Public key:'
cat ~/.ssh/id_ed25519_$1.pub
}
export DISABLE_AUTO_UPDATE=true
COMPLETION_WAITING_DOTS="true"
'';
initExtra = ''
alias mv='mv -v'
alias pre='npx prettier -w'
alias git-commit='git commit --signoff --sign'
alias npm='NODE_OPTIONS=--openssl-legacy-provider npm'
alias npx='NODE_OPTIONS=--openssl-legacy-provider npx'
alias yarn='NODE_OPTIONS=--openssl-legacy-provider npx -y yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config'
alias node='NODE_OPTIONS=--openssl-legacy-provider node'
# - dotnet
alias drun='dotnet watch run --no-hot-reload --property WarningLevel=0'
alias dbuild='dotnet watch build --no-hot-reload --property WarningLevel=0'
alias ls='lsd -lA --color=always --icon=always'
alias transfetch='neofetch --kitty ~/trans_witch.jpg'
alias gc='git-commit'
[ -f "$HOME/.profile" ] && . $HOME/.profile
'';
#alias knconfig='cp .config ../$(date ''+%Y%m%d_%k%M%S\'').config -v; make CC=clang LLVM=1 nconfig'
oh-my-zsh = {
enable = true;
plugins = [
"git"
"sudo"
];
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./Rory;
file = "p10k.zsh";
}
{
name = "zsh-syntax-highlighting";
src = pkgs.zsh-syntax-highlighting;
file = "share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh";
}
{
name = "zsh-autosuggestions";
src = pkgs.zsh-autosuggestions;
file = "share/zsh-autosuggestions/zsh-autosuggestions.zsh";
}
];
localVariables = {
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS = [
"os_icon"
"dir"
"vcs"
"prompt_char"
];
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS = [
"status"
"command_execution_time"
"background_jobs"
"direnv"
"virtualenv"
"pyenv"
"nodeenv"
"context"
"nix_shell"
"vi_mode"
"load"
"disk_usage"
"ram"
];
POWERLEVEL9K_MODE = "nerdfont-complete";
POWERLEVEL9K_ICON_PADDING = "none";
POWERLEVEL9K_PROMPT_ADD_NEWLINE = "false";
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR = "\uE0B1";
POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR = "\uE0B3";
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR = "\uE0B0";
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR = "\uE0B2";
POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL = "\uE0B0";
POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL = "\uE0B2";
POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE = true;
};
};
neovim = {
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
coc = {
enable = true;
};
};
};
programs.neovim.plugins = with pkgs.vimPlugins; [
pkgs.vimPlugins.nvim-tree-lua
{
plugin = pkgs.vimPlugins.vim-startify;
config = "let g:startify_change_to_vcs_root = 0";
}
];
home.stateVersion = "22.11";
};
}

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 KiB

View file

@ -10,9 +10,6 @@
nodejs-slim
];
#initialPassword = "password";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMd9U0+wKjBG3Q9Qg249xJY+ybYeRV9/VMPjuwKvFBEI"
];
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMd9U0+wKjBG3Q9Qg249xJY+ybYeRV9/VMPjuwKvFBEI" ];
};
}