Compare commits

...

3 Commits

Author SHA1 Message Date
Tom Alexander
574a2d0ce7
Update vscode config. 2024-01-25 10:15:25 -05:00
Tom Alexander
1024f37691
Enable inlay hints for typescript. 2024-01-21 17:00:25 -05:00
Tom Alexander
724a8ca394
Fix ansible playbook on FreeBSD. 2024-01-21 15:58:18 -05:00
12 changed files with 151 additions and 37 deletions

View File

@ -1,7 +1,7 @@
os_flavor: "freebsd" os_flavor: "freebsd"
custom_repo: 13amd64-default-framework #custom_repo: 13amd64-default-framework
zfs_snapshot_datasets: zfs_snapshot_datasets:
- path: zroot/freebsd/release/be/default - path: zroot/freebsd/current/be/default
sshd_enabled: true sshd_enabled: true
sshd_conf: "sshd_config" sshd_conf: "sshd_config"
pf_config: "odofreebsd_pf.conf" pf_config: "odofreebsd_pf.conf"
@ -14,7 +14,7 @@ loader_conf: "odofreebsd_loader.conf"
install_graphics: true install_graphics: true
graphics_driver: "amd" graphics_driver: "amd"
cputype: "amd" cputype: "amd"
cpu_opt: tigerlake cpu_opt: znver4
hwpstate: true hwpstate: true
cores: 16 cores: 16
build_user: build_user:
@ -38,14 +38,14 @@ users:
- homeassistant - homeassistant
gitconfig: "gitconfig_home" gitconfig: "gitconfig_home"
devfs_rules: "odo_devfs.rules" devfs_rules: "odo_devfs.rules"
jail_zfs_dataset: zroot/freebsd/release/jails jail_zfs_dataset: zroot/freebsd/current/jails
jail_zfs_dataset_mountpoint: /jail/main jail_zfs_dataset_mountpoint: /jail/main
jail_list: jail_list:
- name: nat_dhcp - name: nat_dhcp
enabled: true enabled: true
conf: conf:
src: nat_dhcp src: nat_dhcp
bhyve_dataset: zroot/freebsd/release/vm bhyve_dataset: zroot/freebsd/current/vm
bhyve_list: [] bhyve_list: []
efi_dev: /dev/gpt/EFI efi_dev: /dev/gpt/EFI
sway_conf_files: sway_conf_files:

View File

@ -2,7 +2,12 @@ clear_tmp_enable="YES"
syslogd_flags="-ss" syslogd_flags="-ss"
sendmail_enable="NONE" sendmail_enable="NONE"
hostname="odo" hostname="odo"
# wlans_iwlwifi0="wlan0"
# ifconfig_wlan0="WPA DHCP"
# ifconfig_wlan0_ipv6="inet6 accept_rtadv"
sshd_enable="YES" sshd_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO" dumpdev="NO"
zfs_enable="YES" zfs_enable="YES"

View File

@ -1,2 +1,2 @@
# freebsd_version: "releng/13.2" # freebsd_version: "releng/13.2"
freebsd_version: "9c80d66ec1b4c5b9ac7aaf5b0fdbb1628d49c181" freebsd_version: "c3d7bb5aca7749626b5c70dfa86ee8f07960f44a"

View File

