diff --git a/dns/dnsconfig.js b/dns/dnsconfig.js index 21fae484..9d2e9985 100644 --- a/dns/dnsconfig.js +++ b/dns/dnsconfig.js @@ -41,12 +41,12 @@ D('sealight.xyz', REG_NONE, DnsProvider(DNS_HEDNS), A('ci', '69.61.2.203', TTL(300)), A('write', '69.61.2.203', TTL(300)), A('photos', '69.61.2.203', TTL(300)), - // vultr: lituus - A('@', '45.77.48.108', TTL(300)), - A('jitsi', '45.77.48.108', TTL(300)), - A('chat', '45.77.48.108', TTL(300)), - A('element', '45.77.48.108', TTL(300)), - A('turn', '45.77.48.108', TTL(300)), + // vultr melbourne: lituus + A('@', '67.219.99.225', TTL(300)), + A('jitsi', '67.219.99.225', TTL(300)), + A('chat', '67.219.99.225', TTL(300)), + A('element', '67.219.99.225', TTL(300)), + A('turn', '67.219.99.225', TTL(300)), //nullhex free email real estate CNAME('key1._domainkey', 'key1.nullhex.com.'), CNAME('autoconfig', 'autoconfig.nullhex.com.'), diff --git a/flake.nix b/flake.nix index 2cb9d3d3..f27f53bd 100644 --- a/flake.nix +++ b/flake.nix @@ -331,7 +331,7 @@ pkgs = deckPkgsFor.${system}; modules = [ ./hosts/deck - jovian.nixosModules.default + # jovian.nixosModules.default self.nixosModules.wireguard agenix.nixosModules.age self.nixosModules.backup @@ -392,8 +392,9 @@ }; }; lituus = { - hostname = "sealight.xyz"; + hostname = "67.219.99.225"; autoRollback = false; + remoteBuild = true; profiles.system = { user = "root"; path = deploy-rs.lib.x86_64-linux.activate.nixos diff --git a/home/profiles/cli/default.nix b/home/profiles/cli/default.nix index 84962944..3a8f03ea 100644 --- a/home/profiles/cli/default.nix +++ b/home/profiles/cli/default.nix @@ -10,6 +10,7 @@ git-machete bottom gptfdisk + difftastic starship jq manix @@ -55,6 +56,8 @@ gnupg syncthing dijo + nixfmt-rfc-style + nix-tree #ssb-patchwork fontconfig pandoc @@ -159,6 +162,7 @@ initContent = '' bindkey -v autopair-init + export PATH="$PATH:/Users/anishlakhwara/go/bin" ''; sessionVariables = { EDITOR = "nvim"; diff --git a/home/profiles/git/default.nix b/home/profiles/git/default.nix index 3d02cd7c..55f00ce2 100644 --- a/home/profiles/git/default.nix +++ b/home/profiles/git/default.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: { #xdg.configFile = { # "git/config".source = ./config; @@ -7,6 +8,10 @@ programs.lazygit.enable = true; + home.packages = with pkgs; [ + unstable.git-spice + ]; + programs.git = { enable = true; userName = "Anish Lakhwara"; diff --git a/home/profiles/nvim/default.nix b/home/profiles/nvim/default.nix index a8867bb0..7574dc33 100644 --- a/home/profiles/nvim/default.nix +++ b/home/profiles/nvim/default.nix @@ -1023,7 +1023,7 @@ in vim.keymap.set({'n', 't'}, '', 'NavigatorRight') -- Disable Ctrl+V in nvim so Kitty can handle paste - vim.keymap.set({'v', 'i'}, '', '', {noremap = true, silent = true}) + vim.keymap.set('i', '', '+', {noremap = true, silent = true}) -- Pane resizing with Alt+Shift+hjkl (to match tmux) vim.keymap.set('n', '', 'vertical resize -2', {silent = true}) diff --git a/home/profiles/tmux/tmux.conf b/home/profiles/tmux/tmux.conf index 1abdcc0b..709cb5c8 100644 --- a/home/profiles/tmux/tmux.conf +++ b/home/profiles/tmux/tmux.conf @@ -2,10 +2,37 @@ set -g base-index 1 setw -g pane-base-index 1 # https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/ -set -g default-terminal "xterm-256color" +# colors +set -g default-terminal "tmux-256color" set -ga terminal-overrides ",*256col*:Tc" set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' set-environment -g COLORTERM "truecolor" +set -sa terminal-features ",tmux-256color:RGB:Nobr" +set -g allow-passthrough on + +set -g set-clipboard on + +# shift enter for amp +set -s extended-keys on +set -as terminal-features 'tmux*:extkeys' + +# pane colors for amp diff view +# set-option -g pane-colours[0] "#4D5566" +# set-option -g pane-colours[1] "#F27983" +# set-option -g pane-colours[2] "#A6CC70" +# set-option -g pane-colours[3] "#F29E74" +# set-option -g pane-colours[4] "#77A8D9" +# set-option -g pane-colours[5] "#A37ACC" +# set-option -g pane-colours[6] "#4CBF99" +# set-option -g pane-colours[7] "#F0F0F0" +# set-option -g pane-colours[8] "#000000" +# set-option -g pane-colours[9] "#FF3333" +# set-option -g pane-colours[10] "#BAE67E" +# set-option -g pane-colours[11] "#FFA759" +# set-option -g pane-colours[12] "#73D0FF" +# set-option -g pane-colours[13] "#D4BFFF" +# set-option -g pane-colours[14] "#95E6CB" +# set-option -g pane-colours[15] "#ffffff" # Mouse works as expected set-option -g mouse on @@ -16,6 +43,10 @@ set -g focus-events on bind | split-window -h -c "#{pane_current_path}" bind - split-window -v -c "#{pane_current_path}" +# amp commands +set -g @amp/fork-thread-command 'new-window -n forked-thread $SHELL -c "amp threads fork; amp threads continue"' +bind -N 'Fork Amp thread' f "#{@amp/fork-thread-command}" + # don't rename windows automatically set-option -g allow-rename off @@ -63,6 +94,7 @@ set -g message-style 'fg=yellow bg=green bold' # Unbind Ctrl+V so it passes through to Kitty for paste unbind C-v +set -g set-clipboard on # Vim-aware pane navigation with Alt+hjkl is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" diff --git a/hosts/deck/configuration.nix b/hosts/deck/configuration.nix index 8926d078..92984cf0 100644 --- a/hosts/deck/configuration.nix +++ b/hosts/deck/configuration.nix @@ -73,8 +73,9 @@ # }; # Enable automatic login for the user. - services.xserver.displayManager.autoLogin.enable = true; - services.xserver.displayManager.autoLogin.user = "anish"; + # Disabled: jovian.steam.autoStart handles this + # services.xserver.displayManager.autoLogin.enable = true; + # services.xserver.displayManager.autoLogin.user = "anish"; # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 systemd.services."getty@tty1".enable = false; diff --git a/hosts/deck/default.nix b/hosts/deck/default.nix index cda17705..a31e9afe 100644 --- a/hosts/deck/default.nix +++ b/hosts/deck/default.nix @@ -1,4 +1,4 @@ -{ self, pkgs, config, ... }: +{ self, pkgs, config, lib, ... }: { imports = [ ./configuration.nix @@ -31,13 +31,16 @@ # theme = "motion"; # }; - jovian.steam.enable = true; - jovian.devices.steamdeck.enable = true; - jovian.steam.user = "anish"; - jovian.steam.autoStart = true; - jovian.steam.desktopSession = "gnome"; + # jovian.steam.enable = true; + # jovian.devices.steamdeck.enable = true; + # jovian.steam.user = "anish"; + # jovian.steam.autoStart = true; + # jovian.steam.desktopSession = "gnome"; # jovian.steam.desktopSession = "none+bspwm"; + # Disable lightdm from desktop profile + services.xserver.displayManager.lightdm.enable = lib.mkForce false; + # Install XR drivers # environment.systemPackages = with pkgs; [ # xrlinuxdriver diff --git a/hosts/lituus/block-storage.nix b/hosts/lituus/block-storage.nix new file mode 100644 index 00000000..d5c0bc2f --- /dev/null +++ b/hosts/lituus/block-storage.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... }: + +{ + # Block storage mount + fileSystems."/srv/sealight" = { + device = "/dev/disk/by-id/virtio-mel-3b1f60a89cd649"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + + # Bind mounts for service data + # PostgreSQL moved to NVMe for performance - data lives directly on /var/lib/postgresql + # fileSystems."/var/lib/postgresql" = { + # device = "/srv/sealight/postgresql"; + # fsType = "none"; + # options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ]; + # }; + + fileSystems."/var/lib/matrix-synapse" = { + device = "/srv/sealight/matrix-synapse"; + fsType = "none"; + options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ]; + }; + + fileSystems."/var/lib/matrix-as-discord" = { + device = "/srv/sealight/matrix-as-discord"; + fsType = "none"; + options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ]; + }; + + fileSystems."/var/lib/mautrix-telegram" = { + device = "/srv/sealight/mautrix-telegram"; + fsType = "none"; + options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ]; + }; + + fileSystems."/var/lib/wireguard" = { + device = "/srv/sealight/wireguard"; + fsType = "none"; + options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ]; + }; + + fileSystems."/var/www" = { + device = "/srv/sealight/www"; + fsType = "none"; + options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ]; + }; + + # Ensure services wait for mounts + # PostgreSQL no longer needs to wait for /srv/sealight mount + # systemd.services.postgresql.unitConfig.RequiresMountsFor = [ "/srv/sealight" ]; + systemd.services.matrix-synapse.unitConfig.RequiresMountsFor = [ "/srv/sealight" ]; +} diff --git a/hosts/lituus/default.nix b/hosts/lituus/default.nix index 8d365120..46a0b6c8 100644 --- a/hosts/lituus/default.nix +++ b/hosts/lituus/default.nix @@ -1,7 +1,9 @@ { self, profiles, suites, ... }: { imports = [ + ./hardware-configuration.nix ./configuration.nix + ./block-storage.nix ../profiles/core ../profiles/server ../profiles/metrics diff --git a/hosts/lituus/hardware-configuration.nix b/hosts/lituus/hardware-configuration.nix index 6feedb4e..11b9c668 100644 --- a/hosts/lituus/hardware-configuration.nix +++ b/hosts/lituus/hardware-configuration.nix @@ -1,27 +1,22 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + imports = [ ]; - boot.initrd.availableKernelModules = [ "ata_piix" "floppy" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/3b8b2c4b-835e-4822-8ac8-0effdc8270d6"; - fsType = "btrfs"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f9e9468f-ff3b-430d-9ecf-ba275cf2f716"; + fsType = "ext4"; + }; swapDevices = [ ]; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - nixpkgs.hostPlatform = "x86_64-linux"; + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + virtualisation.hypervGuest.enable = true; } diff --git a/hosts/profiles/matrix/default.nix b/hosts/profiles/matrix/default.nix index 9698f6b9..d23273ab 100644 --- a/hosts/profiles/matrix/default.nix +++ b/hosts/profiles/matrix/default.nix @@ -17,11 +17,14 @@ age.secrets.synapse-config.file = "${self}/secrets/synapse-config.age"; age.secrets.synapse-config.owner = "matrix-synapse"; + systemd.services.matrix-synapse.serviceConfig.TimeoutStartSec = "10min"; + services.matrix-synapse = { enable = true; settings = { max_upload_size = "100M"; server_name = "sealight.xyz"; + federation_sender_instances = []; listeners = [ { port = 8448; @@ -210,7 +213,12 @@ root = "/var/www/sealight.xyz"; }; locations."/_matrix" = { - proxyPass = "http://localhost:8448"; + proxyPass = "http://127.0.0.1:8448"; + extraConfig = '' + proxy_read_timeout 300s; + proxy_connect_timeout 300s; + proxy_send_timeout 300s; + ''; }; # locations."/slackbridge" = { # proxyPass = "http://localhost:9899"; @@ -222,6 +230,11 @@ enableACME = true; locations."/" = { proxyPass = "http://localhost:8448"; + extraConfig = '' + proxy_read_timeout 300s; + proxy_connect_timeout 300s; + proxy_send_timeout 300s; + ''; }; }; ## virtual host for Riot/Web