commit 42c65b27b52fd519072d8a8e67d1bddddb32ed24 Author: Rory& Date: Fri Jul 19 03:31:44 2024 +0000 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..fddba6b --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +hardware-configuration.nix +.vscode/ +matrix-user-tokens.txt +nixpkgs/ +result +wg/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..fffe1db --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "nixpkgs"] + path = nixpkgs + url = https://github.com/TheArcaneBrony/nixpkgs.git diff --git a/README.md b/README.md new file mode 100755 index 0000000..7f4e0c5 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +`^\s?\n(\s?\n)+` -> `\n`: REPLACE ALL MULTIPLE NEWLINES \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a9a766b --- /dev/null +++ b/build.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p git nixos-install-tools nix-output-monitor +if [ $# -ne 2 ]; then + echo "Usage: $0 " + echo "NOTE: hardware config will be generated from root!" + echo "Defined configs:" + cat flake.nix | grep '.lib.nixosSystem' | sed 's/ =.*//' | sed 's/^[ \t]*//;s/[ \t]*$//' | while read cfg; do echo " - $cfg"; done + exit 1 +fi +if [ "$1" = "/" ]; then + [ -f "host/${2}/pre-rebuild.sh" ] && host/$2/pre-rebuild.sh + nixos-generate-config --show-hardware-config > hardware-configuration.nix + git add -f hardware-configuration.nix + nom build .#nixosConfigurations.${2}.config.system.build.toplevel && sudo nixos-rebuild switch --flake .#${HOSTNAME} || exit 1 + nixos-rebuild switch --flake ".#${2}" -j`nproc` --upgrade-all -L || exit 1 + [ -f "host/${2}/post-rebuild.sh" ] && host/$2/post-rebuild.sh + git rm --cached hardware-configuration.nix + exit +else + nixos-generate-config --show-hardware-config --root "${1}" > hardware-configuration.nix + git add -f hardware-configuration.nix + nix build .#nixosConfigurations.${2}.config.system.build.toplevel --extra-experimental-features nix-command --extra-experimental-features flakes || exit 1 + nixos-install --root "${1}" --flake ".#${2}" + git rm --cached hardware-configuration.nix + cp . "${1}/Rory-Open-Architecture" -r + exit +fi diff --git a/clean-old-generations.sh b/clean-old-generations.sh new file mode 100755 index 0000000..8b42df6 --- /dev/null +++ b/clean-old-generations.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +nix-collect-garbage -d +/nix/var/nix/profiles/system/bin/switch-to-configuration boot +nix-collect-garbage -d +/nix/var/nix/profiles/system/bin/switch-to-configuration boot diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..252331e Binary files /dev/null and b/flake.lock differ diff --git a/flake.nix b/flake.nix new file mode 100755 index 0000000..1d6b26d --- /dev/null +++ b/flake.nix @@ -0,0 +1,30 @@ +{ + description = "Chris' services flake"; + + inputs = { + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-unstable"; + #url="path:/Rory-Open-Architecture/nixpkgs"; + }; + 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; + }; + }; + + }; + }; +} diff --git a/host/matrix/configuration.nix b/host/matrix/configuration.nix new file mode 100755 index 0000000..a8ead39 --- /dev/null +++ b/host/matrix/configuration.nix @@ -0,0 +1,22 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ../../modules/base-server.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; + } ]; + defaultGateway.interface = "ens18"; + }; + + system.stateVersion = "22.11"; # DO NOT EDIT! +} diff --git a/host/matrix/services/matrix/coturn.nix b/host/matrix/services/matrix/coturn.nix new file mode 100755 index 0000000..427721a --- /dev/null +++ b/host/matrix/services/matrix/coturn.nix @@ -0,0 +1,53 @@ +{ config, pkgs, lib, ... }: + +{ + # coturn (WebRTC) + services.coturn = rec { + enable = false; # Alicia - figure out secret first... + no-cli = true; + no-tcp-relay = true; + min-port = 49000; + max-port = 50000; + use-auth-secret = true; + static-auth-secret = "will be world readable for local users :("; + realm = "turn.example.com"; + # Alicia - figure out how to get this to work, since nginx runs on separate machine... + #cert = "${config.security.acme.certs.${realm}.directory}/full.pem"; + #pkey = "${config.security.acme.certs.${realm}.directory}/key.pem"; + extraConfig = '' + # for debugging + verbose + # ban private IP ranges + no-multicast-peers + denied-peer-ip=0.0.0.0-0.255.255.255 + denied-peer-ip=10.0.0.0-10.255.255.255 + denied-peer-ip=100.64.0.0-100.127.255.255 + denied-peer-ip=127.0.0.0-127.255.255.255 + denied-peer-ip=169.254.0.0-169.254.255.255 + denied-peer-ip=172.16.0.0-172.31.255.255 + denied-peer-ip=192.0.0.0-192.0.0.255 + denied-peer-ip=192.0.2.0-192.0.2.255 + denied-peer-ip=192.88.99.0-192.88.99.255 + denied-peer-ip=192.168.0.0-192.168.255.255 + denied-peer-ip=198.18.0.0-198.19.255.255 + denied-peer-ip=198.51.100.0-198.51.100.255 + denied-peer-ip=203.0.113.0-203.0.113.255 + denied-peer-ip=240.0.0.0-255.255.255.255 + denied-peer-ip=::1 + denied-peer-ip=64:ff9b::-64:ff9b::ffff:ffff + denied-peer-ip=::ffff:0.0.0.0-::ffff:255.255.255.255 + denied-peer-ip=100::-100::ffff:ffff:ffff:ffff + denied-peer-ip=2001::-2001:1ff:ffff:ffff:ffff:ffff:ffff:ffff + denied-peer-ip=2002::-2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff + denied-peer-ip=fc00::-fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + denied-peer-ip=fe80::-febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff + ''; + }; + #services.matrix-synapse = with config.services.coturn; { + # turn_uris = ["turn:${realm}:3478?transport=udp" "turn:${realm}:3478?transport=tcp"]; + # turn_shared_secret = static-auth-secret; + # turn_user_lifetime = "1h"; + #}; + +} + diff --git a/host/matrix/services/matrix/draupnir.nix b/host/matrix/services/matrix/draupnir.nix new file mode 100755 index 0000000..8930f1e --- /dev/null +++ b/host/matrix/services/matrix/draupnir.nix @@ -0,0 +1,55 @@ +{ config, pkgs, lib, ... }: + +{ + # Alicia - doesnt work yet... until in nixpkgs... + services.draupnir = { + enable = true; + + pantalaimon = { + enable = true; + username = "draupnir"; + passwordFile = "/etc/draupnir-password"; + options = { + homeserver = "http://localhost:8008"; + ssl = false; + }; + }; + settings = { + managementRoom = "#draupnir-mgmt:rory.gay"; + verboseLogging = false; + recordIgnoredInvites = true; # Let's log ignored invites, just incase + autojoinOnlyIfManager = true; # Let's not open ourselves up to DoS attacks + automaticallyRedactForReasons = [ "*" ]; # I always want autoredact + fasterMembershipChecks = true; + + 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" + "harassment" + "transphobia" + "scam" + ]; + protections = { + wordlist = { + words = [ + "tranny" + "faggot" + "ywnbaw" + "nigger" + ]; + minutesBeforeTrusting = 0; + }; + }; + }; + }; + +# services.pantalaimon-headless.instances.draupnir = { +# homeserver = "http://localhost:8008"; +# ssl = false; +# }; + +} + diff --git a/host/matrix/services/matrix/root.nix b/host/matrix/services/matrix/root.nix new file mode 100755 index 0000000..a7f4063 --- /dev/null +++ b/host/matrix/services/matrix/root.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, botcore-v4, ... }: + +{ + imports = + [ + ./synapse.nix +# ./coturn.nix +# ./draupnir.nix + ]; + +} diff --git a/host/matrix/services/matrix/synapse.nix b/host/matrix/services/matrix/synapse.nix new file mode 100755 index 0000000..116e494 --- /dev/null +++ b/host/matrix/services/matrix/synapse.nix @@ -0,0 +1,216 @@ +{ config, pkgs, lib, ... }: + +{ + services.matrix-synapse = { + enable = true; + 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; + + require_membership_for_aliases = false; + redaction_retention_period = null; + user_ips_max_age = null; + allow_device_name_lookup_over_federation = true; + + federation = { + client_timeout = "60s"; + max_short_retries = 6; + max_short_retry_delay = "10s"; + max_long_retries = 5; + 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"; +# }; +# }; + + # 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 = "fuck"; + + listeners = [ + { + port = 8008; + bind_addresses = [ "127.0.0.1" ]; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ { + names = [ "client" "federation" ]; + compress = true; + } ]; + } + ]; + dynamic_thumbnails = true; + presence = { + enable = true; + update_interval = 60; + }; + url_preview_enabled = true; + database = { + name = "psycopg2"; + args = { + user = "matrix-synapse"; + #passwordFile = "/run/secrets/matrix-synapse-password"; + password = "somepassword"; + database = "matrix-synapse"; + host = "127.0.0.1"; + application_name = "matrix-synapse (liteniet.tel)"; + cp_min = 5; + cp_max = 50; + #cp_reconnect_interval = "True"; + }; + }; + app_service_config_files = [ + #"/etc/matrix-synapse/appservice-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; + + max_image_pixels = "100M"; + + ui_auth = { + session_timeout = "1m"; + }; + + login_via_existing_session = { + enabled = true; + require_ui_auth = true; + token_timeout = "1y"; + }; + + #sentry = { + # dsn = "https://77c8de07855d4e0c90dbcf0945a04f01@sentry.thearcanebrony.net/14"; + #}; + + report_stats = false; + + user_directory = { + enabled = true; + search_all_users = true; + prefer_local_users = true; + }; + + experimental_features = { + "org.matrix.msc3026.busy_presence" = true; + "fi.mau.msc2815" = true; + "org.matrix.msc3881" = true; + "org.matrix.msc3874" = true; + "org.matrix.msc3912" = true; + }; + }; + + plugins = with pkgs.matrix-synapse-plugins; [ + # Alicia - need to port draupnir... + #matrix-synapse-mjolnir-antispam +# 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 +# ''; +# }) +# ]; + }; + + 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 = '' + + 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/"; + }; + }; + +} + diff --git a/host/matrix/services/nginx/litenet.tel/matrix.nix b/host/matrix/services/nginx/litenet.tel/matrix.nix new file mode 100755 index 0000000..aa348cc --- /dev/null +++ b/host/matrix/services/nginx/litenet.tel/matrix.nix @@ -0,0 +1,59 @@ +{ + enableACME = false; + addSSL = false; + locations."/" = { + #proxyPass = "http://127.0.0.1:9001"; + proxyPass = "http://localhost:8008"; + extraConfig = '' + if ($request_method = 'OPTIONS') { + more_set_headers 'Access-Control-Allow-Origin: *'; + more_set_headers 'Access-Control-Allow-Methods: *'; + # + # Custom headers and headers various browsers *should* be OK with but aren't + # + more_set_headers 'Access-Control-Allow-Headers: *, Authorization'; + # + # Tell client that this pre-flight info is valid for 20 days + # + more_set_headers 'Access-Control-Max-Age: 1728000'; + more_set_headers 'Content-Type: text/plain; charset=utf-8'; + more_set_headers 'Content-Length: 0'; + return 204; + } + ''; + }; + + 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"; + }}'; + ''; + 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"; + } + }'; + ''; + 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"; + } + ]; + } + }'; + ''; +} diff --git a/host/matrix/services/nginx/localhost/matrix.nix b/host/matrix/services/nginx/localhost/matrix.nix new file mode 100644 index 0000000..0ab8e9a --- /dev/null +++ b/host/matrix/services/nginx/localhost/matrix.nix @@ -0,0 +1,280 @@ +{ + enableACME = false; + addSSL = false; + # locations."/_matrix" = { + # proxyPass = "http://192.168.1.5:8008"; + # extraConfig = '' + # if ($request_method = 'OPTIONS') { + # more_set_headers 'Access-Control-Allow-Origin: *'; + # more_set_headers 'Access-Control-Allow-Methods: *'; + # # + # # Custom headers and headers various browsers *should* be OK with but aren't + # # + # more_set_headers 'Access-Control-Allow-Headers: *'; + # # + # # Tell client that this pre-flight info is valid for 20 days + # # + # more_set_headers 'Access-Control-Max-Age' 1728000; + # more_set_headers 'Content-Type: text/plain; charset=utf-8'; + # more_set_headers 'Content-Length' 0; + # return 204; + # }; + # ''; + # }; + + # 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"; + }; + + # 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-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"; + }; + + # ??? + 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"; + }; + + ##### media repo + + # https://matrix-org.github.io/synapse/latest/workers.html#synapseappmedia_repository + locations."~ ^/_matrix/media/" = { + proxyPass = "http://media_repository_workers_upstream$request_uri"; + }; + locations."~ ^/_synapse/admin/v1/purge_media_cache$" = { + proxyPass = "http://media_repository_workers_upstream$request_uri"; + }; + locations."~ ^/_synapse/admin/v1/room/.*/media.*$" = { + proxyPass = "http://media_repository_workers_upstream$request_uri"; + }; + locations."~ ^/_synapse/admin/v1/user/.*/media.*$" = { + proxyPass = "http://media_repository_workers_upstream$request_uri"; + }; + locations."~ ^/_synapse/admin/v1/media/.*$" = { + proxyPass = "http://media_repository_workers_upstream$request_uri"; + }; + locations."~ ^/_synapse/admin/v1/quarantine_media/.*$" = { + proxyPass = "http://media_repository_workers_upstream$request_uri"; + }; + locations."~ ^/_synapse/admin/v1/users/.*/media$" = { + 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."/_synapse/client".proxyPass = "http://127.0.0.1:8008"; +} diff --git a/host/matrix/services/nginx/matrix-upstreams-workers.nix b/host/matrix/services/nginx/matrix-upstreams-workers.nix new file mode 100644 index 0000000..00ccdee --- /dev/null +++ b/host/matrix/services/nginx/matrix-upstreams-workers.nix @@ -0,0 +1,26 @@ +{ + generic_workers_upstream.servers = { + "127.0.0.1:18111" = { }; + }; + stream_writer_typing_stream_workers_upstream.servers = { + "127.0.0.1:20012" = { }; + }; + stream_writer_to_device_stream_workers_upstream.servers = { + "127.0.0.1:20013" = { }; + }; + stream_writer_account_data_stream_workers_upstream.servers = { + "127.0.0.1:20014" = { }; + }; + stream_writer_receipts_stream_workers_upstream.servers = { + "127.0.0.1:20015" = { }; + }; + stream_writer_presence_stream_workers_upstream.servers = { + "127.0.0.1:20016" = { }; + }; + media_repository_workers_upstream.servers = { + "127.0.0.1:18551" = { }; + }; + user_dir_workers_upstream.servers = { + "127.0.0.1:18661" = { }; + }; +} \ No newline at end of file diff --git a/host/matrix/services/nginx/matrix-upstreams.nix b/host/matrix/services/nginx/matrix-upstreams.nix new file mode 100644 index 0000000..6ba45af --- /dev/null +++ b/host/matrix/services/nginx/matrix-upstreams.nix @@ -0,0 +1,26 @@ +{ + generic_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; + stream_writer_typing_stream_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; + stream_writer_to_device_stream_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; + stream_writer_account_data_stream_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; + stream_writer_receipts_stream_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; + stream_writer_presence_stream_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; + media_repository_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; + user_dir_workers_upstream.servers = { + "127.0.0.1:8008" = { }; + }; +} \ No newline at end of file diff --git a/host/matrix/services/nginx/nginx.nix b/host/matrix/services/nginx/nginx.nix new file mode 100755 index 0000000..e8d7fdd --- /dev/null +++ b/host/matrix/services/nginx/nginx.nix @@ -0,0 +1,48 @@ +{ config, pkgs, lib, ... }: + +{ + services = { + nginx = { + enable = true; + package = pkgs.nginxQuic; + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedZstdSettings = true; + recommendedGzipSettings = true; + recommendedBrotliSettings = true; + recommendedOptimisation = true; + defaultMimeTypes = ../../../../modules/packages/nginx/mime.types; + appendConfig = '' + worker_processes 16; + ''; + eventsConfig = '' + #use kqueue; + worker_connections 512; + ''; + appendHttpConfig = '' + #sendfile on; + disable_symlinks off; + ''; + upstreams = import ./matrix-upstreams.nix; + additionalModules = with pkgs.nginxModules; [ + moreheaders + ]; + virtualHosts = { + #matrix... + "matrix.litenet.tel" = import ./litenet.tel/matrix.nix; + "matrix.localhost" = import ./localhost/matrix.nix; + }; + }; + }; + systemd.services.nginx.serviceConfig = { + LimitNOFILE=5000000; + }; +# systemd.services.nginx.requires = [ "data.mount" ]; +# security.acme.acceptTerms = true; +# security.acme.defaults.email = "root@thearcanebrony.net"; + +# environment.systemPackages = with pkgs; [ + #gitfs +# ]; + +} diff --git a/host/matrix/services/postgres.nix b/host/matrix/services/postgres.nix new file mode 100755 index 0000000..5d2e39a --- /dev/null +++ b/host/matrix/services/postgres.nix @@ -0,0 +1,83 @@ +{ config, pkgs, lib, ... }: + +{ + systemd.tmpfiles.rules = [ "d /mnt/postgres/data 0750 postgres postgres" ]; + + services.postgresql = { + enable = true; + package = pkgs.postgresql_16; + enableTCPIP = true; + authentication = pkgs.lib.mkOverride 10 '' + # TYPE, DATABASE, USER, ADDRESS, METHOD + local all all trust + host all all 127.0.0.1/32 trust + host all all ::1/128 trust + host matrix-synapse matrix-synapse 127.0.0.1/32 trust + host all all 0.0.0.0/0 md5 + ''; + # initialScript = pkgs.writeText "backend-initScript" '' + # CREATE ROLE nixcloud WITH LOGIN PASSWORD 'nixcloud' CREATEDB; + # CREATE DATABASE nixcloud; + # GRANT ALL PRIVILEGES ON DATABASE nixcloud TO nixcloud; + # ''; + dataDir = "/mnt/postgres/data"; + settings = { + # https://pgconfigurator.cybertec.at/ + 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; + + # 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 + + # 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 + +# 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"; + +# 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"; + + }; + }; + +} + diff --git a/modules/base-server.nix b/modules/base-server.nix new file mode 100755 index 0000000..e57de83 --- /dev/null +++ b/modules/base-server.nix @@ -0,0 +1,94 @@ +{ config, pkgs, lib, ... }: + +{ + 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" ]; + + 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"; + }; + + sleep.extraConfig = '' + AllowSuspend=no + AllowHibernation=no + ''; + }; + + 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; + nix.settings.max-free = lib.mkDefault (1000 * 1000 * 1000); + nix.settings.min-free = lib.mkDefault (128 * 1000 * 1000); + + nix.daemonCPUSchedPolicy = lib.mkDefault "batch"; + nix.daemonIOSchedClass = lib.mkDefault "idle"; + nix.daemonIOSchedPriority = lib.mkDefault 7; + + # My servers always use /dev/vda as boot disk... + boot = { + kernelPackages = pkgs.linuxPackages_latest; + loader = { + grub = { + devices = [ "/dev/vda" ]; # nodev for EFI only + # EFI + efiSupport = false; + efiInstallAsRemovable = false; + }; + timeout = 1; + }; + }; + + networking = { + hostName = lib.mkDefault "Rory-nix-base-server"; + networkmanager.enable = false; + useNetworkd = true; + wireless.enable = false; + enableIPv6 = false; + firewall = { + enable = false; + # allowedTCPPorts = [ ... ]; + # allowedUDPPorts = [ ... ]; + }; + + 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" ]; + defaultGateway = "10.0.0.1"; + }; + + hardware.pulseaudio.enable = false; + + i18n.defaultLocale = "en_US.UTF-8"; +} + diff --git a/modules/base.nix b/modules/base.nix new file mode 100755 index 0000000..e2d8c7e --- /dev/null +++ b/modules/base.nix @@ -0,0 +1,145 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./packages/vim.nix + ./users/Rory.nix + ]; + + boot = { + initrd.systemd.enable = true; + kernelParams = [ + "memory_hotplug.memmap_on_memory=1" + "memhp_default_state=online" + "net.core.default_qdisc=fq" + "net.ipv4.tcp_congestion_control=bbr" + "mitigations=off" + "audit=0" + "consoleblank=0" + "kmemcheck=0" + "no_console_suspend" + "kernel.core_pattern=/dev/null" + "init_on_alloc=0" + "kernel.sysrq=1" + "kernel.dmesg_restrict=0" + "net.ipv4.ip_forward=1" + "vm.swappiness=10" + "net.core.netdev_max_backlog=16384" + "net.core.somaxconn=8192" + "net.core.rmem_default=1048576" + "net.core.rmem_max=16777216" + "net.core.wmem_default=1048576" + "net.core.wmem_max=16777216" + "net.core.optmem_max=65536" + #"net.ipv4.tcp_rmem=4096 1048576 2097152" + #"net.ipv4.tcp_wmem=4096 65536 16777216" + "net.ipv4.udp_rmem_min=4096" + "net.ipv4.udp_wmem_min=4096" + "net.ipv4.tcp_fastopen=3" + "net.ipv4.tcp_mtu_probing=1" + "net.ipv4.tcp_keepalive_time=30" + "net.ipv4.tcp_keepalive_intvl=15" + "net.ipv4.tcp_keepalive_probes=4" + "net.ipv4.tcp_timestamps=0" + ]; + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + loader = { + grub = { + enable = true; + version = 2; + }; + timeout = 1; + }; + }; + + networking = { + hostName = lib.mkDefault "Rory-nix-base"; + firewall = { + enable = false; + # allowedTCPPorts = [ ... ]; + # allowedUDPPorts = [ ... ]; + }; + nameservers = [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ]; + }; + + i18n.defaultLocale = "en_US.UTF-8"; + + services = { + openssh = { + enable = true; + #allow more logins in cases where i have many ssh keys on a system + extraConfig = '' + MaxAuthTries 32 + ''; + }; + resolved = { + enable = true; + dnssec = lib.mkForce "false"; + dnsovertls = lib.mkForce "false"; + }; + }; + + systemd = { + sleep.extraConfig = '' + AllowSuspend=no + AllowHibernation=no + ''; + }; + + environment.systemPackages = with pkgs; [ + wget + neofetch + lnav + pciutils + git + lsd + duf + htop + btop + duf + kitty.terminfo + tmux + jq + yq + pv + dig + cloud-utils + nix-output-monitor + expect + unrar-wrapper + arch-install-scripts + debootstrap + file + unzip + brotli + + + # - zsh + zsh + zsh-powerlevel10k + zsh-nix-shell + zsh-you-should-use + zsh-syntax-highlighting + zsh-completions + ]; + + systemd.coredump.extraConfig = lib.mkDefault '' + Storage=none + ''; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + trusted-users = [ "@wheel" ]; + }; + }; + nixpkgs = { + config.allowUnfree = true; + }; + security = { + polkit.enable = true; + sudo.wheelNeedsPassword = false; + }; + +} diff --git a/modules/packages/nginx/mime.types b/modules/packages/nginx/mime.types new file mode 100644 index 0000000..3ac8468 --- /dev/null +++ b/modules/packages/nginx/mime.types @@ -0,0 +1,1028 @@ +types { +application/A2L a2l; +application/AML aml; +application/andrew-inset ez; +application/ATF atf; +application/ATFX atfx; +application/ATXML atxml; +application/atom+xml atom; +application/atomcat+xml atomcat; +application/atomdeleted+xml atomdeleted; +application/atomsvc+xml atomsvc; +application/atsc-dwd+xml dwd; +application/atsc-held+xml held; +application/atsc-rsat+xml rsat; +application/auth-policy+xml apxml; +application/bacnet-xdd+zip xdd; +application/calendar+xml xcs; +application/cbor cbor; +application/cccex c3ex; +application/ccmp+xml ccmp; +application/ccxml+xml ccxml; +application/CDFX+XML cdfx; +application/cdmi-capability cdmia; +application/cdmi-container cdmic; +application/cdmi-domain cdmid; +application/cdmi-object cdmio; +application/cdmi-queue cdmiq; +application/CEA cea; +application/cellml+xml cellml cml; +application/clr 1clr; +application/clue_info+xml clue; +application/cms cmsc; +application/cpl+xml cpl; +application/csrattrs csrattrs; +application/dash+xml mpd; +application/dashdelta mpdd; +application/davmount+xml davmount; +application/DCD dcd; +application/dicom dcm; +application/DII dii; +application/DIT dit; +application/dskpp+xml xmls; +application/dssc+der dssc; +application/dssc+xml xdssc; +application/dvcs dvc; +application/ecmascript es; +application/efi efi; +application/emma+xml emma; +application/emotionml+xml emotionml; +application/epub+zip epub; +application/exi exi; +application/fastinfoset finf; +application/fdt+xml fdt; +application/font-tdpfr pfr; +application/geo+json geojson; +application/geopackage+sqlite3 gpkg; +application/gltf-buffer glbin glbuf; +application/gml+xml gml; +application/gzip gz tgz; +application/hyperstudio stk; +application/inkml+xml ink inkml; +application/ipfix ipfix; +application/its+xml its; +application/javascript js; +application/jrd+json jrd; +application/json json; +application/json-patch+json json-patch; +application/ld+json jsonld; +application/lgr+xml lgr; +application/link-format wlnk; +application/lost+xml lostxml; +application/lostsync+xml lostsyncxml; +application/lpf+zip lpf; +application/LXF lxf; +application/mac-binhex40 hqx; +application/mads+xml mads; +application/marc mrc; +application/marcxml+xml mrcx; +application/mathematica nb ma mb; +application/mathml+xml mml; +application/mbox mbox; +application/metalink4+xml meta4; +application/mets+xml mets; +application/MF4 mf4; +application/mipc h5; +application/mmt-aei+xml maei; +application/mmt-usd+xml musd; +application/mods+xml mods; +application/mp21 m21 mp21; +application/msword doc; +application/mxf mxf; +application/n-quads nq; +application/n-triples nt; +application/ocsp-request orq; +application/ocsp-response ors; +application/octet-stream bin lha lzh exe class so dll img iso; +application/ODA oda; +application/ODX odx; +application/oebps-package+xml opf; +application/ogg ogx; +application/opc-nodeset+xml ; +application/oxps oxps; +application/p2p-overlay+xml relo; +application/pdf pdf; +application/PDX pdx; +application/pem-certificate-chain pem; +application/pgp-encrypted pgp; +application/pgp-signature sig; +application/pkcs10 p10; +application/pkcs12 p12 pfx; +application/pkcs7-mime p7m p7c; +application/pkcs7-signature p7s; +application/pkcs8 p8; +application/pkcs8-encrypted p8e; +application/pkix-cert cer; +application/pkix-crl crl; +application/pkix-pkipath pkipath; +application/pkixcmp pki; +application/pls+xml pls; +application/postscript ps eps ai; +application/provenance+xml provx; +application/prs.cww cw cww; +application/prs.hpub+zip hpub; +application/prs.nprend rnd rct; +application/prs.rdf-xml-crypt rdf-crypt; +application/prs.xsf+xml xsf; +application/pskc+xml pskcxml; +application/rdf+xml rdf; +application/route-apd+xml rapd; +application/route-s-tsid+xml sls; +application/route-usd+xml rusd; +application/reginfo+xml rif; +application/relax-ng-compact-syntax rnc; +application/resource-lists-diff+xml rld; +application/resource-lists+xml rl; +application/rfc+xml rfcxml; +application/rls-services+xml rs; +application/rpki-ghostbusters gbr; +application/rpki-manifest mft; +application/rpki-roa roa; +application/rtf rtf; +application/sarif-external-properties+json sarif-external-properties sarif-external-properties.json; +application/sarif+json sarif sarif.json; +application/scim+json scim; +application/scvp-cv-request scq; +application/scvp-cv-response scs; +application/scvp-vp-request spq; +application/scvp-vp-response spp; +application/sdp sdp; +application/senml-etch+cbor senml-etchc; +application/senml-etch+json senml-etchj; +application/senml+cbor senmlc; +application/senml+json senml; +application/senml+xml senmlx; +application/senml-exi senmle; +application/sensml+cbor sensmlc; +application/sensml+json sensml; +application/sensml+xml sensmlx; +application/sensml-exi sensmle; +application/sgml-open-catalog soc; +application/shf+xml shf; +application/sieve siv sieve; +application/simple-filter+xml cl; +application/smil+xml smil smi sml; +application/sparql-query rq; +application/sparql-results+xml srx; +application/sql sql; +application/srgs gram; +application/srgs+xml grxml; +application/sru+xml sru; +application/ssml+xml ssml; +application/stix+json stix; +application/swid+xml swidtag; +application/tamp-apex-update tau; +application/tamp-apex-update-confirm auc; +application/tamp-community-update tcu; +application/tamp-community-update-confirm cuc; +application/td+json jsontd; +application/tamp-error ter; +application/tamp-sequence-adjust tsa; +application/tamp-sequence-adjust-confirm sac; +application/tamp-update tur; +application/tamp-update-confirm tuc; +application/tei+xml tei teiCorpus odd; +application/thraud+xml tfi; +application/timestamp-query tsq; +application/timestamp-reply tsr; +application/timestamped-data tsd; +application/trig trig; +application/ttml+xml ttml; +application/urc-grpsheet+xml gsheet; +application/urc-ressheet+xml rsheet; +application/urc-targetdesc+xml td; +application/urc-uisocketdesc+xml uis; +application/vnd.1000minds.decision-model+xml 1km; +application/vnd.3gpp.5gnas ; +application/vnd.3gpp.pic-bw-large plb; +application/vnd.3gpp.pic-bw-small psb; +application/vnd.3gpp.pic-bw-var pvb; +application/vnd.3gpp2.sms sms; +application/vnd.3gpp2.tcap tcap; +application/vnd.3lightssoftware.imagescal imgcal; +application/vnd.3M.Post-it-Notes pwn; +application/vnd.accpac.simply.aso aso; +application/vnd.accpac.simply.imp imp; +application/vnd.acucobol acu; +application/vnd.acucorp atc acutc; +application/vnd.adobe.flash.movie swf; +application/vnd.adobe.formscentral.fcdt fcdt; +application/vnd.adobe.fxp fxp fxpl; +application/vnd.adobe.xdp+xml xdp; +application/vnd.adobe.xfdf xfdf; +application/vnd.afpc.modca list3820 listafp afp pseg3820; +application/vnd.afpc.modca-overlay ovl; +application/vnd.afpc.modca-pagesegment psg; +application/vnd.ahead.space ahead; +application/vnd.airzip.filesecure.azf azf; +application/vnd.airzip.filesecure.azs azs; +application/vnd.amazon.mobi8-ebook azw3; +application/vnd.americandynamics.acc acc; +application/vnd.amiga.ami ami; +application/vnd.android.ota ota; +application/vnd.anki apkg; +application/vnd.anser-web-certificate-issue-initiation cii; +application/vnd.anser-web-funds-transfer-initiation fti; +application/vnd.apple.installer+xml dist distz pkg mpkg; +application/vnd.apple.keynote keynote; +application/vnd.apple.mpegurl m3u8; +application/vnd.apple.numbers numbers; +application/vnd.apple.pages pages; +application/vnd.aristanetworks.swi swi; +application/vnd.artisan+json artisan; +application/vnd.astraea-software.iota iota; +application/vnd.audiograph aep; +application/vnd.autopackage package; +application/vnd.balsamiq.bmml+xml bmml; +application/vnd.banana-accounting ac2; +application/vnd.balsamiq.bmpr bmpr; +application/vnd.blueice.multipass mpm; +application/vnd.bluetooth.ep.oob ep; +application/vnd.bluetooth.le.oob le; +application/vnd.bmi bmi; +application/vnd.businessobjects rep; +application/vnd.cendio.thinlinc.clientconf tlclient; +application/vnd.chemdraw+xml cdxml; +application/vnd.chess-pgn pgn; +application/vnd.chipnuts.karaoke-mmd mmd; +application/vnd.cinderella cdy; +application/vnd.citationstyles.style+xml csl; +application/vnd.claymore cla; +application/vnd.cloanto.rp9 rp9; +application/vnd.clonk.c4group c4g c4d c4f c4p c4u; +application/vnd.cluetrust.cartomobile-config c11amc; +application/vnd.cluetrust.cartomobile-config-pkg c11amz; +application/vnd.coffeescript coffee; +application/vnd.collabio.xodocuments.document xodt; +application/vnd.collabio.xodocuments.document-template xott; +application/vnd.collabio.xodocuments.presentation xodp; +application/vnd.collabio.xodocuments.presentation-template xotp; +application/vnd.collabio.xodocuments.spreadsheet xods; +application/vnd.collabio.xodocuments.spreadsheet-template xots; +application/vnd.comicbook-rar cbr; +application/vnd.comicbook+zip cbz; +application/vnd.commerce-battelle ica icf icd ic0 ic1 ic2 ic3 ic4 ic5 ic6 ic7 ic8; +application/vnd.commonspace csp cst; +application/vnd.contact.cmsg cdbcmsg; +application/vnd.coreos.ignition+json ign ignition; +application/vnd.cosmocaller cmc; +application/vnd.crick.clicker clkx; +application/vnd.crick.clicker.keyboard clkk; +application/vnd.crick.clicker.palette clkp; +application/vnd.crick.clicker.template clkt; +application/vnd.crick.clicker.wordbank clkw; +application/vnd.criticaltools.wbs+xml wbs; +application/vnd.crypto-shade-file ssvc; +application/vnd.cryptomator.encrypted c9r c9s; +application/vnd.cryptomator.vault cryptomator; +application/vnd.ctc-posml pml; +application/vnd.cups-ppd ppd; +application/vnd.curl curl; +application/vnd.dart dart; +application/vnd.data-vision.rdz rdz; +application/vnd.dbf dbf; +application/vnd.debian.binary-package deb udeb; +application/vnd.dece.data uvf uvvf uvd uvvd; +application/vnd.dece.ttml+xml uvt uvvt; +application/vnd.dece.unspecified uvx uvvx; +application/vnd.dece.zip uvz uvvz; +application/vnd.denovo.fcselayout-link fe_launch; +application/vnd.desmume.movie dsm; +application/vnd.dna dna; +application/vnd.document+json docjson; +application/vnd.doremir.scorecloud-binary-document scld; +application/vnd.dpgraph dpg mwc dpgraph; +application/vnd.dreamfactory dfac; +application/vnd.dtg.local.flash fla; +application/vnd.dvb.ait ait; +application/vnd.dvb.service svc; +application/vnd.dynageo geo; +application/vnd.dzr dzr; +application/vnd.ecowin.chart mag; +application/vnd.enliven nml; +application/vnd.epson.esf esf; +application/vnd.epson.msf msf; +application/vnd.epson.quickanime qam; +application/vnd.epson.salt slt; +application/vnd.epson.ssf ssf; +application/vnd.ericsson.quickcall qcall qca; +application/vnd.espass-espass+zip espass; +application/vnd.eszigno3+xml es3 et3; +application/vnd.etsi.asic-e+zip asice sce; +application/vnd.etsi.asic-s+zip asics; +application/vnd.etsi.timestamp-token tst; +application/vnd.exstream-empower+zip mpw; +application/vnd.exstream-package pub; +application/vnd.evolv.ecig.profile ecigprofile; +application/vnd.evolv.ecig.settings ecig; +application/vnd.evolv.ecig.theme ecigtheme; +application/vnd.ezpix-album ez2; +application/vnd.ezpix-package ez3; +application/vnd.fastcopy-disk-image dim; +application/vnd.fdf fdf; +application/vnd.fdsn.mseed msd mseed; +application/vnd.fdsn.seed seed dataless; +application/vnd.ficlab.flb+zip flb; +application/vnd.filmit.zfc zfc; +application/vnd.FloGraphIt gph; +application/vnd.fluxtime.clip ftc; +application/vnd.font-fontforge-sfd sfd; +application/vnd.framemaker fm; +application/vnd.frogans.fnc fnc; +application/vnd.frogans.ltf ltf; +application/vnd.fsc.weblaunch fsc; +application/vnd.fujitsu.oasys oas; +application/vnd.fujitsu.oasys2 oa2; +application/vnd.fujitsu.oasys3 oa3; +application/vnd.fujitsu.oasysgp fg5; +application/vnd.fujitsu.oasysprs bh2; +application/vnd.fujixerox.ddd ddd; +application/vnd.fujixerox.docuworks xdw; +application/vnd.fujixerox.docuworks.binder xbd; +application/vnd.fujixerox.docuworks.container xct; +application/vnd.fuzzysheet fzs; +application/vnd.genomatix.tuxedo txd; +application/vnd.geocube+xml g3 g³; +application/vnd.geogebra.file ggb; +application/vnd.geogebra.slides ggs; +application/vnd.geogebra.tool ggt; +application/vnd.geometry-explorer gex gre; +application/vnd.geonext gxt; +application/vnd.geoplan g2w; +application/vnd.geospace g3w; +application/vnd.gmx gmx; +application/vnd.google-earth.kml+xml kml; +application/vnd.google-earth.kmz kmz; +application/vnd.grafeq gqf gqs; +application/vnd.groove-account gac; +application/vnd.groove-help ghf; +application/vnd.groove-identity-message gim; +application/vnd.groove-injector grv; +application/vnd.groove-tool-message gtm; +application/vnd.groove-tool-template tpl; +application/vnd.groove-vcard vcg; +application/vnd.hal+xml hal; +application/vnd.HandHeld-Entertainment+xml zmm; +application/vnd.hbci hbci hbc kom upa pkd bpd; +application/vnd.hdt hdt; +application/vnd.hhe.lesson-player les; +application/vnd.hp-HPGL hpgl; +application/vnd.hp-hpid hpi hpid; +application/vnd.hp-hps hps; +application/vnd.hp-jlyt jlt; +application/vnd.hp-PCL pcl; +application/vnd.hydrostatix.sof-data sfd-hdstx; +application/vnd.hzn-3d-crossword x3d; +application/vnd.ibm.electronic-media emm; +application/vnd.ibm.MiniPay mpy; +application/vnd.ibm.rights-management irm; +application/vnd.ibm.secure-container sc; +application/vnd.iccprofile icc icm; +application/vnd.ieee.1905 1905.1; +application/vnd.igloader igl; +application/vnd.imagemeter.folder+zip imf; +application/vnd.imagemeter.image+zip imi; +application/vnd.immervision-ivp ivp; +application/vnd.immervision-ivu ivu; +application/vnd.ims.imsccv1p1 imscc; +application/vnd.insors.igm igm; +application/vnd.intercon.formnet xpw xpx; +application/vnd.intergeo i2g; +application/vnd.intu.qbo qbo; +application/vnd.intu.qfx qfx; +application/vnd.ipunplugged.rcprofile rcprofile; +application/vnd.irepository.package+xml irp; +application/vnd.is-xpr xpr; +application/vnd.isac.fcs fcs; +application/vnd.jam jam; +application/vnd.jcp.javame.midlet-rms rms; +application/vnd.jisp jisp; +application/vnd.joost.joda-archive joda; +application/vnd.kahootz ktz ktr; +application/vnd.kde.karbon karbon; +application/vnd.kde.kchart chrt; +application/vnd.kde.kformula kfo; +application/vnd.kde.kivio flw; +application/vnd.kde.kontour kon; +application/vnd.kde.kpresenter kpr kpt; +application/vnd.kde.kspread ksp; +application/vnd.kde.kword kwd kwt; +application/vnd.kenameaapp htke; +application/vnd.kidspiration kia; +application/vnd.Kinar kne knp sdf; +application/vnd.koan skp skd skm skt; +application/vnd.kodak-descriptor sse; +application/vnd.las las; +application/vnd.las.las+json lasjson; +application/vnd.las.las+xml lasxml; +application/vnd.llamagraphics.life-balance.desktop lbd; +application/vnd.llamagraphics.life-balance.exchange+xml lbe; +application/vnd.logipipe.circuit+zip lcs lca; +application/vnd.loom loom; +application/vnd.lotus-1-2-3 123 wk4 wk3 wk1; +application/vnd.lotus-approach apr vew; +application/vnd.lotus-freelance prz pre; +application/vnd.lotus-notes nsf ntf ndl ns4 ns3 ns2 nsh nsg; +application/vnd.lotus-organizer or3 or2 org; +application/vnd.lotus-screencam scm; +application/vnd.lotus-wordpro lwp sam; +application/vnd.macports.portpkg portpkg; +application/vnd.mapbox-vector-tile mvt; +application/vnd.marlin.drm.mdcf mdc; +application/vnd.maxmind.maxmind-db mmdb; +application/vnd.mcd mcd; +application/vnd.medcalcdata mc1; +application/vnd.mediastation.cdkey cdkey; +application/vnd.MFER mwf; +application/vnd.mfmp mfm; +application/vnd.micrografx.flo flo; +application/vnd.micrografx.igx igx; +application/vnd.mif mif; +application/vnd.Mobius.DAF daf; +application/vnd.Mobius.DIS dis; +application/vnd.Mobius.MBK mbk; +application/vnd.Mobius.MQY mqy; +application/vnd.Mobius.MSL msl; +application/vnd.Mobius.PLC plc; +application/vnd.Mobius.TXF txf; +application/vnd.mophun.application mpn; +application/vnd.mophun.certificate mpc; +application/vnd.mozilla.xul+xml xul; +application/vnd.ms-3mfdocument 3mf; +application/vnd.ms-artgalry cil; +application/vnd.ms-asf asf; +application/vnd.ms-cab-compressed cab; +application/vnd.ms-excel xls xlm xla xlc xlt xlw; +application/vnd.ms-excel.template.macroEnabled.12 xltm; +application/vnd.ms-excel.addin.macroEnabled.12 xlam; +application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb; +application/vnd.ms-excel.sheet.macroEnabled.12 xlsm; +application/vnd.ms-fontobject eot; +application/vnd.ms-htmlhelp chm; +application/vnd.ms-ims ims; +application/vnd.ms-lrm lrm; +application/vnd.ms-officetheme thmx; +application/vnd.ms-powerpoint ppt pps pot; +application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam; +application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm; +application/vnd.ms-powerpoint.slide.macroEnabled.12 sldm; +application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm; +application/vnd.ms-powerpoint.template.macroEnabled.12 potm; +application/vnd.ms-project mpp mpt; +application/vnd.ms-tnef tnef tnf; +application/vnd.ms-word.document.macroEnabled.12 docm; +application/vnd.ms-word.template.macroEnabled.12 dotm; +application/vnd.ms-works wcm wdb wks wps; +application/vnd.ms-wpl wpl; +application/vnd.ms-xpsdocument xps; +application/vnd.msa-disk-image msa; +application/vnd.mseq mseq; +application/vnd.multiad.creator crtr; +application/vnd.multiad.creator.cif cif; +application/vnd.musician mus; +application/vnd.muvee.style msty; +application/vnd.mynfc taglet; +application/vnd.nebumind.line nebul line; +application/vnd.nervana entity request bkm kcm; +application/vnd.nimn nimn; +application/vnd.nitf nitf; +application/vnd.neurolanguage.nlu nlu; +application/vnd.nintendo.nitro.rom nds; +application/vnd.nintendo.snes.rom sfc smc; +application/vnd.noblenet-directory nnd; +application/vnd.noblenet-sealer nns; +application/vnd.noblenet-web nnw; +application/vnd.nokia.n-gage.ac+xml ac; +application/vnd.nokia.n-gage.data ngdat; +application/vnd.nokia.n-gage.symbian.install n-gage; +application/vnd.nokia.radio-preset rpst; +application/vnd.nokia.radio-presets rpss; +application/vnd.novadigm.EDM edm; +application/vnd.novadigm.EDX edx; +application/vnd.novadigm.EXT ext; +application/vnd.oasis.opendocument.chart odc; +application/vnd.oasis.opendocument.chart-template otc; +application/vnd.oasis.opendocument.database odb; +application/vnd.oasis.opendocument.formula odf; +application/vnd.oasis.opendocument.graphics odg; +application/vnd.oasis.opendocument.graphics-template otg; +application/vnd.oasis.opendocument.image odi; +application/vnd.oasis.opendocument.image-template oti; +application/vnd.oasis.opendocument.presentation odp; +application/vnd.oasis.opendocument.presentation-template otp; +application/vnd.oasis.opendocument.spreadsheet ods; +application/vnd.oasis.opendocument.spreadsheet-template ots; +application/vnd.oasis.opendocument.text odt; +application/vnd.oasis.opendocument.text-master odm; +application/vnd.oasis.opendocument.text-template ott; +application/vnd.oasis.opendocument.text-web oth; +application/vnd.olpc-sugar xo; +application/vnd.oma.dd2+xml dd2; +application/vnd.onepager tam; +application/vnd.onepagertamp tamp; +application/vnd.onepagertamx tamx; +application/vnd.onepagertat tat; +application/vnd.onepagertatp tatp; +application/vnd.onepagertatx tatx; +application/vnd.openblox.game+xml obgx; +application/vnd.openblox.game-binary obg; +application/vnd.openeye.oeb oeb; +application/vnd.openofficeorg.extension oxt; +application/vnd.openstreetmap.data+xml osm; +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; +application/vnd.openxmlformats-officedocument.presentationml.slide sldx; +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx; +application/vnd.openxmlformats-officedocument.presentationml.template potx; +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx; +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx; +application/vnd.osa.netdeploy ndc; +application/vnd.osgeo.mapguide.package mgp; +application/vnd.osgi.dp dp; +application/vnd.osgi.subsystem esa; +application/vnd.oxli.countgraph oxlicg; +application/vnd.palm prc pdb pqa oprc; +application/vnd.panoply plp; +application/vnd.patentdive dive; +application/vnd.pawaafile paw; +application/vnd.pg.format str; +application/vnd.pg.osasli ei6; +application/vnd.piaccess.application-licence pil; +application/vnd.picsel efif; +application/vnd.pmi.widget wg; +application/vnd.pocketlearn plf; +application/vnd.powerbuilder6 pbd; +application/vnd.preminet preminet; +application/vnd.previewsystems.box box vbox; +application/vnd.proteus.magazine mgz; +application/vnd.psfs psfs; +application/vnd.publishare-delta-tree qps; +application/vnd.pvi.ptid1 ptid; +application/vnd.qualcomm.brew-app-res bar; +application/vnd.Quark.QuarkXPress qxd qxt qwd qwt qxl qxb; +application/vnd.quobject-quoxdocument quox quiz; +application/vnd.rainstor.data tree; +application/vnd.rar rar; +application/vnd.realvnc.bed bed; +application/vnd.recordare.musicxml mxl; +application/vnd.rig.cryptonote cryptonote; +application/vnd.route66.link66+xml link66; +application/vnd.sailingtracker.track st; +application/vnd.sar SAR; +application/vnd.scribus scd sla slaz; +application/vnd.sealed.3df s3df; +application/vnd.sealed.csf scsf; +application/vnd.sealed.doc sdoc sdo s1w; +application/vnd.sealed.eml seml sem; +application/vnd.sealed.mht smht smh; +application/vnd.sealed.ppt sppt s1p; +application/vnd.sealed.tiff stif; +application/vnd.sealed.xls sxls sxl s1e; +application/vnd.sealedmedia.softseal.html stml s1h; +application/vnd.sealedmedia.softseal.pdf spdf spd s1a; +application/vnd.seemail see; +application/vnd.sema sema; +application/vnd.semd semd; +application/vnd.semf semf; +application/vnd.shade-save-file ssv; +application/vnd.shana.informed.formdata ifm; +application/vnd.shana.informed.formtemplate itp; +application/vnd.shana.informed.interchange iif; +application/vnd.shana.informed.package ipk; +application/vnd.shp shp; +application/vnd.shx shx; +application/vnd.sigrok.session sr; +application/vnd.SimTech-MindMapper twd twds; +application/vnd.smaf mmf; +application/vnd.smart.notebook notebook; +application/vnd.smart.teacher teacher; +application/vnd.snesdev-page-table ptrom pt; +application/vnd.software602.filler.form+xml fo; +application/vnd.software602.filler.form-xml-zip zfo; +application/vnd.solent.sdkm+xml sdkm sdkd; +application/vnd.spotfire.dxp dxp; +application/vnd.spotfire.sfs sfs; +application/vnd.sqlite3 sqlite sqlite3; +application/vnd.stepmania.package smzip; +application/vnd.stepmania.stepchart sm; +application/vnd.sun.wadl+xml wadl; +application/vnd.sus-calendar sus susp; +application/vnd.sycle+xml scl; +application/vnd.syncml+xml xsm; +application/vnd.syncml.dm+wbxml bdm; +application/vnd.syncml.dm+xml xdm; +application/vnd.syncml.dmddf+xml ddf; +application/vnd.tao.intent-module-archive tao; +application/vnd.tcpdump.pcap pcap cap dmp; +application/vnd.theqvd qvd; +application/vnd.think-cell.ppttc+json ppttc; +application/vnd.tml vfr viaframe; +application/vnd.tmobile-livetv tmo; +application/vnd.trid.tpt tpt; +application/vnd.triscape.mxs mxs; +application/vnd.trueapp tra; +application/vnd.ufdl ufdl ufd frm; +application/vnd.uiq.theme utz; +application/vnd.umajin umj; +application/vnd.unity unityweb; +application/vnd.uoml+xml uoml uo; +application/vnd.uri-map urim urimap; +application/vnd.valve.source.material vmt; +application/vnd.vcx vcx; +application/vnd.vd-study mxi study-inter model-inter; +application/vnd.vectorworks vwx; +application/vnd.veryant.thin istc isws; +application/vnd.ves.encrypted VES; +application/vnd.vidsoft.vidconference vsc; +application/vnd.visio vsd vst vsw vss; +application/vnd.visionary vis; +application/vnd.vsf vsf; +application/vnd.wap.sic sic; +application/vnd.wap.slc slc; +application/vnd.wap.wbxml wbxml; +application/vnd.wap.wmlc wmlc; +application/vnd.wap.wmlscriptc wmlsc; +application/vnd.webturbo wtb; +application/vnd.wfa.p2p p2p; +application/vnd.wfa.wsc wsc; +application/vnd.wmc wmc; +application/vnd.wolfram.mathematica.package m; +application/vnd.wolfram.player nbp; +application/vnd.wordperfect wpd; +application/vnd.wqd wqd; +application/vnd.wt.stf stf; +application/vnd.wv.csp+wbxml wv; +application/vnd.xara xar; +application/vnd.xfdl xfdl xfd; +application/vnd.xmpie.cpkg cpkg; +application/vnd.xmpie.dpkg dpkg; +application/vnd.xmpie.ppkg ppkg; +application/vnd.xmpie.xlim xlim; +application/vnd.yamaha.hv-dic hvd; +application/vnd.yamaha.hv-script hvs; +application/vnd.yamaha.hv-voice hvp; +application/vnd.yamaha.openscoreformat osf; +application/vnd.yamaha.smaf-audio saf; +application/vnd.yamaha.smaf-phrase spf; +application/vnd.yaoweme yme; +application/vnd.yellowriver-custom-menu cmp; +application/vnd.zul zir zirz; +application/vnd.zzazz.deck+xml zaz; +application/voicexml+xml vxml; +application/voucher-cms+json vcj; +application/wasm wasm; +application/watcherinfo+xml wif; +application/widget wgt; +application/wsdl+xml wsdl; +application/wspolicy+xml wspolicy; +application/xcap-att+xml xav; +application/xcap-caps+xml xca; +application/xcap-diff+xml xdf; +application/xcap-el+xml xel; +application/xcap-error+xml xer; +application/xcap-ns+xml xns; +application/xhtml+xml xhtml xhtm xht; +application/xliff+xml xlf; +application/xml-dtd dtd; +application/xop+xml xop; +application/xslt+xml xsl xslt; +application/xv+xml mxml xhvml xvml xvm; +application/yang yang; +application/yin+xml yin; +application/zip zip; +application/zstd zst; +audio/32kadpcm 726; +audio/aac adts aac ass; +audio/ac3 ac3; +audio/AMR amr; +audio/AMR-WB awb; +audio/asc acn; +audio/ATRAC-ADVANCED-LOSSLESS aal; +audio/ATRAC-X atx; +audio/ATRAC3 at3 aa3 omg; +audio/basic au snd; +audio/dls dls; +audio/EVRC evc; +audio/EVRCB evb; +audio/EVRCNW enw; +audio/EVRCWB evw; +audio/iLBC lbc; +audio/L16 l16; +audio/mhas mhas; +audio/mobile-xmf mxmf; +audio/mp4 m4a; +audio/mpeg mp3 mpga mp1 mp2; +audio/ogg oga ogg opus spx; +audio/prs.sid sid psid; +audio/QCELP qcp; +audio/SMV smv; +audio/sofa sofa; +audio/usac loas xhe; +audio/vnd.audiokoz koz; +audio/vnd.dece.audio uva uvva; +audio/vnd.digital-winds eol; +audio/vnd.dolby.mlp mlp; +audio/vnd.dts dts; +audio/vnd.dts.hd dtshd; +audio/vnd.everad.plj plj; +audio/vnd.lucent.voice lvp; +audio/vnd.ms-playready.media.pya pya; +audio/vnd.nortel.vbk vbk; +audio/vnd.nuera.ecelp4800 ecelp4800; +audio/vnd.nuera.ecelp7470 ecelp7470; +audio/vnd.nuera.ecelp9600 ecelp9600; +audio/vnd.presonus.multitrack multitrack; +audio/vnd.rip rip; +audio/vnd.sealedmedia.softseal.mpeg smp3 smp s1m; +font/collection ttc; +font/otf otf; +font/ttf ttf; +font/woff woff; +font/woff2 woff2; +image/aces exr; +image/avci avci; +image/avcs avcs; +image/avif avif hif; +image/bmp bmp dib; +image/cgm cgm; +image/dicom-rle drle; +image/emf emf; +image/fits fits fit fts; +image/heic heic; +image/heic-sequence heics; +image/heif heif; +image/heif-sequence heifs; +image/hej2k hej2; +image/hsj2 hsj2; +image/gif gif; +image/ief ief; +image/jls jls; +image/jp2 jp2 jpg2; +image/jph jph; +image/jphc jhc; +image/jpeg jpg jpeg jpe jfif; +image/jpm jpm jpgm; +image/jpx jpx jpf; +image/jxl jxl; +image/jxr jxr; +image/jxrA jxra; +image/jxrS jxrs; +image/jxs jxs; +image/jxsc jxsc; +image/jxsi jxsi; +image/jxss jxss; +image/ktx ktx; +image/ktx2 ktx2; +image/png png; +image/prs.btif btif btf; +image/prs.pti pti; +image/svg+xml svg svgz; +image/t38 t38; +image/tiff tiff tif; +image/tiff-fx tfx; +image/vnd.adobe.photoshop psd; +image/vnd.airzip.accelerator.azv azv; +image/vnd.dece.graphic uvi uvvi uvg uvvg; +image/vnd.djvu djvu djv; +image/vnd.dwg dwg; +image/vnd.dxf dxf; +image/vnd.fastbidsheet fbs; +image/vnd.fpx fpx; +image/vnd.fst fst; +image/vnd.fujixerox.edmics-mmr mmr; +image/vnd.fujixerox.edmics-rlc rlc; +image/vnd.globalgraphics.pgb pgb; +image/vnd.microsoft.icon ico; +image/vnd.mozilla.apng apng; +image/vnd.ms-modi mdi; +image/vnd.pco.b16 b16; +image/vnd.radiance hdr rgbe xyze; +image/vnd.sealed.png spng spn s1n; +image/vnd.sealedmedia.softseal.gif sgif sgi s1g; +image/vnd.sealedmedia.softseal.jpg sjpg sjp s1j; +image/vnd.tencent.tap tap; +image/vnd.valve.source.texture vtf; +image/vnd.wap.wbmp wbmp; +image/vnd.xiff xif; +image/vnd.zbrush.pcx pcx; +image/wmf wmf; +message/global u8msg; +message/global-delivery-status u8dsn; +message/global-disposition-notification u8mdn; +message/global-headers u8hdr; +message/rfc822 eml mail art; +model/gltf-binary glb; +model/gltf+json gltf; +model/iges igs iges; +model/mesh msh mesh silo; +model/mtl mtl; +model/obj obj; +model/stl stl; +model/vnd.collada+xml dae; +model/vnd.dwf dwf; +model/vnd.gdl gdl gsm win dor lmp rsm msm ism; +model/vnd.gtw gtw; +model/vnd.moml+xml moml; +model/vnd.mts mts; +model/vnd.opengex ogex; +model/vnd.parasolid.transmit.binary x_b xmt_bin; +model/vnd.parasolid.transmit.text x_t xmt_txt; +model/vnd.pytha.pyox pyo pyox; +model/vnd.sap.vds vds; +model/vnd.usdz+zip usdz; +model/vnd.valve.source.compiled-map bsp; +model/vnd.vtu vtu; +model/vrml wrl vrml; +model/x3d+xml x3db; +model/x3d-vrml x3dv x3dvz; +multipart/vnd.bint.med-plus bmed; +multipart/voice-message vpm; +text/cache-manifest appcache manifest; +text/calendar ics ifb; +text/cql CQL; +text/css css; +text/csv csv; +text/csv-schema csvs; +text/dns soa zone; +text/gff3 gff3; +text/html html htm; +text/jcr-cnd cnd; +text/markdown markdown md; +text/mizar miz; +text/n3 n3; +text/plain txt asc text pm el c h cc hh cxx hxx f90 conf log nix nginx sh cs sln razor csproj; +text/provenance-notation provn; +text/prs.fallenstein.rst rst; +text/prs.lines.tag tag dsc; +text/richtext rtx; +text/SGML sgml sgm; +text/shaclc shaclc shc; +text/spdx spdx; +text/tab-separated-values tsv; +text/troff t tr roff; +text/turtle ttl; +text/uri-list uris uri; +text/vcard vcf vcard; +text/vnd.a a; +text/vnd.abc abc; +text/vnd.ascii-art ascii; +text/vnd.debian.copyright copyright; +text/vnd.DMClientScript dms; +text/vnd.dvb.subtitle sub; +text/vnd.esmertec.theme-descriptor jtd; +text/vnd.ficlab.flt flt; +text/vnd.fly fly; +text/vnd.fmi.flexstor flx; +text/vnd.graphviz gv dot; +text/vnd.hans hans; +text/vnd.hgl hgl; +text/vnd.in3d.3dml 3dml 3dm; +text/vnd.in3d.spot spot spo; +text/vnd.ms-mediapackage mpf; +text/vnd.net2phone.commcenter.command ccc; +text/vnd.senx.warpscript mc2; +text/vnd.si.uricatalogue uric; +text/vnd.sun.j2me.app-descriptor jad; +text/vnd.sosi sos; +text/vnd.trolltech.linguist ts; +text/vnd.wap.si si; +text/vnd.wap.sl sl; +text/vnd.wap.wml wml; +text/vnd.wap.wmlscript wmls; +text/vtt vtt; +text/xml xml xsd rng; +text/xml-external-parsed-entity ent; +video/3gpp 3gp 3gpp; +video/3gpp2 3g2 3gpp2; +video/iso.segment m4s; +video/mj2 mj2 mjp2; +video/mp4 mp4 mpg4 m4v; +video/mpeg mpeg mpg mpe m1v m2v; +video/ogg ogv; +video/quicktime mov qt; +video/vnd.dece.hd uvh uvvh; +video/vnd.dece.mobile uvm uvvm; +video/vnd.dece.mp4 uvu uvvu; +video/vnd.dece.pd uvp uvvp; +video/vnd.dece.sd uvs uvvs; +video/vnd.dece.video uvv uvvv; +video/vnd.dvb.file dvb; +video/vnd.fvt fvt; +video/vnd.mpegurl mxu m4u; +video/vnd.ms-playready.media.pyv pyv; +video/vnd.nokia.interleaved-multimedia nim; +video/vnd.radgamettools.bink bik bk2; +video/vnd.radgamettools.smacker smk; +video/vnd.sealed.mpeg1 smpg s11; +video/vnd.sealed.mpeg4 s14; +video/vnd.sealed.swf sswf ssw; +video/vnd.sealedmedia.softseal.mov smov smo s1q; +video/vnd.youtube.yt yt; +video/vnd.vivo viv; +application/mac-compactpro cpt; +application/metalink+xml metalink; +application/owl+xml owx; +application/rss+xml rss; +application/vnd.android.package-archive apk; +application/vnd.oma.dd+xml dd; +application/vnd.oma.drm.content dcf; +application/vnd.oma.drm.dcf o4a o4v; +application/vnd.oma.drm.message dm; +application/vnd.oma.drm.rights+wbxml drc; +application/vnd.oma.drm.rights+xml dr; +application/vnd.sun.xml.calc sxc; +application/vnd.sun.xml.calc.template stc; +application/vnd.sun.xml.draw sxd; +application/vnd.sun.xml.draw.template std; +application/vnd.sun.xml.impress sxi; +application/vnd.sun.xml.impress.template sti; +application/vnd.sun.xml.math sxm; +application/vnd.sun.xml.writer sxw; +application/vnd.sun.xml.writer.global sxg; +application/vnd.sun.xml.writer.template stw; +application/vnd.symbian.install sis; +application/vnd.wap.mms-message mms; +application/x-annodex anx; +application/x-bcpio bcpio; +application/x-bittorrent torrent; +application/x-bzip2 bz2; +application/x-cdlink vcd; +application/x-chrome-extension crx; +application/x-cpio cpio; +application/x-csh csh; +application/x-director dcr dir dxr; +application/x-dvi dvi; +application/x-futuresplash spl; +application/x-gtar gtar; +application/x-hdf hdf; +application/x-java-archive jar; +application/x-java-jnlp-file jnlp; +application/x-java-pack200 pack; +application/x-killustrator kil; +application/x-latex latex; +application/x-netcdf nc cdf; +application/x-perl pl; +application/x-rpm rpm; +application/x-sh sh; +application/x-shar shar; +application/x-stuffit sit; +application/x-sv4cpio sv4cpio; +application/x-sv4crc sv4crc; +application/x-tar tar; +application/x-tcl tcl; +application/x-tex tex; +application/x-texinfo texinfo texi; +application/x-troff-man man 1 2 3 4 5 6 7 8; +application/x-troff-me me; +application/x-troff-ms ms; +application/x-ustar ustar; +application/x-wais-source src; +application/x-xpinstall xpi; +application/x-xspf+xml xspf; +application/x-xz xz; +audio/midi mid midi kar; +audio/x-aiff aif aiff aifc; +audio/x-annodex axa; +audio/x-flac flac; +audio/x-matroska mka; +audio/x-mod mod ult uni m15 mtm 669 med; +audio/x-mpegurl m3u; +audio/x-ms-wax wax; +audio/x-ms-wma wma; +audio/x-pn-realaudio ram rm; +audio/x-realaudio ra; +audio/x-s3m s3m; +audio/x-stm stm; +audio/x-wav wav; +chemical/x-xyz xyz; +image/webp webp; +image/x-cmu-raster ras; +image/x-portable-anymap pnm; +image/x-portable-bitmap pbm; +image/x-portable-graymap pgm; +image/x-portable-pixmap ppm; +image/x-rgb rgb; +image/x-targa tga; +image/x-xbitmap xbm; +image/x-xpixmap xpm; +image/x-xwindowdump xwd; +text/html-sandboxed sandboxed; +text/x-pod pod; +text/x-setext etx; +video/webm webm; +video/x-annodex axv; +video/x-flv flv; +video/x-javafx fxm; +video/x-matroska mkv; +video/x-matroska-3d mk3d; +video/x-ms-asf asx; +video/x-ms-wm wm; +video/x-ms-wmv wmv; +video/x-ms-wmx wmx; +video/x-ms-wvx wvx; +video/x-msvideo avi; +video/x-sgi-movie movie; +x-conference/x-cooltalk ice; +x-epoc/x-sisx-app sisx; +} diff --git a/modules/packages/vim.nix b/modules/packages/vim.nix new file mode 100755 index 0000000..3524e2c --- /dev/null +++ b/modules/packages/vim.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + 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 = []; + }; + customRC = '' + " your custom vimrc + set nocompatible + set backspace=indent,eol,start + " ... + ''; + }; + } + )]; +} diff --git a/modules/users/Rory.client.nix b/modules/users/Rory.client.nix new file mode 100755 index 0000000..b3ef89f --- /dev/null +++ b/modules/users/Rory.client.nix @@ -0,0 +1,53 @@ +{ 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"; + }; +} + diff --git a/modules/users/Rory.nix b/modules/users/Rory.nix new file mode 100755 index 0000000..c6a4ed6 --- /dev/null +++ b/modules/users/Rory.nix @@ -0,0 +1,190 @@ +{ 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"; + }; +} + diff --git a/modules/users/Rory/p10k.zsh b/modules/users/Rory/p10k.zsh new file mode 100644 index 0000000..e7f8e7c --- /dev/null +++ b/modules/users/Rory/p10k.zsh @@ -0,0 +1,1723 @@ +# Generated by Powerlevel10k configuration wizard on 2022-03-07 at 14:25 CET. +# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 19497. +# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode, +# angled separators, sharp heads, flat tails, 1 line, compact, many icons, fluent, +# instant_prompt=verbose. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with powerline prompt style with colorful background. +# Type `p10k configure` to generate your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + autoload -Uz is-at-least && is-at-least 5.1 || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + os_icon # os identifier + dir # current directory + vcs # git status + # prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + status # exit code of the last command + command_execution_time # duration of the last command + background_jobs # presence of background jobs + direnv # direnv status (https://direnv.net/) + #asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + #anaconda # conda environment (https://conda.io/) + #pyenv # python environment (https://github.com/pyenv/pyenv) + #goenv # go environment (https://github.com/syndbg/goenv) + #nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + #nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + #nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + # rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + # php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + #rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + #rvm # ruby version from rvm (https://rvm.io) + #fvm # flutter version management (https://github.com/leoafarias/fvm) + #luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + #jenv # java version from jenv (https://github.com/jenv/jenv) + #plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + #phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + #scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + #haskell_stack # haskell version from stack (https://haskellstack.org/) + #kubecontext # current kubernetes context (https://kubernetes.io/) + #terraform # terraform workspace (https://www.terraform.io) + # terraform_version # terraform version (https://www.terraform.io) + #aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + #aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + #azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + #gcloud # google cloud cli account and project (https://cloud.google.com/) + #google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + #toolbox # toolbox name (https://github.com/containers/toolbox) + context # user@hostname + #nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + #ranger # ranger shell (https://github.com/ranger/ranger) + #nnn # nnn shell (https://github.com/jarun/nnn) + #xplr # xplr shell (https://github.com/sayanarijit/xplr) + vim_shell # vim shell indicator (:sh) + #midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + vi_mode # vi mode (you don't need this if you've enabled prompt_char) + # vpn_ip # virtual private network indicator + load # CPU load + disk_usage # disk usage + ram # free RAM + # swap # used swap + #todo # todo items (https://github.com/todotxt/todo.txt-cli) + #timewarrior # timewarrior tracking status (https://timewarrior.net/) + #taskwarrior # taskwarrior task count (https://taskwarrior.org/) + # time # current time + # ip # ip address and bandwidth usage for a specified network interface + # public_ip # public IP address + # proxy # system-wide http/https/ftp proxy + # battery # internal battery + # wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=nerdfont-complete + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=none + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + + # Connect left prompt lines with these symbols. You'll probably want to use the same color + # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─' + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%242F─╮' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%242F─┤' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%242F─╯' + + # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or + # '─'. The last two make it easier to see the alignment between left and right prompt and to + # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + # for more compact prompt if using using this option. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= + if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then + # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE + # ornaments defined above. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 + # Start filler from the edge of the screen if there are no left segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + # End filler on the edge of the screen if there are no right segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + # Separator between same-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + # Separator between same-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + # Separator between different-color segments on the left. + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + # Separator between different-color segments on the right. + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + # The right end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + # The left end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' + # Left prompt terminator for lines without any segments. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Transparent background. + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # No surrounding whitespace. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + ##################################[ dir: current directory ]################################## + # Current directory background color. + typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 + # Default current directory foreground color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 + # Display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-version + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 + # + # # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' + + #####################################[ vcs: git status ]###################################### + # Version control system colors. + typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 + typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + + # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + # Styling for different parts of Git status. + local meta='%7F' # white foreground + local clean='%0F' # black foreground + local modified='%0F' # black foreground + local untracked='%0F' # black foreground + local conflicted='%1F' # red foreground + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 … the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + # ⇠42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "─" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Custom icon. + # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_VCS_PREFIX='on ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg reposotiry. + #typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=true + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + + # Status when some part of a pipe command fails but the overall exit status is zero. It may look + # like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + + # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as + # it will signify error by turning red. + typeset -g POWERLEVEL9K_STATUS_ERROR=true + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 + + ###################[ command_execution_time: duration of the last command ]################### + # Execution time color. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=true + # Custom icon. + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ direnv: direnv status (https://direnv.net/) ]######################## + # Direnv color. + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and + # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 + typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 + typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### + # Foreground color. + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + # Text and color for normal (a.k.a. command) vi mode. + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + # Text and color for visual vi mode. + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + # Text and color for overtype (a.k.a. overwrite and replace) vi mode. + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + # Text and color for insert vi mode. + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + + # If the tracked task is longer than 24 characters, truncate and append "…". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 + + # Context format when running with privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' + + ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### + # Python virtual environment color. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 + # Don't show Python version next to the virtual environment name. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide PHP version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### + # Haskell color. + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 + typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 + + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 + typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 + typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 + typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + typeset -g POWERLEVEL9K_TIME_PREFIX='at ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background + # greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 + typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/modules/users/Rory/wallpaper.webp b/modules/users/Rory/wallpaper.webp new file mode 100644 index 0000000..a2923f0 Binary files /dev/null and b/modules/users/Rory/wallpaper.webp differ diff --git a/modules/users/chris.nix b/modules/users/chris.nix new file mode 100755 index 0000000..86acee5 --- /dev/null +++ b/modules/users/chris.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +{ + + users.users.chris = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + packages = with pkgs; [ + nano + nodejs-slim + ]; + #initialPassword = "password"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMd9U0+wKjBG3Q9Qg249xJY+ybYeRV9/VMPjuwKvFBEI" + ]; + }; +} + diff --git a/rebuild-wsl-no-update.sh b/rebuild-wsl-no-update.sh new file mode 100755 index 0000000..0f9284c --- /dev/null +++ b/rebuild-wsl-no-update.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +nom build .#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel && sudo nixos-rebuild switch --flake .#${HOSTNAME} +#./build.sh / $HOSTNAME diff --git a/rebuild-wsl.sh b/rebuild-wsl.sh new file mode 100755 index 0000000..b7e66be --- /dev/null +++ b/rebuild-wsl.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +if [ -d "nixpkgs" ]; then + cd nixpkgs +# git remote add upstream https://github.com/NixOS/nixpkgs || git remote set-url upstream https://github.com/NixOS/nixpkgs +# git fetch --all -v +# git rebase upstream/nixos-unstable -v + cd .. +fi + +nix flake update +nom build .#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel && sudo nixos-rebuild switch --flake .#${HOSTNAME} +#./build.sh / $HOSTNAME diff --git a/rebuild.sh b/rebuild.sh new file mode 100755 index 0000000..0e02eab --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +./build.sh / $HOSTNAME \ No newline at end of file diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..f233b68 --- /dev/null +++ b/update.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +if [ -d "nixpkgs" ]; then + cd nixpkgs +# git remote add upstream https://github.com/NixOS/nixpkgs || git remote set-url upstream https://github.com/NixOS/nixpkgs +# git fetch --all -v +# git rebase upstream/nixos-unstable -v && git push --force + cd .. +fi + +nix flake update +./build.sh / $HOSTNAME