@ -23,6 +23,52 @@
(run-command-on-buffer "jq" "--monochrome-output" ".") (run-command-on-buffer "jq" "--monochrome-output" ".")
) )
(defun configure-typescript-language-server ()
"Configures the typescript language server."
(when-linux
;; Either initializationOptions or workspace/didChangeConfiguration works.
(setq eglot-workspace-configuration
(list (cons ':typescript '(:inlayHints (:includeInlayParameterNameHints
"all"
:includeInlayParameterNameHintsWhenArgumentMatchesName
t
:includeInlayFunctionParameterTypeHints
t
:includeInlayVariableTypeHints
t
:includeInlayVariableTypeHintsWhenTypeMatchesName
t
:includeInlayPRopertyDeclarationTypeHints
t
:includeInlayFunctionLikeReturnTypeHints
t
:includeInlayEnumMemberValueHints
t)))))
(eglot-ensure)
;; (defclass my/eglot-typescript (eglot-lsp-server) ()
;; :documentation
;; "Own eglot server class.")
;; (add-to-list 'eglot-server-programs
;; '((js-mode js-ts-mode tsx-ts-mode typescript-ts-mode typescript-mode) . (my/eglot-typescript "typescript-language-server" "--stdio" :initializationOptions (:preferences (:includeInlayParameterNameHints
;; "all"
;; :includeInlayParameterNameHintsWhenArgumentMatchesName
;; t
;; :includeInlayFunctionParameterTypeHints
;; t
;; :includeInlayVariableTypeHints
;; t
;; :includeInlayVariableTypeHintsWhenTypeMatchesName
;; t
;; :includeInlayPRopertyDeclarationTypeHints
;; t
;; :includeInlayFunctionLikeReturnTypeHints
;; t
;; :includeInlayEnumMemberValueHints
;; t)))))
)
)
(use-package tsx-ts-mode (use-package tsx-ts-mode
:ensure nil :ensure nil
:pin manual :pin manual
@ -33,7 +79,7 @@
:hook ( :hook (
(tsx-ts-mode . (lambda () (tsx-ts-mode . (lambda ()
(when-linux (when-linux
(eglot-ensure) (configure-typescript-language-server)
) )
)) ))
) )
@ -52,9 +98,7 @@
:commands (typescript-ts-mode) :commands (typescript-ts-mode)
:hook ( :hook (
(typescript-ts-mode . (lambda () (typescript-ts-mode . (lambda ()
(when-linux (configure-typescript-language-server)
(eglot-ensure)
)
)) ))
) )
:init :init

View File

@ -5,7 +5,7 @@ not_jail_nat_v4 = "{ any, !10.215.1.0/24 }"
dns_redirect = "{ 10.193.223.1 10.213.177.1 10.215.1.1 }" dns_redirect = "{ 10.193.223.1 10.213.177.1 10.215.1.1 }"
dhcp = "{ bootpc, bootps }" dhcp = "{ bootpc, bootps }"
allow = "{ wgf wgh drmario colo }" #allow = "{ wgf wgh drmario colo }"
tcp_pass_in = "{ 22 }" tcp_pass_in = "{ 22 }"
udp_pass_in = "{ 53 51820 }" udp_pass_in = "{ 53 51820 }"
@ -16,8 +16,8 @@ udp_pass_in = "{ 53 51820 }"
set skip on lo set skip on lo
# redirections # redirections
nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (wlan0) #nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (wlan0)
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 1.1.1.1 port 53 #rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 1.1.1.1 port 53
# Redirect jaeger ports to virtual machine. # Redirect jaeger ports to virtual machine.
# nat pass on lo inet from 127.0.0.0/24 to 127.0.0.0/24 port {6831 6832 16686 14268} -> (jail_nat) # nat pass on lo inet from 127.0.0.0/24 to 127.0.0.0/24 port {6831 6832 16686 14268} -> (jail_nat)
@ -27,19 +27,19 @@ rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 1.1.1
block log all block log all
pass out on $ext_if pass out on $ext_if
pass in on jail_nat #pass in on jail_nat
# Allow traffic from my machine to the jails/virtual machines # Allow traffic from my machine to the jails/virtual machines
pass out on jail_nat from $jail_nat_v4 #pass out on jail_nat from $jail_nat_v4
# We pass on the interfaces listed in allow rather than skipping on # We pass on the interfaces listed in allow rather than skipping on
# them because changes to pass rules will update when running a # them because changes to pass rules will update when running a
# `service pf reload` but interfaces that we `skip` will not update (I # `service pf reload` but interfaces that we `skip` will not update (I
# forget if its from adding, removing, or both. TODO: test to figure # forget if its from adding, removing, or both. TODO: test to figure
# it out). Also skipped interfaces are not subject to nat/rdr rules. # it out). Also skipped interfaces are not subject to nat/rdr rules.
pass quick on $allow #pass quick on $allow
pass on $ext_if proto icmp all pass on $ext_if proto icmp all
pass on $ext_if proto icmp6 all pass on $ext_if proto icmp6 all
pass in on $ext_if proto tcp to any port $tcp_pass_in #pass in on $ext_if proto tcp to any port $tcp_pass_in
pass in on $ext_if proto udp to any port $udp_pass_in #pass in on $ext_if proto udp to any port $udp_pass_in

View File

@ -1,7 +1,7 @@
- name: Install packages - name: Install packages
package: package:
name: name:
- sourcecodepro-ttf - source-code-pro-ttf
- source-sans-ttf - source-sans-ttf
- cascadia-code - cascadia-code
- noto - noto

View File

@ -0,0 +1,42 @@
- name: Install packages
package:
name:
- drm-kmod
# - libva-intel-media-driver # va-api support for broadwell (2014) and newer.
# - libva-intel-driver # va-api support until after coffeelake (2017).
- vulkan-loader
- libva-utils # for vainfo
- vdpauinfo # for vdpauinfo
- libvdpau-va-gl # vdpau support
# - igt-gpu-tools # for intel_gpu_top
- vulkan-tools # For vulkaninfo
state: present
# - name: Configure vdpau to use va-api driver
# copy:
# src: vdpau.sh
# dest: /etc/profile.d/vdpau.sh
# mode: 0644
# owner: root
# group: root
#- name: Install loader.conf
# copy:
# src: "files/{{ item }}_loader.conf"
# dest: "/boot/loader.conf.d/{{ item }}.conf"
# mode: 0644
# owner: root
# group: wheel
# loop:
# - intel_power
# - intel_hw_accel_video
#- name: Install service configuration
# copy:
# src: "files/intel_{{ item }}_rc.conf"
# dest: "/etc/rc.conf.d/{{ item }}"
# mode: 0644
# owner: root
# group: wheel
# loop:
# - kld

View File

@ -188,5 +188,21 @@
"key": "ctrl+f", "key": "ctrl+f",
"command": "-actions.find", "command": "-actions.find",
"when": "editorFocus || editorIsOpen" "when": "editorFocus || editorIsOpen"
},
{
"key": "ctrl+shift+-",
"command": "undo"
},
{
"key": "ctrl+z",
"command": "-undo"
},
{
"key": "alt+x",
"command": "workbench.action.showCommands"
},
{
"key": "ctrl+shift+p",
"command": "-workbench.action.showCommands"
} }
] ]

View File

@ -1,17 +1,22 @@
{ {
"workbench.colorTheme": "Default High Contrast", "application.shellEnvironmentResolutionTimeout": 90,
"remote.SSH.connectTimeout": 30, "workbench.colorTheme": "Default High Contrast",
"remote.SSH.enableDynamicForwarding": false, "remote.SSH.connectTimeout": 30,
"remote.SSH.enableAgentForwarding": false, "remote.SSH.enableDynamicForwarding": false,
"remote.SSH.enableX11Forwarding": false, "remote.SSH.enableAgentForwarding": false,
"python.analysis.inlayHints.functionReturnTypes": true, "remote.SSH.enableX11Forwarding": false,
"python.analysis.inlayHints.variableTypes": true, "python.analysis.inlayHints.functionReturnTypes": true,
"editor.minimap.enabled": false, "python.analysis.inlayHints.variableTypes": true,
"editor.fontSize": 12, "editor.minimap.enabled": false,
"editor.cursorStyle": "block", "editor.fontSize": 12,
"editor.fontFamily": "'Cascadia Mono', 'monospace', monospace", "editor.cursorStyle": "block",
"workbench.colorCustomizations": { "editor.fontFamily": "'Cascadia Mono', 'monospace', monospace",
"editorCursor.foreground": "#ccff66", "workbench.colorCustomizations": {
"terminalCursor.foreground": "#ccff66" "editorCursor.foreground": "#ccff66",
} "terminalCursor.foreground": "#ccff66"
} },
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
}
}

View File

@ -26,7 +26,7 @@
copy: copy:
src: "files/{{ item.src }}" src: "files/{{ item.src }}"
dest: "{{ account_homedir.stdout }}/{{ item.dest }}" dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
mode: 0600 mode: 0644
owner: "{{ account_name.stdout }}" owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}" group: "{{ group_name.stdout }}"
loop: loop:

View File

@ -76,6 +76,7 @@ function start_vm {
-c 6 \ -c 6 \
-m 8G \ -m 8G \
-H \ -H \
-o 'rtc.use_localtime=false' \
-s 0,hostbridge \ -s 0,hostbridge \
-s "4,nvme,/dev/zvol/zroot/vm/opnsense/disk0" \ -s "4,nvme,/dev/zvol/zroot/vm/opnsense/disk0" \
-S \ -S \

View File

@ -75,8 +75,9 @@ function start_vm {
bhyve \ bhyve \
-D \ -D \
-c 1 \ -c 1 \
-m 2G \ -m 3G \
-H \ -H \
-o 'rtc.use_localtime=false' \
-s 0,hostbridge \ -s 0,hostbridge \
-s "4,nvme,/dev/zvol/zroot/vm/unifi/disk0" \ -s "4,nvme,/dev/zvol/zroot/vm/unifi/disk0" \
-s 30,xhci,tablet \ -s 30,xhci,tablet \