338 Commits

Author SHA1 Message Date
Tom Alexander
a8822d0bfb Update for pkgbase rebuild of homeserver. 2026-04-14 15:39:22 -04:00
Tom Alexander
88dfc73f3d Remove rg jail and add ipv6 to wireguard. 2026-04-04 21:18:42 -04:00
Tom Alexander
d9f6c8da31 Update for rebuild of mrmanager. 2026-03-26 18:17:38 -04:00
Tom Alexander
9bc3aed323 Add ndproxy to support neighbor discovery of VMs from the public internet. 2025-12-07 14:31:15 -05:00
Tom Alexander
613204d9fa Enable ipv6 cluster in the firewall. 2025-12-07 14:19:24 -05:00
Tom Alexander
c23a99bd41 Add support for multiple 9p directories. 2025-12-07 10:32:56 -05:00
Tom Alexander
32d276c467 Add IP allocations for new nix-based kubernetes cluster. 2025-11-30 19:50:45 -05:00
Tom Alexander
6e14356a13 Enable type-checking by default in vscode for python. 2025-11-30 19:17:49 -05:00
Tom Alexander
c5e7b983ec Disable 6ghz.
Currently, I get a lot of dropped packets on 6ghz. I suspect it is a bug in the drivers/firmware.
2025-09-28 20:57:32 -04:00
Tom Alexander
25957105c9 Add support for preventing OOM kill on certain VMs. 2025-09-27 19:02:06 -04:00
Tom Alexander
daaf427286 Update to the new GPG key. 2025-09-23 19:51:38 -04:00
Tom Alexander
c96c4d3ddb Unbind shift+enter to stop unintentionally running python code. 2025-09-19 10:04:09 -04:00
Tom Alexander
b72fa0edff Disable AI firefox stuff. 2025-09-19 10:03:24 -04:00
Tom Alexander
052c051c75 Switch to abm level 2.
Recent kernels have made the screen dimmer. Switching to ABM level 2 has compensated for that.
2025-09-16 17:57:53 -04:00
Tom Alexander
79a2ec6f53 Add rg jail. 2025-09-07 15:37:29 -04:00
Tom Alexander
7c506f9e7f Add d2. 2025-09-07 15:11:11 -04:00
Tom Alexander
40dc19eaea Disable nfsd. 2025-08-31 19:58:39 -04:00
Tom Alexander
2aec6d2411 Add support for mounting a host directory into the VM via virtio-9p. 2025-08-30 16:53:03 -04:00
Tom Alexander
97149b9196 Fix firewall blocking to host machine.
The firewall was not working so all traffic was making it through to the host system.
2025-08-30 15:07:57 -04:00
Tom Alexander
4633a97262 Wire memory in router VMs. 2025-08-27 20:16:06 -04:00
Tom Alexander
9ff8835e0a Scope back navigation to the editor. 2025-08-27 16:51:51 -04:00
Tom Alexander
2f07067bda Merge branch 'bhyve_rc' 2025-08-26 22:30:21 -04:00
Tom Alexander
2d94825d17 Add timeouts. 2025-08-26 22:29:59 -04:00
Tom Alexander
d1c6e358d4 Update vscode config. 2025-08-26 22:29:58 -04:00
Tom Alexander
54060aada6 Add delay between starts. 2025-08-26 22:29:58 -04:00
Tom Alexander
313c159a3e Integrate code to launch the VMs. 2025-08-26 22:29:58 -04:00
Tom Alexander
187a7aebe9 Add a bhyverc script using pidfiles. 2025-08-26 22:29:58 -04:00
Tom Alexander
ab246f61dd Add speech-dispatcher for text to speech in firefox. 2025-08-23 16:23:22 -04:00
Tom Alexander
04c991e775 Enable hardware accelerated encoding in chromium. 2025-08-09 13:30:31 -04:00
Tom Alexander
ca1a569013 Static ip address for certificate renewals on home server. 2025-05-24 18:28:12 -04:00
Tom Alexander
6578d64b50 Format typescript on save in vscode. 2025-05-19 16:27:00 -04:00
Tom Alexander
22cf52d490 Fix screen scaling during screen sharing. 2025-04-01 13:41:07 -04:00
Tom Alexander
5b276081d1 Forward port to hydra ssh. 2025-03-23 20:41:52 -04:00
Tom Alexander
ff1217c65d Add hydra IP address binding. 2025-03-23 16:54:56 -04:00
Tom Alexander
9319fc4bc5 Add DMARC record to domain. 2025-03-08 13:34:27 -05:00
Tom Alexander
b1bea7224f Integrate some git config suggestions from https://blog.gitbutler.com/how-git-core-devs-configure-git/ . 2025-02-26 13:29:44 -05:00
Tom Alexander
28b61ff95a Show the project on the mode line in emacs. 2025-02-24 14:04:41 -05:00
Tom Alexander
abf5f81d21 Do not show window borders when it is the only window on the workspace. 2025-02-24 12:19:22 -05:00
Tom Alexander
d9150880d3 Fix org-mode shift-arrow keys and add cmake support. 2025-02-24 12:17:32 -05:00
Tom Alexander
515e910487 Switch back to LTS kernel. 2025-02-24 12:15:37 -05:00
Tom Alexander
e2f8696ed6 Move the window title to the center. 2024-12-16 23:00:50 -05:00
Tom Alexander
3bd4f15fe1 Add window title to waybar. 2024-12-16 22:43:10 -05:00
Tom Alexander
157471952a Get rid of window title bars. 2024-12-16 18:18:18 -05:00
Tom Alexander
a555876a7e Sort icons. 2024-12-13 23:06:54 -05:00
Tom Alexander
3116d34994 Add nix support to emacs. 2024-11-29 21:27:08 -05:00
Tom Alexander
5c823f3353 Try a convert vs stream function instead for video conversion. 2024-11-17 21:29:42 -05:00
Tom Alexander
c2f1a0db1c Merge branch 'template_linfi' 2024-10-21 18:10:49 -04:00
Tom Alexander
c0c12b9eea Hard-code my wifi regulatory domain to US. 2024-10-21 18:10:39 -04:00
Tom Alexander
d2ff39b5e6 Move my home server over to linfi. 2024-10-21 18:10:39 -04:00
Tom Alexander
e9e6e141d2 Switch to av1 for screen recording. 2024-10-14 18:18:20 -04:00
Tom Alexander
d2c1f5c94f Disable pf so fileserver doesn't go dark accidentally. 2024-10-14 18:18:20 -04:00
Tom Alexander
cd0208f3fc Add a script to get the next hop in a route.
I never remember the incantation, and its slightly different between FreeBSD and Linux so I am adding this script essentially as a note.
2024-10-13 22:02:59 -04:00
Tom Alexander
9d6ddfd1bd Merge branch 'linfi' 2024-10-13 20:48:29 -04:00
Tom Alexander
117769d1ab Set up a linux VM for running wifi. 2024-10-13 20:45:33 -04:00
Tom Alexander
91a138ab9d Add my custom ports. 2024-10-12 13:17:02 -04:00
Tom Alexander
9a27184885 Update router vm scripts. 2024-10-10 19:03:11 -04:00
Tom Alexander
40b0d2c684 An attempt at a merged command. 2024-10-10 18:12:39 -04:00
Tom Alexander
6d0bc958a9 Update cast_file incantations. 2024-10-09 21:09:11 -04:00
Tom Alexander
e38bee4c0f Use bbr for tcp congestion on FreeBSD, install ectool on framework laptop linux, and assign an ipv6 address in mrmanager. 2024-10-09 19:44:09 -04:00
Tom Alexander
5a08b3e0bd Update command to route private kubernetes services. 2024-10-06 21:34:12 -04:00
Tom Alexander
acf4951047 Update custom ports location. 2024-10-06 17:32:07 -04:00
Tom Alexander
9413f5dce8 Optimize Go programs and add IPv6 to mrmanager. 2024-10-06 17:32:06 -04:00
Tom Alexander
913d2e9f15 Fix certificates for bastion. 2024-10-04 21:22:55 -04:00
Tom Alexander
bb66c9a907 Update rust. 2024-09-30 19:17:30 -04:00
Tom Alexander
5331552759 Enable cranelift on linux for compiling rust faster.
This is based on https://bjorn3.github.io/2023/10/31/progress-report-oct-2023.html.
2024-09-29 22:16:12 -04:00
Tom Alexander
8e5034a393 Add a test for the freezing display issue. 2024-09-29 03:59:55 -04:00
Tom Alexander
14fa62c64a Add a role to configure chromium to run on Vulkan. 2024-09-24 22:22:13 -04:00
Tom Alexander
15d65c3f21 Adjust network ttl. 2024-09-12 14:47:17 -04:00
Tom Alexander
00bbded91c libclc does not have a znver4 because its based on llvm 15. 2024-09-06 11:52:56 -04:00
Tom Alexander
c58257538a Zoom in when screen sharing. 2024-09-03 19:32:42 -04:00
Tom Alexander
e2a434bde0 Update keyboard layout. 2024-08-28 18:20:34 -04:00
Tom Alexander
077155f835 Add windows vm to FreeBSD on laptop. 2024-08-28 18:20:33 -04:00
Tom Alexander
aec97a5df6 Add jail for momlaptop. 2024-08-17 19:30:14 -04:00
Tom Alexander
20768edcf6 Fix night mode signal handling.
Now the script works on both FreeBSD and Linux, and it exits properly so switching between docked and undocked doesn't cause problems for waybar.
2024-08-13 20:14:09 -04:00
Tom Alexander
8175cf443a Set up zsh on poudriere.
This is to save a better command history.
2024-08-11 12:56:35 -04:00
Tom Alexander
075a768424 Remove igt-gpu-tools.
This depends on oping which has been failing to build for a while.
2024-08-10 11:19:41 -04:00
Tom Alexander
621625d831 Tint the screen at night. 2024-07-28 15:03:57 -04:00
Tom Alexander
3a63d4d307 Fix firefox fingerprint protection. 2024-07-21 11:25:51 -04:00
Tom Alexander
1e47ff3f64 Add more streaming commands. 2024-07-18 23:29:07 -04:00
Tom Alexander
31bf399b51 Switch to tcp streaming. 2024-07-17 19:46:43 -04:00
Tom Alexander
9029508c58 Fix dark mode in firefox. 2024-07-16 20:13:20 -04:00
Tom Alexander
22d90ae79b Simplify iwd conf. 2024-07-15 19:26:14 -04:00
Tom Alexander
6420db5385 Pipe not working. 2024-07-14 12:18:59 -04:00
Tom Alexander
0a4ee7b7f6 Support different vnc resolutions in bhyve. 2024-07-14 12:18:58 -04:00
Tom Alexander
5d1c1e2e19 Switch to manual dummynet rc.d implementation.
The existing one does not seem to work.
2024-07-13 14:05:14 -04:00
Tom Alexander
043061fb16 Switch to opus for streaming. 2024-07-13 13:51:49 -04:00
Tom Alexander
076b8d296f Add software vp8 live cast. 2024-07-13 13:15:04 -04:00
Tom Alexander
6be368a1e8 Enable ipv6 on homeserver. 2024-07-12 23:03:53 -04:00
Tom Alexander
0e2c7adaf9 Prefer ipv6. 2024-07-12 19:58:50 -04:00
Tom Alexander
f6152d92f1 Add sleep to shutting down jails. 2024-07-07 18:09:15 -04:00
Tom Alexander
ab572079ac Add CLI for chromecast. 2024-07-06 20:05:46 -04:00
Tom Alexander
5fe48c2587 Add mediamtx vm. 2024-07-06 20:05:46 -04:00
Tom Alexander
a9d687448d Rebuilt unifi vm on router. 2024-07-06 14:07:04 -04:00
Tom Alexander
930beb8642 Update homeserver to pass both udp and tcp. 2024-07-06 11:36:49 -04:00
Tom Alexander
640d300adc limiting bandwidth on laptop. 2024-07-04 21:08:52 -04:00
Tom Alexander
b643f86313 Enable firewall for laptop on FreeBSD. 2024-07-04 19:02:03 -04:00
Tom Alexander
664af21ad5 Add a dummynet role. 2024-07-04 19:02:03 -04:00
Tom Alexander
63a966947b Add pkgbase_diff script. 2024-07-04 14:44:32 -04:00
Tom Alexander
fb679924bc Enable ipv6 privacy extensions and build ipfw for dummynet. 2024-07-04 01:31:07 -04:00
Tom Alexander
fb90c63d84 Enable quic and add CUSTOM kernel. 2024-07-04 00:45:54 -04:00
Tom Alexander
9e107d4a75 Add bastion and certificate jails. 2024-07-03 20:50:51 -04:00
Tom Alexander
566b7dfd0b Add sftp jail. 2024-07-01 19:58:00 -04:00
Tom Alexander
0363a462a0 Support launching old dagger. 2024-06-30 17:16:14 -04:00
Tom Alexander
f09844c03c Use latest packages in jails. 2024-06-30 17:16:13 -04:00
Tom Alexander
2042719a3c Upgrade to FreeBSD 14.1 2024-06-30 00:56:32 -04:00
Tom Alexander
9dc43479aa Add sftp jail. 2024-06-29 23:32:36 -04:00
Tom Alexander
62e70554be Migrate to abbreviated jail folder structure. 2024-06-29 16:58:47 -04:00
Tom Alexander
bc29fd5428 Update disk label settings. 2024-06-29 14:31:08 -04:00
Tom Alexander
b9620382a7 Disable tmux mouse. 2024-06-28 11:08:05 -04:00
Tom Alexander
67b777c432 Add whois. 2024-06-26 21:22:15 -04:00
Tom Alexander
8cc24f4923 Enable diskid in FreeBSD. 2024-06-25 17:43:17 -04:00
Tom Alexander
96e09db1dd Add support for hardware video decoding in FreeBSD. 2024-06-25 17:33:16 -04:00
Tom Alexander
8288039264 Remove amd_pstate=passive, install nvtop on Linux, force-enable hardware decoding in firefox.
The fan was spinning up a bunch so I am going to go back to amd_pstate=active.
2024-06-24 22:04:03 -04:00
Tom Alexander
5d0fdd341a Install terraform. 2024-06-23 18:26:54 -04:00
Tom Alexander
b0a2086b6c Add support for urlsafe base64 in decode_jwt. 2024-06-21 19:23:08 -04:00
Tom Alexander
78ea5dc244 Add a workaround for framework 13 firmware bug causing 100% usage on a single core.
ref: https://community.frame.work/t/tracking-amd-small-group-of-kworkers-keeping-cpu-0-busy-after-suspend-resume-cycle-s/45002
2024-06-20 19:31:49 -04:00
Tom Alexander
d3c397acf0 Add decode_jwt script, install kubeswitch on linux, unfreeze firefox version on linux, disable more bits of currentznver4 FreeBSD build, install terminfo-db, and remove build configs from old version of poudboot. 2024-06-19 19:29:14 -04:00
Tom Alexander
5823ca90f1 Add xml formatting to emacs. 2024-06-03 18:59:16 -04:00
Tom Alexander
c36568462f Add support for clangd for c languages in emacs. 2024-06-02 12:09:45 -04:00
Tom Alexander
e469ed8b9a Add power saving settings. 2024-06-02 11:33:08 -04:00
Tom Alexander
967f7dac16 Fix temperature waybar on Linux. 2024-05-20 19:17:48 -04:00
Tom Alexander
38d255f0ab Set up multiple sound server options for FreeBSD. 2024-05-18 09:52:18 -04:00
Tom Alexander
f44074ebe7 Only scrub when plugged in on Linux, and TCP optimization. 2024-05-16 21:20:30 -04:00
Tom Alexander
ee0fe7eca6 Use group root for /etc/localtime on Linux.
Arch Linux kept changing the group to root, so this change is to avoid unexpected "changed" entries in the ansible diff.
2024-05-12 23:23:09 -04:00
Tom Alexander
c7610fe917 Build jack. 2024-05-10 18:51:17 -04:00
Tom Alexander
5fa7f918a1 Refresh clock on the minute instead of every 10 seconds. 2024-05-07 08:52:34 -04:00
Tom Alexander
a2bdb93d5e Switch FreeBSD back to the package-based rust-analyzer. 2024-05-05 22:19:27 -04:00
Tom Alexander
5a763d422a Switch to rust implementation of poudboot. 2024-05-05 22:19:27 -04:00
Tom Alexander
44fd819705 Add radeontop to FreeBSD. 2024-05-05 11:19:03 -04:00
Tom Alexander
faa9b7bb62 Switch to the FreeBSD built-in lockf instead of the package flock. 2024-05-04 12:23:56 -04:00
Tom Alexander
06fb8db40a Disable sndio in firefox. 2024-04-30 21:34:52 -04:00
Tom Alexander
a97b503f8e Add support for noise suppression on Linux using rnnoise.
This uses: https://github.com/werman/noise-suppression-for-voice .
2024-04-29 10:47:28 -04:00
Tom Alexander
c650b9626f Disable pulseaudio in firefox. 2024-04-28 16:28:55 -04:00
Tom Alexander
a7fe423583 Update for FreeBSD on AMD Framework laptop. 2024-04-28 15:08:36 -04:00
Tom Alexander
32eca75f4e Set up home server. 2024-04-22 17:23:20 -04:00
Tom Alexander
f1b3e3a81f Set MTU on wireguard configs. 2024-04-19 17:56:07 -04:00
Tom Alexander
736e83a465 Use wayland for vscode. 2024-04-12 19:06:00 -04:00
Tom Alexander
c2b8ab05b1 Move to new cargo credentials path. 2024-04-11 21:36:49 -04:00
Tom Alexander
8b4a5e0847 Move cleaning to a global position. 2024-04-11 20:20:49 -04:00
Tom Alexander
ef18e94ff8 Add a poudriere build for the home server. 2024-04-11 19:57:02 -04:00
Tom Alexander
6d198d290d Enable vulkan for sway on linux. 2024-04-06 22:09:23 -04:00
Tom Alexander
df81196035 Add script to delete pipeline runs from tekton. 2024-04-06 11:29:38 -04:00
Tom Alexander
08454740d6 Merge branch 'pkgbase' 2024-04-06 11:01:02 -04:00
Tom Alexander
a66eff79e2 Set up poudriere to build pkgbase. 2024-04-06 11:00:20 -04:00
Tom Alexander
8385b036a6 Add terraform format-on-save for vscode. 2024-02-06 17:57:20 -05:00
Tom Alexander
ed7d4ab4e6 Run emacs garbage collection when idle.
This is to hopefully avoid running garbage collection while I am actively interacting with emacs, which should theoretically result in a smoother experience.
2024-01-26 21:21:09 -05:00
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
Tom Alexander
6b3bdab18b Configure vscode. 2024-01-18 22:43:56 -05:00
Tom Alexander
4d620a33b7 Add closed source vscode. 2024-01-18 22:12:08 -05:00
Tom Alexander
e3e78b3eb5 Add a force focus mode to sway. 2024-01-10 22:21:11 -05:00
Tom Alexander
3706eda8f3 Use meld for git merges. 2024-01-10 22:20:30 -05:00
Tom Alexander
6fc16362ba Use docker compose for unifi controller. 2024-01-09 19:11:39 -05:00
Tom Alexander
a04b52ec72 Add a unifi vm. 2024-01-09 17:31:12 -05:00
Tom Alexander
460a614cf7 Set up the router manually. 2024-01-08 23:14:23 -05:00
Tom Alexander
3e0de0e87a Add a work-specific role. 2024-01-07 14:43:10 -05:00
Tom Alexander
80a3f2291c Add a separate pgp key for work. 2024-01-02 12:29:39 -05:00
Tom Alexander
6e13ac355a Add a work machine to ansible. 2023-12-31 22:21:28 -05:00
Tom Alexander
60e440b0c6 Migrate alacritty to toml config. 2023-12-28 12:50:05 -05:00
Tom Alexander
06fc236f0a Add a python role. 2023-12-25 15:26:42 -05:00
Tom Alexander
1cad73e68f Add the launch keyboard layout file.
This file is not installed by ansible but it is something I should preserve for configuring the keyboard.
2023-12-25 11:22:06 -05:00
Tom Alexander
a1ab3327ee Add wasm role. 2023-12-24 12:54:16 -05:00
Tom Alexander
86ecfd1c54 Run prettier on save to format css files. 2023-12-23 06:13:49 -05:00
Tom Alexander
cd58cbb520 Set up the CSS language server. 2023-12-22 21:45:38 -05:00
Tom Alexander
7dc1a22e6b Force the screen brightness level on the framework laptop in Linux.
Ever since enabling adaptive brightness manager, my brightness is far lower on reboot. I suspect it is saving the actual brightness instead of the set brightness. This works around the issue by forcing the brightness back to my desired level.
2023-12-22 21:43:53 -05:00
Tom Alexander
b3ee528c18 Merge branch 'epp_amd' 2023-12-19 09:22:56 -05:00
Tom Alexander
9ac2605912 Also set the platform profile for AMD.
The platform profile sets power settings for the EC/system but not the CPU.
2023-12-19 08:51:25 -05:00
Tom Alexander
c87ac216a9 Set the energy performance preference for AMD. 2023-12-18 20:08:06 -05:00
Tom Alexander
94b379c717 Fix conditional to not use jinja templating. 2023-12-17 12:33:30 -05:00
Tom Alexander
661b8534a8 Add auto-revert mode. 2023-12-17 11:51:41 -05:00
Tom Alexander
f42d4c469b Update rust. 2023-12-08 15:30:37 -05:00
Tom Alexander
ebde072f2c Install radeontop on AMD graphics. 2023-12-08 13:05:32 -05:00
Tom Alexander
a7fe6ff42d Update Linux framework laptop for AMD board.
Unfortunately, FreeBSD does not seem to boot so it is not being updated in this commit.
2023-12-07 17:45:18 -05:00
Tom Alexander
9d54609a12 TEMP change to use mainline kernel instead of LTS for AMD board. 2023-12-07 16:57:56 -05:00
Tom Alexander
0146c631ae Trust additional zfs signing key. 2023-12-07 16:57:56 -05:00
Tom Alexander
86a89be678 Add pipewire jack replacement. 2023-12-07 16:57:56 -05:00
Tom Alexander
644b0f2e00 Add devfs rules for homeserver. 2023-12-07 16:57:56 -05:00
Tom Alexander
4b62c9b4de Add a script to decrypt and mount disks on the home server. 2023-12-07 16:57:56 -05:00
Tom Alexander
0732a82171 Updates for FreeBSD 14. 2023-12-07 16:57:56 -05:00
Tom Alexander
e80cdcabdb Add restaurant_health_rating. 2023-12-07 16:57:56 -05:00
Tom Alexander
05e06d1615 Remove extra subkey from linux build key. 2023-12-07 16:57:55 -05:00
Tom Alexander
68e84fdd77 Add node version manager (nvm) and minor fixes. 2023-11-14 15:05:16 -05:00
Tom Alexander
48bdb12e77 Change package name for google cloud sdk on linux. 2023-10-26 21:14:41 -04:00
Tom Alexander
ec72d20455 Fix building ZFS on linux. 2023-10-26 21:14:41 -04:00
Tom Alexander
7f47b1ca1b Enable web-mode for dust files. 2023-10-24 00:59:47 -04:00
Tom Alexander
5fcb37591c Add guard rails to the cpu_set_perf_perc script for FreeBSD. 2023-10-23 20:10:58 -04:00
Tom Alexander
3f0b8162b8 Add cargo-semver-checks to linux. 2023-10-18 12:53:33 -04:00
Tom Alexander
b90ec542de Switch to overlay2 for docker.
The latest OpenZFS supports overlay2 on top of ZFS which works much better than the zfs storage driver for docker.
2023-10-18 09:43:58 -04:00
Tom Alexander
16b7a200de Merge branch 'custom_freebsd' 2023-10-18 09:18:54 -04:00
Tom Alexander
e3e7de8eb1 The SHARED_TOOLCHAIN option was removed in FreeBSD 14. 2023-10-16 19:52:37 -04:00
Tom Alexander
51e5917e43 Remove MODULES_WITH_WORLD. 2023-10-16 19:52:37 -04:00
Tom Alexander
2d260dec90 Update the FreeBSD version. 2023-10-16 19:52:37 -04:00
Tom Alexander
72a8d6f615 Build the ports modules with world instead of just with the kernel.
I'm hoping this fixes an issue where the chroot for building the ports only contains the kernel files and therefore lacks /bin/sh.
2023-10-16 19:52:37 -04:00
Tom Alexander
34ffd5c100 Build FreeBSD for tigerlake on freebsdupdate.
I think I need to move to specifying separate src.conf files for each build but I am going to get this working in a simple setup first.
2023-10-16 19:52:37 -04:00
Tom Alexander
da36f1b3d8 Update build_release script to update the virtual machine OS. 2023-10-16 19:52:37 -04:00
Tom Alexander
1c922c2234 Set up a separate FreeBSD update VM.
It seems to compile the ports kernel modules into the OS, I need to be running the same kernel version as I am building, so I am putting it into its own VM.
2023-10-16 19:52:36 -04:00
Tom Alexander
d56132618a Enable guc for hw accelerated encoding for wl-screenrec. 2023-10-16 19:52:36 -04:00
Tom Alexander
575d4360f1 Build current instead of 13.2. 2023-10-16 19:52:36 -04:00
Tom Alexander
e7328f2865 Use /etc/make.conf and /etc/src.conf. 2023-10-16 19:52:36 -04:00
Tom Alexander
6be5ad6b3d Add a manual implementation of building a release. 2023-10-16 19:52:36 -04:00
Tom Alexander
44d3cc61f5 Add release.conf. 2023-10-16 19:52:36 -04:00
Tom Alexander
d20ce1e4d4 TEMP: Add the freebsd_update_server role to odofreebsd for development. 2023-10-16 19:52:36 -04:00
Tom Alexander
ae43050061 Install clippy on linux. 2023-10-16 19:52:35 -04:00
Tom Alexander
7ecf2ef1b1 Check out the freebsd-update-build git repo. 2023-10-16 19:52:35 -04:00
Tom Alexander
05c3b0c1dc Update rust. 2023-10-16 19:52:35 -04:00
Tom Alexander
fccb2312da Start an ansible role for running a custom freebsd-update server. 2023-10-16 19:52:35 -04:00
Tom Alexander
47c36a82bf Remove the sorting in company.
It wasn't really that much of an improvement.
2023-10-16 19:52:35 -04:00
Tom Alexander
112cba2b8c Add more ports to be built along with the kernel. 2023-10-16 19:52:35 -04:00
Tom Alexander
1a017cfac7 Add more task templates to the blank role. 2023-10-16 19:52:35 -04:00
Tom Alexander
eae6737d76 Slightly better result sorting in company. 2023-10-15 16:01:45 -04:00
Tom Alexander
c652e60619 Move emacs config to .config/emacs. 2023-10-12 15:30:40 -04:00
Tom Alexander
b94e13d63e Add some emacs settings from https://idiomdrottning.org/bad-emacs-defaults . 2023-10-12 15:30:40 -04:00
Tom Alexander
68139849f6 Switch from corfu to company.
It seems corfu is causing problems with eglot: https://github.com/joaotavora/eglot/discussions/1127.
2023-10-12 15:30:40 -04:00
Tom Alexander
8975324e7c Turn off screen when idle. 2023-10-11 23:04:07 -04:00
Tom Alexander
e5fd4bf9e6 Show the full org-mode links. 2023-10-06 20:21:41 -04:00
Tom Alexander
a0666e6904 Update pacman.conf for aurutils. 2023-10-06 20:21:41 -04:00
Tom Alexander
a97378654e Add a CNAME for stream. 2023-10-04 09:24:07 -04:00
Tom Alexander
f28f542d4d Force plain rendering for github links.
When linking to a document that renders like markdown or org-mode, we need the plain parameter to get the link to actually go to a line of code.
2023-10-02 19:48:00 -04:00
Tom Alexander
9d118078ae Add support for generating source hut links. 2023-09-30 01:02:15 -04:00
Tom Alexander
c2a0f90b4f Fix delete-selection-mode setting. 2023-09-27 15:01:52 -04:00
Tom Alexander
6f3c5ca025 Remove explicit pinentry setting. 2023-09-27 13:19:26 -04:00
Tom Alexander
49fa0eb9cc Disable on-type formatting in rust.
This was injecting parenthesis into the wrong location.
2023-09-21 16:57:09 -04:00
Tom Alexander
e4b10e7260 Remove extra subkey from pgp key. 2023-09-21 16:30:34 -04:00
Tom Alexander
a536defe9a Update pgp public key. 2023-09-21 13:28:35 -04:00
Tom Alexander
c7b8b4c510 Use go-mod-ts-mode. 2023-09-14 15:47:30 -04:00
Tom Alexander
34cd3b7aa4 Defer the loading of edit-indirect via :commands. 2023-09-14 15:21:39 -04:00
Tom Alexander
1f18074e29 Remove Flymake substring from emacs mode line. 2023-09-14 15:00:09 -04:00
Tom Alexander
971ed7e75d Add pixel precision to plainmacs. 2023-09-14 14:33:38 -04:00
Tom Alexander
35709eb06a Enable shellcheck in bash-ts-mode. 2023-09-14 14:25:42 -04:00
Tom Alexander
25c2f2753b Disable keybind in org-bullets. 2023-09-14 13:39:46 -04:00
Tom Alexander
fa1ed38678 Disable systemd-udev-settle on Linux on framework laptop. 2023-09-14 13:33:33 -04:00
Tom Alexander
beb8781b5c Only install gnome-firmware on graphical installs. 2023-09-12 15:07:38 -04:00
Tom Alexander
deb977de09 Merge branch 'launch' 2023-09-10 18:43:13 -04:00
Tom Alexander
21c664d2c0 Install a polkit agent in the launch keyboard role. 2023-09-10 18:38:09 -04:00
Tom Alexander
754c84ad89 Add a lvfs role for Linux. 2023-09-10 18:28:32 -04:00
Tom Alexander
a54c966ad0 Install the launch keyboard configurator. 2023-09-10 18:25:36 -04:00
Tom Alexander
babf3bb971 No idea. 2023-09-09 17:10:52 -04:00
Tom Alexander
2fc923837f Install system76 tools. 2023-09-09 17:08:36 -04:00
Tom Alexander
84e370bd94 Do not sleep the launch keyboard on Linux. 2023-09-09 16:49:15 -04:00
Tom Alexander
ef59593ef3 Merge branch 'cleanup_emacs' 2023-09-09 16:48:35 -04:00
Tom Alexander
db30ae976a Remove the old settings. 2023-09-09 04:57:39 -04:00
Tom Alexander
b86d7813a9 Add some default settings for rust-analyzer. 2023-09-09 03:47:56 -04:00
Tom Alexander
db5b400408 Locate rust-analyzer on the /home/talexander/.pyenv/shims:/opt/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin. 2023-09-09 02:47:20 -04:00
Tom Alexander
d229447149 Re-enable some settings. 2023-09-09 01:44:01 -04:00
Tom Alexander
8707a7941a Disable most of base.el settings.
I will be re-enabling bits as I find I need them.
2023-09-09 00:33:17 -04:00
Tom Alexander
01c5571da0 Remove duplicate setting. 2023-09-08 16:38:43 -04:00
Tom Alexander
e0b5e893d8 Use page-break-lines mode and remove ediff. 2023-09-08 15:58:55 -04:00
Tom Alexander
993e773414 Disable logging of LSP traffic. 2023-09-08 11:55:56 -04:00
Tom Alexander
ed25cd6d31 Move elisp into a folder and switch to emacs-wayland on linux. 2023-09-08 11:26:46 -04:00
Tom Alexander
c9617dd3cc Update cargo credentials. 2023-09-06 17:06:51 -04:00
Tom Alexander
61bc98578b Install CPU microcode updates on Intel on FreeBSD and switch from wf-recorder to wl-screenrec. 2023-09-05 21:17:09 -04:00
Tom Alexander
7f0af6f41c Add scripts to trigger actions in the poudriere loop. 2023-09-04 11:26:28 -04:00
Tom Alexander
8744f8f547 Only run the cleanup when updating ports. 2023-09-04 11:09:24 -04:00
Tom Alexander
955f3cd329 Update rust version. 2023-09-04 11:06:40 -04:00
Tom Alexander
a6af4eee2f Add some scripts for investigating the ports tree options. 2023-09-01 14:38:17 -04:00
Tom Alexander
5e81006208 Reduce poudriere log retention to 30 days. 2023-09-01 11:25:36 -04:00
Tom Alexander
0f054f819f Merge branch 'poudriere_build_static' 2023-09-01 11:16:59 -04:00
Tom Alexander
383894bd3f Disable static on some problem ports. 2023-09-01 10:40:05 -04:00
Tom Alexander
767b925705 Build static binaries with link-time optimization enabled. 2023-08-29 09:24:21 -04:00
Tom Alexander
87ff51a517 Write down some options I'd like to experiment with in building FreeBSD. 2023-08-29 09:24:21 -04:00
Tom Alexander
1378d56924 Add script to delete a poudriere jail. 2023-08-27 16:29:27 -04:00
Tom Alexander
d0ba7ac54b Merge branch 'emacs29' 2023-08-27 14:04:37 -04:00
Tom Alexander
7b512256ec Enable pgtk and native comp for emacs. 2023-08-25 18:11:02 -04:00
Tom Alexander
51fb2ce364 Spelling mistake. 2023-08-21 00:25:51 -04:00
Tom Alexander
623ae1f55f Use the typescript language server for javascript. 2023-08-21 00:25:51 -04:00
Tom Alexander
82777c2265 Emacs 29 has been released! Remove building from the aur. 2023-08-21 00:25:51 -04:00
Tom Alexander
762831b4ec Add a desktop file for plainmacs on Linux. 2023-08-21 00:25:51 -04:00
Tom Alexander
c1e3b8fc4e Combine plainmacs and emacs roles. 2023-08-21 00:25:50 -04:00
Tom Alexander
cb84d7d810 Launch nginx-mode for headers.include. 2023-08-21 00:25:50 -04:00
Tom Alexander
cfdbb50de0 Add support for lsp for typescript. 2023-08-21 00:25:50 -04:00
Tom Alexander
e3a1e69fb5 Update toml for emacs29. 2023-08-21 00:25:50 -04:00
Tom Alexander
3f1c45ac0a Update js and css for emacs29. 2023-08-21 00:25:50 -04:00
Tom Alexander
8e76c38f23 Update json for emacs29. 2023-08-21 00:25:50 -04:00
Tom Alexander
ac95e4b889 Update typescript and tsx for emacs29. 2023-08-21 00:25:50 -04:00
Tom Alexander
6559f212c0 Delete C/C++ from emacs.
I rarely edit C/C++ so I'll dive into updating this for emacs29 the next time its relevant.
2023-08-21 00:25:50 -04:00
Tom Alexander
4b21ed49f1 Set a default treesit-language-source-alist. 2023-08-21 00:25:49 -04:00
Tom Alexander
e0768d1460 Remove rust-mode. 2023-08-21 00:25:49 -04:00
Tom Alexander
3bd6af7427 Remove dockerfile-mode. 2023-08-21 00:25:49 -04:00
Tom Alexander
45903fda14 Remove yaml-mode. 2023-08-21 00:25:49 -04:00
Tom Alexander
04b70049c4 Remove go-mode. 2023-08-21 00:25:49 -04:00
Tom Alexander
f5e84d6dcc Update go for emacs29. 2023-08-21 00:25:49 -04:00
Tom Alexander
10e63f2a94 No changes to lua for emacs29. 2023-08-21 00:25:49 -04:00
Tom Alexander
87589748c2 No changes to terraform for emacs29. 2023-08-21 00:25:49 -04:00
Tom Alexander
d7326706a3 No changes for markdown for emacs29. 2023-08-21 00:25:48 -04:00
Tom Alexander
063b0a0d92 Update bash for emacs29. 2023-08-21 00:25:48 -04:00
Tom Alexander
cd02a14792 Update python for emacs29. 2023-08-21 00:25:48 -04:00
Tom Alexander
1bed94b1b1 No changes to org-mode setup for emacs 29. 2023-08-21 00:25:48 -04:00
Tom Alexander
cfc1a81a49 Update dockerfile support to use treesitter. 2023-08-21 00:25:48 -04:00
Tom Alexander
57ddfaad6f Only install treesitter languages once. 2023-08-21 00:25:48 -04:00
Tom Alexander
5096449cf5 Install prettier on Linux. 2023-08-21 00:25:48 -04:00
Tom Alexander
64b8a3258b Remove LSP from yaml. 2023-08-21 00:25:48 -04:00
Tom Alexander
c5cc2a36e1 Move the definition of treesitter grammars to the init block. 2023-08-21 00:25:47 -04:00
Tom Alexander
df75bf53e6 Move the treesitter language source list into the use-package block. 2023-08-21 00:25:47 -04:00
Tom Alexander
0eb5a8cc2b Move the major mode remap for treesitter into the use-package block. 2023-08-21 00:25:47 -04:00
Tom Alexander
68bd5818ae Disable all non-rust language configs in emacs.
I will re-enable these one-by-one as I update them for emacs29.
2023-08-21 00:25:47 -04:00
Tom Alexander
7761267bb4 Set the treesitter highlighting detail level to the max. 2023-08-21 00:25:47 -04:00
Tom Alexander
6c1adbef04 Cut down the tree sitter langs to just rust. 2023-08-21 00:25:47 -04:00
Tom Alexander
cb63ab4b1f Use treesitter for rust. 2023-08-21 00:25:47 -04:00
Tom Alexander
ba21ec24b8 Install rust-analyzer on Linux. 2023-08-21 00:25:47 -04:00
Tom Alexander
990add4ddf Snapshot the VMs on homeserver. 2023-08-21 00:25:46 -04:00
Tom Alexander
ec44eb5960 Use built-in use-package and eglot. Disable external tree-sitter. 2023-08-21 00:25:46 -04:00
Tom Alexander
cb383ead75 Switch to emacs 29 on Linux. 2023-08-21 00:25:46 -04:00
Tom Alexander
e478ca56aa Support omitting datasets from automatic snapshotting. 2023-08-20 23:12:20 -04:00
Tom Alexander
221e91a56a Merge branch 'usb_autosuspend' 2023-08-20 22:37:15 -04:00
Tom Alexander
e1e95fa205 Only need the autosuspend rule. 2023-08-20 13:21:54 -04:00
Tom Alexander
be5a5018c0 Working udev rules. 2023-08-20 13:17:19 -04:00
Tom Alexander
fcf32657c3 Disable usb autosuspend for keyboard and mouse.
USB auto suspend seems to only happen when the devices are plugged in at boot (which generally means when my laptop is connected to the dock before boot) but it is very annoying because some keypresses get lost and my mouse does not work unless I click first.
2023-08-16 15:51:48 -04:00
Tom Alexander
3f734cbfcc Add a TODO file. 2023-08-14 16:14:40 -04:00
Tom Alexander
10758b0f2f Switch to using ntpd instead of ntpdate on FreeBSD.
Long-running servers were eventually skewing their time.
2023-08-13 22:11:02 -04:00
Tom Alexander
f7ff982098 Add sleep before reboot 2023-08-13 20:48:37 -04:00
Tom Alexander
c0250ac00d Make running snapshots of the virtual machines. 2023-08-13 18:13:07 -04:00
Tom Alexander
bfee369ad8 Add a sleep to the bhyve management script to hopefully avoid bad states. 2023-08-13 18:01:27 -04:00
Tom Alexander
e7b4bb9a4b Merge branch 'dark_theme' 2023-08-13 16:18:32 -04:00
Tom Alexander
3751629166 Enable dark theme.
This should hopefully carry over into the browser and such so I don't get blinded.
2023-08-13 16:17:53 -04:00
Tom Alexander
6c9e458278 Install pavucontrol on FreeBSD. 2023-08-13 13:57:20 -04:00
Tom Alexander
e84fd15cf2 Add support for controlling turbo boost in the set cpu perf perc script. 2023-08-12 21:35:30 -04:00
Tom Alexander
40437bec04 Disable hard-coded www dns entry. 2023-08-12 20:19:14 -04:00
Tom Alexander
8bad10eace Fix a variable name in the bhyve netgraph script. 2023-08-08 14:46:03 -04:00
Tom Alexander
8a3855fddd Add mole to mrmanager. 2023-08-02 18:15:22 -04:00
Tom Alexander
fb9d5e2043 Add machines to dhcp. 2023-08-02 16:48:09 -04:00
Tom Alexander
ff02354107 Disable wev on FreeBSD.
The wev port has been broken for weeks.
2023-07-30 14:38:08 -04:00
Tom Alexander
8bdae45e6c Enable wayland for firefox in Linux. 2023-07-28 14:45:18 -04:00
Tom Alexander
7960699636 Add a git alias "git amend".
This allows us to generate a new git commit hash without changing the commit contents which is useful for triggering CI workflows.
2023-07-24 16:44:23 -04:00
Tom Alexander
1badd8049e Disabling the vulkan sway renderer on Linux again.
The flickering in alacritty is getting annoying.
2023-07-18 19:33:18 -04:00
Tom Alexander
8424abdfa9 Switch k8s_snapshot to using arrays. 2023-07-18 17:47:42 -04:00
Tom Alexander
b9a199c5f5 Switch to converting to an array directly.
This eliminates the the middle step of converting to a string with a different IFS which should be more efficient.
2023-07-18 17:13:58 -04:00
Tom Alexander
0c23b46426 Add a script for rolling back k8s snapshots. 2023-07-18 17:13:58 -04:00
Tom Alexander
67d8dc3f5c Switch from dbus-launch to dbus-run-session. 2023-07-18 15:40:12 -04:00
Tom Alexander
808b087a82 Install a script to snapshot the k8s bhyve virtual machines and persistent volume space. 2023-07-18 15:31:52 -04:00
Tom Alexander
bdff61d8e9 Change git default branch to main. 2023-07-18 15:04:24 -04:00
Tom Alexander
a025770fe7 Update kshell to manage the pod itself so I can use registry pull secrets to use my harbor pull-through cache. 2023-07-14 15:33:44 -04:00
Tom Alexander
6bde027c48 Add a script to update git aurutil packages. 2023-07-14 14:29:03 -04:00
Tom Alexander
cd6d8f3f69 Switch to using bash traps to destroy bhyve vms. 2023-07-14 14:28:36 -04:00
Tom Alexander
fb759470f5 Make poudboot service file not hang startup by launching with daemon. 2023-07-14 14:28:36 -04:00
Tom Alexander
c61d4bdc75 Update kx and ks aliases to use kubeswitch. 2023-07-14 14:28:36 -04:00
Tom Alexander
41397cb7d5 Update rust. 2023-07-14 14:28:35 -04:00
Tom Alexander
9bbc5591c1 Add /usr/local/bin to PATH for poudboot. 2023-07-11 03:53:06 -04:00
480 changed files with 10085 additions and 2137 deletions

2
.gitattributes vendored
View File

@@ -1,3 +1,5 @@
cargo_credentials.toml filter=git-crypt diff=git-crypt cargo_credentials.toml filter=git-crypt diff=git-crypt
**/wireguard_configs/** filter=git-crypt diff=git-crypt **/wireguard_configs/** filter=git-crypt diff=git-crypt
*.key filter=git-crypt diff=git-crypt *.key filter=git-crypt diff=git-crypt
credentials filter=git-crypt diff=git-crypt
htpasswd filter=git-crypt diff=git-crypt

5
TODO.org Normal file
View File

@@ -0,0 +1,5 @@
* to-do
** Switch to overlay driver when zfs 2.2 is released
This might fix some stability issues (like a container getting stuck in a terminating state), may improve performance (since the zfs driver is noticably slower than overlay on ext4 on a zvol), and will avoid a lot of noise in my zfs dataset lists
ref: https://github.com/moby/moby/issues/40132

View File

@@ -1,8 +1,11 @@
os_flavor: "freebsd" os_flavor: "freebsd"
zfs_snapshot_datasets: zfs_snapshot_datasets:
- zroot/freebsd/main/be - path: zroot/freebsd/main/be
- path: zdata/vm
- path: zdata/vm/poudriere/disk0
include: false
- path: zdata/k8spersistent
sshd_enabled: true sshd_enabled: true
loader_conf: "mrmanager_loader.conf"
rc_conf: "mrmanager_rc.conf" rc_conf: "mrmanager_rc.conf"
network_rc: "mrmanager_network.conf" network_rc: "mrmanager_network.conf"
routing_rc: "mrmanager_routing.conf" routing_rc: "mrmanager_routing.conf"
@@ -10,13 +13,16 @@ pf_config: "mrmanager_pf.conf"
pflog_conf: pflog_conf:
- name: 0 - name: 0
dev: pflog0 dev: pflog0
- name: 1
dev: pflog1
cputype: "amd" cputype: "amd"
hwpstate: true
etc_hosts: {} etc_hosts: {}
wireguard_directory: mrmanager wireguard_directory: mrmanager
enabled_wireguard: enabled_wireguard:
- colo - colo
jail_zfs_dataset: zdata/jail jail_zfs_dataset: zdata/jail
jail_zfs_dataset_mountpoint: /jail/main jail_zfs_dataset_mountpoint: /jail
jail_canmount: "on" jail_canmount: "on"
jail_list: jail_list:
- name: nat_dhcp - name: nat_dhcp
@@ -35,3 +41,14 @@ bhyve_dataset: zdata/vm
bhyve_canmount: "on" bhyve_canmount: "on"
# efi_dev: /dev/gpt/EFI # efi_dev: /dev/gpt/EFI
devfs_rules: "mrmanager_devfs.rules" devfs_rules: "mrmanager_devfs.rules"
users:
talexander:
initialize: true
uid: 11235
gid: 11235
groups:
- name: wheel
authorized_keys:
- yubikey
- main_fido
- backup_fido

View File

@@ -1,2 +1,3 @@
[server] [server]
mrmanager ansible_user=talexander ansible_host=10.217.2.1 #mrmanager ansible_user=talexander ansible_host=10.217.2.1 ansible_become_method=doas
mrmanager ansible_user=talexander ansible_host=74.80.180.138 ansible_become_method=doas

View File

@@ -1,8 +1,29 @@
os_flavor: "freebsd" os_flavor: "freebsd"
zfs_snapshot_datasets: zfs_snapshot_datasets:
- zroot/freebsd/computer/be/default - path: zroot/freebsd/computer/be
- path: zmass/encrypted/vm
- path: zmass/encrypted/data
users:
talexander:
initialize: true
uid: 11235
gid: 11235
groups:
- name: wheel
- name: video
- name: u2f
- name: operator # To be able to shutdown without root
- name: webcamd
gid: 145
authorized_keys:
- yubikey
- main_fido
- backup_fido
- homeassistant
gitconfig: "gitconfig_home"
sshd_enabled: true sshd_enabled: true
sshd_conf: "sshd_config" sshd_conf: "sshd_config"
prefer_ipv6: true
pf_config: "homeserver_pf.conf" pf_config: "homeserver_pf.conf"
pflog_conf: pflog_conf:
- name: 0 - name: 0
@@ -10,15 +31,11 @@ pflog_conf:
network_rc: "homeserver_network.conf" network_rc: "homeserver_network.conf"
rc_conf: "homeserver_rc.conf" rc_conf: "homeserver_rc.conf"
loader_conf: "homeserver_loader.conf" loader_conf: "homeserver_loader.conf"
netgraph_config: "setup_netgraph_homeserver"
cputype: "intel" cputype: "intel"
cpu_opt: broadwell
hwpstate: false hwpstate: false
build_user: devfs_rules: "homeserver_devfs.rules"
name: talexander
group: talexander
jail_zfs_dataset: zmass/encrypted/jails jail_zfs_dataset: zmass/encrypted/jails
jail_zfs_dataset_mountpoint: /jail/main jail_zfs_dataset_mountpoint: /jail
jail_canmount: "on" jail_canmount: "on"
jail_bemount: "on" jail_bemount: "on"
jail_list: jail_list:
@@ -33,15 +50,27 @@ jail_list:
- name: dagger - name: dagger
conf: conf:
src: dagger src: dagger
- name: mumble - name: sftp
conf: conf:
src: mumble src: sftp
persist: fstab: sftp_fstab
- name: mumbledb - name: bastion
mount: /var/db/murmur conf:
src: bastion
fstab: fstab_bastion
- name: certificate
conf:
src: certificate
# - name: mumble
# conf:
# src: mumble
# persist:
# - name: mumbledb
# mount: /var/db/murmur
bhyve_dataset: zmass/encrypted/vm bhyve_dataset: zmass/encrypted/vm
bhyve_list: [] # Disable mounting bhyve dataset so it doesn't hide the unencrypted linfi vm
bhyve_canmount: "on" bhyve_canmount: "off"
bhyve_mountpoint: "none"
bhyve_bemount: "on" bhyve_bemount: "on"
wireguard_directory: homeserver wireguard_directory: homeserver
enabled_wireguard: enabled_wireguard:

View File

@@ -1,2 +1,3 @@
[headless] [headless]
homeserver ansible_user=talexander ansible_host=10.216.1.1 #homeserver ansible_user=talexander ansible_host=homeserver
homeserver ansible_user=talexander ansible_host=172.16.16.32

View File

@@ -0,0 +1 @@
os_flavor: freebsd

View File

@@ -0,0 +1 @@
os_flavor: freebsd

View File

@@ -0,0 +1,6 @@
os_flavor: "freebsd"
users:
nochainstounlock:
initialize: true
uid: 11235
gid: 11235

View File

@@ -1,7 +1,10 @@
[jail] [jail]
nat_dhcp ansible_connection=jail nat_dhcp ansible_connection=jail
homeserver_nat_dhcp ansible_ssh_host=nat_dhcp@172.16.16.2 ansible_connection=sshjail homeserver_nat_dhcp ansible_ssh_host=nat_dhcp@homeserver ansible_connection=sshjail
mrmanager_nat_dhcp ansible_ssh_host=nat_dhcp@10.217.2.1 ansible_connection=sshjail mrmanager_nat_dhcp ansible_ssh_host=nat_dhcp@10.217.2.1 ansible_connection=sshjail
nat_dhcp@172.16.16.2 ansible_connection=sshjail nat_dhcp@172.16.16.2 ansible_connection=sshjail
admin_git ansible_ssh_host=admin_git@10.217.2.1 ansible_connection=sshjail admin_git ansible_ssh_host=admin_git@10.217.2.1 ansible_connection=sshjail
public_dns ansible_ssh_host=public_dns@10.217.2.1 ansible_connection=sshjail public_dns ansible_ssh_host=public_dns@10.217.2.1 ansible_connection=sshjail
sftp ansible_ssh_host=sftp@homeserver ansible_connection=sshjail
bastion ansible_ssh_host=bastion@homeserver ansible_connection=sshjail
certificate ansible_ssh_host=certificate@homeserver ansible_connection=sshjail

View File

@@ -1,2 +1,28 @@
timezone: "America/New_York" timezone: "America/New_York"
install_bluetooth: true install_bluetooth: true
emacs_flavor: "full"
ssh_hosts:
- name: poudriere
proxy_jump: talexander@mrmanager
host_name: 10.215.1.203
- name: controller0
proxy_jump: talexander@mrmanager
host_name: 10.215.1.204
- name: controller1
proxy_jump: talexander@mrmanager
host_name: 10.215.1.205
- name: controller2
proxy_jump: talexander@mrmanager
host_name: 10.215.1.206
- name: worker0
proxy_jump: talexander@mrmanager
host_name: 10.215.1.207
- name: worker1
proxy_jump: talexander@mrmanager
host_name: 10.215.1.208
- name: worker2
proxy_jump: talexander@mrmanager
host_name: 10.215.1.209
- name: brianai
proxy_jump: talexander@mrmanager
host_name: 10.215.1.215

View File

@@ -1,25 +1,25 @@
os_flavor: "freebsd" os_flavor: "freebsd"
custom_repo: 13amd64-default-framework custom_repo: "https://freebsdpkg.fizz.buzz/repo/currentznver4-default-framework"
pkgbase_url: "https://freebsdpkg.fizz.buzz/pkgbase/currentznver4-repo/FreeBSD:15:amd64/latest"
zfs_snapshot_datasets: zfs_snapshot_datasets:
- 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"
pflog_conf: pflog_conf:
- name: 0 - name: 0
dev: pflog0 dev: pflog0
prefer_ipv6: true
dummynet_config: "dnctl.conf"
network_rc: "odofreebsd_network.conf" network_rc: "odofreebsd_network.conf"
rc_conf: "odofreebsd_rc.conf" rc_conf: "odofreebsd_rc.conf"
loader_conf: "odofreebsd_loader.conf" loader_conf: "odofreebsd_loader.conf"
install_graphics: true install_graphics: true
graphics_driver: "intel" graphics_driver: "amd"
cputype: "intel" cputype: "amd"
cpu_opt: tigerlake
hwpstate: true hwpstate: true
cores: 8 cores: 16
build_user: sound_system: "oss"
name: talexander
group: talexander
users: users:
talexander: talexander:
initialize: true initialize: true
@@ -31,6 +31,8 @@ users:
- name: u2f - name: u2f
- name: operator # To be able to shutdown without root - name: operator # To be able to shutdown without root
- name: webcamd - name: webcamd
gid: 145
- name: realtime
authorized_keys: authorized_keys:
- yubikey - yubikey
- main_fido - main_fido
@@ -38,16 +40,18 @@ 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
jail_canmount: "on"
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_bemount: off
efi_dev: /dev/gpt/EFI # efi_dev: /dev/gpt/EFI
efi_dev: /dev/diskid/DISK-SJB7N717610407Q0Hp1
sway_conf_files: sway_conf_files:
- launch_gpg - launch_gpg
wireguard_directory: odo wireguard_directory: odo
@@ -55,3 +59,10 @@ enabled_wireguard:
- wgh - wgh
- drmario - drmario
- colo - colo
linfi:
enabled: true
zfs_dataset: zroot/freebsd/current/vm/linfi
zfs_mountpoint: /vm/linfi
driver_blocklist: "if_iwm if_iwlwifi"
pci_blocklist: "1/0/0"
amd: true

View File

@@ -16,12 +16,13 @@ users:
- backup_fido - backup_fido
- homeassistant - homeassistant
gitconfig: "gitconfig_home" gitconfig: "gitconfig_home"
periodic_scrub_pools: [zroot]
zfs_snapshot_datasets: zfs_snapshot_datasets:
# - zroot/linux/archmain/home # - zroot/linux/archmain/home
- zroot/linux/archmain/be - path: zroot/linux/archmain/be
- zroot/data/bridge/family_disks - path: zroot/data/bridge/family_disks
install_graphics: true install_graphics: true
graphics_driver: "intel" graphics_driver: "amd"
build_user: build_user:
name: talexander name: talexander
group: talexander group: talexander
@@ -30,10 +31,9 @@ enabled_wireguard:
- wgh - wgh
- drmario - drmario
- colo - colo
cputype: "intel" cputype: "amd"
hwpstate: true hwpstate: true
cores: 8 cores: 16
sway_conf_files: sway_conf_files:
- rofimoji - rofimoji
docker_storage_driver: zfs # alternatively overlay2 docker_storage_driver: overlay2 # alternatively zfs
docker_zfs_dataset: zroot/linux/archmain/docker

View File

@@ -0,0 +1,37 @@
os_flavor: "linux"
hostname: odowork
etc_hosts: {}
users:
talexander:
initialize: true
uid: 11235
gid: 1000
groups:
- name: wheel
- name: users
- name: docker
- name: libvirt
- name: uucp
authorized_keys:
- yubikey
- main_fido
- backup_fido
gitconfig: "gitconfig_work"
periodic_scrub_pools: [zroot]
zfs_snapshot_datasets:
- path: zroot/linux/archwork/be
install_graphics: true
graphics_driver: "amd"
pgp_key: "gpg_work.asc"
build_user:
name: talexander
group: talexander
# wireguard_directory: odowork
# enabled_wireguard: []
cputype: "amd"
hwpstate: true
cores: 16
sway_conf_files:
- rofimoji
docker_storage_driver: overlay2 # alternatively zfs
closed_source_vscode: true

View File

@@ -1,3 +1,4 @@
[gui] [gui]
odolinux ansible_connection=local ansible_host=127.0.0.1 odolinux ansible_connection=local ansible_host=127.0.0.1
odofreebsd ansible_connection=local ansible_host=127.0.0.1 odofreebsd ansible_connection=local ansible_host=127.0.0.1
odowork ansible_connection=local ansible_host=127.0.0.1

View File

@@ -1,13 +1,30 @@
os_flavor: "freebsd" os_flavor: "freebsd"
sshd_enabled: true
custom_repo: "file:///usr/local/poudriere/data/packages/currentznver4-default-framework"
pkgbase_url: "file:///usr/local/poudriere/data/images/currentznver4-repo/FreeBSD:15:amd64/latest"
poudriere_builds: poudriere_builds:
- jail: 13amd64 # - jail: 13amd64
ports: default
set: framework
version: 13.2-RELEASE
# - jail: current
# ports: default # ports: default
# set: framework # set: framework
# version: CURRENT # version: 13.2-RELEASE
# revision: af01b4722577903f91acc44f01bdcb8cdb2d65ad - jail: currentznver4
# kernel: CUSTOM ports: default
# branch: main set: framework
version: CURRENT
# revision: 66d37dbedfbf2dc94ccf49e6983c3652d5909b91
kernel: CUSTOM
branch: main
srcconf: currentznver4_src.conf
# - jail: 14broadwell
# ports: default
# set: computer
# version: 14.0-RELEASE
# kernel: GENERIC
# srcconf: 14broadwell_src.conf
- jail: 14broadwell
ports: default
set: computer
version: CURRENT
kernel: CUSTOM
branch: releng/14.1
srcconf: 14broadwell_src.conf

View File

@@ -6,4 +6,3 @@ poudrieremrmanager ansible_user=root ansible_host=poudriere
# Host poudriere # Host poudriere
# ProxyJump talexander@mrmanager # ProxyJump talexander@mrmanager
# HostName 10.215.1.203 # HostName 10.215.1.203
#

View File

@@ -20,12 +20,14 @@
- build - build
- sound - sound
- graphics - graphics
- power_management
- gpg - gpg
- fonts - fonts
- alacritty - alacritty
- sway - sway
- emacs - emacs
- firefox - firefox
- chromium
- devfs - devfs
- ssh_client - ssh_client
- sshfs - sshfs
@@ -41,14 +43,19 @@
- ansible - ansible
- wireguard - wireguard
- portshaker - portshaker
- poudriere
- android - android
- latex - latex
- python
- pyenv - pyenv
- webcam - webcam
- docker - docker
- vscode - vscode
- javascript - javascript
- launch_keyboard
- lvfs
# - restaurant_health_rating
- wasm
- noise_suppression
- hosts: nat_dhcp:homeserver_nat_dhcp:mrmanager_nat_dhcp - hosts: nat_dhcp:homeserver_nat_dhcp:mrmanager_nat_dhcp
vars: vars:
@@ -61,7 +68,12 @@
ansible_become: True ansible_become: True
roles: roles:
- sudo # for poudboot script - sudo # for poudboot script
- doas
- fstab - fstab
- package_manager
- zsh
- termcap
- sshd
- portshaker - portshaker
- poudriere - poudriere
- poudrierenginx - poudrierenginx
@@ -70,28 +82,29 @@
vars: vars:
ansible_become: True ansible_become: True
roles: roles:
- sudo # - sudo
- doas - doas
- users - users
# - package_manager - package_manager
# - zfs - zfs
# - zrepl - zrepl
# - zsh - zsh
# - network - network
# - sshd - sshd
# - base - base
- firewall - firewall
# - cpu - cpu
# - ntp - ntp
# - nvme - nvme
# - hosts - hosts
# - build - build
# - devfs - devfs
# - jail - jail
# - bhyve - bhyve
# - wireguard - wireguard
# - plainmacs - emacs
# - mrmanager - mrmanager
- ndproxy
- hosts: admin_git:public_dns - hosts: admin_git:public_dns
vars: vars:
@@ -109,3 +122,34 @@
- doas - doas
- users - users
- public_dns - public_dns
- hosts: odolinux:odofreebsd:odowork
vars:
ansible_become: True
roles:
- framework_laptop
- hosts: odowork
vars:
ansible_become: True
roles:
- odowork
- hosts: sftp
vars:
ansible_become: True
roles:
- users
- sftp
- hosts: bastion
vars:
ansible_become: True
roles:
- jail_bastion
- hosts: certificate
vars:
ansible_become: True
roles:
- jail_certificate

View File

@@ -0,0 +1,44 @@
[colors]
draw_bold_text_with_bright_colors = true
indexed_colors = []
[colors.bright]
black = "0x666666"
blue = "0x7aa6da"
cyan = "0x54ced6"
green = "0x9ec400"
magenta = "0xb77ee0"
red = "0xff3334"
white = "0xffffff"
yellow = "0xe7c547"
[colors.normal]
black = "0x000000"
blue = "0x7aa6da"
cyan = "0x70c0ba"
green = "0xb9ca4a"
magenta = "0xc397d8"
red = "0xd54e53"
white = "0xeaeaea"
yellow = "0xe6c547"
[colors.primary]
background = "0x000000"
foreground = "0xeaeaea"
[font]
size = 11.0
[[hints.enabled]]
command = "xdg-open"
post_processing = true
regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+"
[hints.enabled.mouse]
enabled = false
mods = "None"
[scrolling]
history = 10000
# Lines moved per scroll.
multiplier = 3

View File

@@ -1,103 +0,0 @@
# If `true`, bold text is drawn using the bright color variants.
draw_bold_text_with_bright_colors: true
colors:
# Default colors
primary:
background: "0x000000"
foreground: "0xeaeaea"
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
# If the bright foreground color is not set, or `draw_bold_text_with_bright_colors`
# is `false`, the normal foreground color will be used.
#dim_foreground: '0x9a9a9a'
#bright_foreground: '0xffffff'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor. If these are unset,
# the cursor color will be the inverse of the cell color.
#cursor:
# text: '0x000000'
# cursor: '0xffffff'
# Selection colors
#
# Colors which should be used to draw the selection area. If selection
# background is unset, selection color will be the inverse of the cell colors.
# If only text is unset the cell text color will remain the same.
#selection:
# text: '0xeaeaea'
# background: '0x404040'
# Normal colors
normal:
black: "0x000000"
red: "0xd54e53"
green: "0xb9ca4a"
yellow: "0xe6c547"
blue: "0x7aa6da"
magenta: "0xc397d8"
cyan: "0x70c0ba"
white: "0xeaeaea"
# Bright colors
bright:
black: "0x666666"
red: "0xff3334"
green: "0x9ec400"
yellow: "0xe7c547"
blue: "0x7aa6da"
magenta: "0xb77ee0"
cyan: "0x54ced6"
white: "0xffffff"
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '0x000000'
# red: '0x8c3336'
# green: '0x7a8530'
# yellow: '0x97822e'
# blue: '0x506d8f'
# magenta: '0x80638e'
# cyan: '0x497e7a'
# white: '0x9a9a9a'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '0xff00ff' }`
#
indexed_colors: []
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Number of lines the viewport will move for every line scrolled when
# scrollback is enabled (history > 0).
multiplier: 3
font:
size: 11.0
hints:
enabled:
# Disable opening links when clicked
- regex:
"(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
[^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
command: xdg-open
post_processing: true
mouse:
enabled: false
mods: None

View File

@@ -19,8 +19,8 @@
owner: "{{ account_name.stdout }}" owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}" group: "{{ group_name.stdout }}"
loop: loop:
- src: alacritty.yml - src: alacritty.toml
dest: .config/alacritty/alacritty.yml dest: .config/alacritty/alacritty.toml
- import_tasks: tasks/peruser_freebsd.yaml - import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"' when: 'os_flavor == "freebsd"'

View File

@@ -19,4 +19,6 @@
name: name:
- gvfs - gvfs
- gvfs-mtp - gvfs-mtp
- android-udev # Access android over USB without root.
- android-tools # For fastboot to flash phones.
state: present state: present

View File

@@ -1,6 +1,6 @@
- name: Install packages - name: Install packages
package: package:
name: name:
- py39-ansible - py311-ansible
- ansible-sshjail - ansible-sshjail
state: present state: present

View File

@@ -1,4 +1,3 @@
# $FreeBSD$
# #
# Automounter master map, see auto_master(5) for details. # Automounter master map, see auto_master(5) for details.
# #

View File

@@ -1,24 +0,0 @@
# Reconstructed via infocmp from file: /usr/share/terminfo/a/alacritty
# (untranslatable capabilities removed to fit entry within 1023 bytes)
# (sgr removed to fit entry within 1023 bytes)
# (acsc removed to fit entry within 1023 bytes)
# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
alacritty|alacritty terminal emulator:\
:am:bs:hs:mi:ms:xn:\
:co#80:it#8:li#24:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
:K2=\EOE:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:\
:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:\
:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:\
:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:\
:ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
:is=\E[!p\E[?3;4l\E[4l\E>:k1=\EOP:k2=\EOQ:k3=\EOR:\
:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
:k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\
:kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:kr=\EOC:\
:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:\
:mh=\E[2m:mm=\E[?1034h:mo=\E[?1034l:mr=\E[7m:nd=\E[C:\
:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
:te=\E[?1049l\E[23;0;0t:ti=\E[?1049h\E[22;0;0t:\
:ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\
:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h:

View File

@@ -0,0 +1 @@
tcp_bbr_load="YES"

View File

@@ -0,0 +1 @@
clear_tmp_enable="YES"

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
# Decode the contents of a JWT
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec jq -R 'split(".") | .[0],.[1] | gsub("-"; "+") | gsub("_"; "/") | gsub("%3D"; "=")| @base64d | fromjson'

View File

@@ -1,8 +1,12 @@
# Disabling both of these will make /dev/gpt/* populated # Populates the /dev/diskid
kern.geom.label.disk_ident.enable="1"
# Populates /dev/gpt but only if kern.geom.label.disk_ident.enable is disabled.
# #
# This uses gpt partition labels which you can set with: # This uses gpt partition labels which you can set with:
# #
# gpart modify -l EFI -i 1 nvd0 # gpart modify -l EFI -i 1 nvd0
# kern.geom.label.disk_ident.enable="0"
# kern.geom.label.gptid.enable="1" # kern.geom.label.gptid.enable="1"

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
git filter-branch --env-filter '
WRONG_EMAIL="old@email.foo"
NEW_NAME="New Name"
NEW_EMAIL="new@email.buzz"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_AUTHOR_NAME="$NEW_NAME"
export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
fi
' --tag-name-filter cat --commit-filter 'git commit-tree -S "$@";' -- --branches --tags

View File

@@ -1,19 +1,54 @@
[user] [user]
email = tom@fizz.buzz email = tom@fizz.buzz
name = Tom Alexander name = Tom Alexander
signingkey = D3A179C9A53C0EDE signingkey = 36C99E8B3C39D85F
[push] [push]
default = simple default = simple # (default since 2.0)
[alias] [alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
bh = log --oneline --branches=* --remotes=* --graph --decorate bh = log --oneline --branches=* --remotes=* --graph --decorate
amend = commit --amend --no-edit
authorcount = shortlog --summary --numbered --all --no-merges
[core] [core]
excludesfile = ~/.gitignore_global excludesfile = ~/.gitignore_global
[commit] [commit]
gpgsign = true gpgsign = true
verbose = true
[pull] [pull]
rebase = true rebase = true
[log] [log]
date = local date = local
[init] [init]
defaultBranch = master defaultBranch = main
[diff]
tool = meld # Use meld for `git difftool` and `git mergetool`
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[difftool]
prompt = false
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
[merge]
tool = meld
conflictStyle = zdiff3
[mergetool "meld"]
# Make the middle pane start with partially-merged contents:
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
# Make the middle pane start without any merge progress:
# cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[fetch]
prune = true
pruneTags = true
all = true
[rebase]
autoSquash = true
autoStash = true
updateRefs = false

View File

@@ -0,0 +1,58 @@
[user]
email = ThomasA.Alexander@hmhn.org
name = Tom Alexander
signingkey = 36C99E8B3C39D85F
[push]
default = simple # (default since 2.0)
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
bh = log --oneline --branches=* --remotes=* --graph --decorate
amend = commit --amend --no-edit
authorcount = shortlog --summary --numbered --all --no-merges
[core]
excludesfile = ~/.gitignore_global
[commit]
gpgsign = true
verbose = true
[pull]
rebase = true
[log]
date = local
[init]
defaultBranch = main
[diff]
tool = meld # Use meld for `git difftool` and `git mergetool`
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[difftool]
prompt = false
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
[merge]
tool = meld
conflictStyle = zdiff3
[mergetool "meld"]
# Make the middle pane start with partially-merged contents:
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
# Make the middle pane start without any merge progress:
# cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
[includeIf "gitdir:/bridge/"]
path = /bridge/git/machine_setup/ansible/roles/base/files/gitconfig_home
[includeIf "gitdir:/persist/"]
path = /bridge/git/machine_setup/ansible/roles/base/files/gitconfig_home
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[fetch]
prune = true
pruneTags = true
all = true
[rebase]
autoSquash = true
autoStash = true
updateRefs = false

View File

@@ -1,2 +1,8 @@
.idea .idea
.python-version .python-version
# Emacs per-directory settings
.dir-locals.el
# C/C++ Language Server compile commands
compile_commands.json

View File

@@ -1,5 +1,4 @@
security.bsd.allow_destructive_dtrace=0 security.bsd.allow_destructive_dtrace=0
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES" cryptodev_load="YES"
zfs_load="YES" zfs_load="YES"
devmatch_blocklist="if_iwm"

View File

@@ -2,8 +2,7 @@ clear_tmp_enable="YES"
syslogd_flags="-ss" syslogd_flags="-ss"
sendmail_enable="NONE" sendmail_enable="NONE"
hostname="computer" hostname="computer"
local_unbound_enable="NO"
sshd_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"
kld_list="${kld_list} if_iwlwifi"

View File

@@ -7,7 +7,6 @@
# This file controls resource limits, accounting limits and # This file controls resource limits, accounting limits and
# default user environment settings. # default user environment settings.
# #
# $FreeBSD$
# #
# Default settings effectively disable resource limits, see the # Default settings effectively disable resource limits, see the
@@ -45,8 +44,8 @@ default:\
:pseudoterminals=unlimited:\ :pseudoterminals=unlimited:\
:kqueues=unlimited:\ :kqueues=unlimited:\
:umtxp=unlimited:\ :umtxp=unlimited:\
:pipebuf=unlimited:\
:priority=0:\ :priority=0:\
:ignoretime@:\
:umask=022:\ :umask=022:\
:charset=UTF-8:\ :charset=UTF-8:\
:lang=en_US.UTF-8: :lang=en_US.UTF-8:
@@ -149,7 +148,6 @@ russian|Russian Users Accounts:\
# :requirehome:\ # :requirehome:\
# :passwordtime=90d:\ # :passwordtime=90d:\
# :umask=002:\ # :umask=002:\
# :ignoretime@:\
# :tc=default: # :tc=default:
# #
# #
@@ -174,7 +172,6 @@ russian|Russian Users Accounts:\
## ##
#staff:\ #staff:\
# :ignorenologin:\ # :ignorenologin:\
# :ignoretime:\
# :requirehome@:\ # :requirehome@:\
# :accounted@:\ # :accounted@:\
# :path=~/bin /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin:\ # :path=~/bin /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin:\
@@ -265,7 +262,6 @@ russian|Russian Users Accounts:\
## - no time accounting, restricted to access via dialin lines ## - no time accounting, restricted to access via dialin lines
## ##
#site:\ #site:\
# :ignoretime:\
# :passwordtime@:\ # :passwordtime@:\
# :refreshtime@:\ # :refreshtime@:\
# :refreshperiod@:\ # :refreshperiod@:\

View File

@@ -1,6 +1,3 @@
security.bsd.allow_destructive_dtrace=0 security.bsd.allow_destructive_dtrace=0
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES" cryptodev_load="YES"
zfs_load="YES" zfs_load="YES"

View File

@@ -1,8 +1,6 @@
clear_tmp_enable="YES"
syslogd_flags="-ss" syslogd_flags="-ss"
sendmail_enable="NONE" sendmail_enable="NONE"
hostname="odo" hostname="odo"
sshd_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,4 +1,4 @@
set-option -g mouse on # set-option -g mouse on
set-option -g history-limit 20000 set-option -g history-limit 20000
# set -g @plugin 'tmux-plugins/tmux-yank' # set -g @plugin 'tmux-plugins/tmux-yank'
# Emacs style # Emacs style

View File

@@ -10,7 +10,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function cleanup { function cleanup {
switch_to_main_screen switch_to_main_screen
} }
for sig in EXIT INT QUIT HUP TERM; do for sig in EXIT; do
trap "set +e; cleanup; exit" "$sig" trap "set +e; cleanup; exit" "$sig"
done done

View File

@@ -1,2 +1,3 @@
dependencies: dependencies:
- fstab - fstab
# - termcap

View File

@@ -16,20 +16,19 @@
- wget - wget
- colordiff - colordiff
- ipcalc - ipcalc
- kdiff3
- tcpdump - tcpdump
- moreutils # for ts [%Y-%m-%d %H:%M:%.S] - moreutils # for ts [%Y-%m-%d %H:%M:%.S]
- ddrescue - ddrescue
- dmidecode
state: present state: present
- name: Set timezone - name: Install packages
file: when: install_graphics
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}" package:
dest: /etc/localtime name:
owner: root - kdiff3
# TODO: Arch Linux is changing the group to root instead of wheel. Maybe make this a variable? - meld
group: wheel state: present
state: link
- name: Install scripts - name: Install scripts
copy: copy:
@@ -47,6 +46,10 @@
dest: /usr/local/bin/git_find_merged_branches dest: /usr/local/bin/git_find_merged_branches
- src: cleanup_temporary_files - src: cleanup_temporary_files
dest: /usr/local/bin/cleanup_temporary_files dest: /usr/local/bin/cleanup_temporary_files
- src: git_fix_author.bash
dest: /usr/local/bin/git_fix_author
- src: decode_jwt.bash
dest: /usr/local/bin/decode_jwt
- import_tasks: tasks/freebsd.yaml - import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"' when: 'os_flavor == "freebsd"'

View File

@@ -1,3 +1,11 @@
- name: Set timezone
file:
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
dest: /etc/localtime
owner: root
group: wheel
state: link
- name: Install packages - name: Install packages
package: package:
name: name:
@@ -5,29 +13,18 @@
- gsed - gsed
- gmake - gmake
- rust-coreutils - rust-coreutils
- shuf
state: present state: present
- name: See if the alacritty termcap has been added - name: Install service configuration
lineinfile: copy:
name: /usr/share/misc/termcap src: "files/{{ item }}_rc.conf"
regexp: |- dest: "/etc/rc.conf.d/{{ item }}"
^alacritty\| mode: 0644
state: absent owner: root
check_mode: yes group: wheel
changed_when: false loop:
register: alacritty_cap - cleartmp
- name: Append alacritty termcap info
blockinfile:
path: /usr/share/misc/termcap
block: "{{ lookup('file', 'alacritty.termcap') }}"
marker: "# {mark} ANSIBLE MANAGED BLOCK alacritty"
when: not alacritty_cap.found
register: wrote_alacritty_cap
- name: Update cap_mkdb
command: cap_mkdb /usr/share/misc/termcap
when: wrote_alacritty_cap.changed
- name: Install login.conf - name: Install login.conf
copy: copy:
@@ -42,18 +39,6 @@
command: cap_mkdb /etc/login.conf command: cap_mkdb /etc/login.conf
when: login_config.changed when: login_config.changed
- name: Enable periodic scrub
community.general.sysrc:
name: daily_scrub_zfs_enable
value: "YES"
path: /etc/periodic.conf.local
- name: Set scrub interval
community.general.sysrc:
name: daily_scrub_zfs_default_threshold
value: "7"
path: /etc/periodic.conf.local
- name: Install loader.conf - name: Install loader.conf
copy: copy:
src: "{{loader_conf}}" src: "{{loader_conf}}"
@@ -92,27 +77,27 @@
owner: root owner: root
group: wheel group: wheel
loop: loop:
- src: bemount.bash # - src: bemount.bash
dest: /usr/local/bin/bemount # dest: /usr/local/bin/bemount
- src: watch_freebsd - src: watch_freebsd
dest: /usr/local/bin/ww dest: /usr/local/bin/ww
- name: Install rc script # - name: Install rc script
copy: # copy:
src: "files/{{ item.src }}" # src: "files/{{ item.src }}"
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}" # dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
owner: root # owner: root
group: wheel # group: wheel
mode: 0755 # mode: 0755
loop: # loop:
- src: bemount_rc.sh # - src: bemount_rc.sh
dest: bemount # dest: bemount
- name: Enable bemount # - name: Enable bemount
community.general.sysrc: # community.general.sysrc:
name: bemount_enable # name: bemount_enable
value: "YES" # value: "YES"
path: /etc/rc.conf.d/bemount # path: /etc/rc.conf.d/bemount
- name: Install loader.conf - name: Install loader.conf
copy: copy:
@@ -122,4 +107,67 @@
owner: root owner: root
group: wheel group: wheel
loop: loop:
- zfs
- disk_labels - disk_labels
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
reload: false
sysctl_file: "/etc/sysctl.conf.local"
loop:
# Adjust ttl
- name: net.inet.ip.ttl
value: 65
- name: net.inet6.ip6.hlim
value: 65
- name: Log periodic output instead of getting it as mail
blockinfile:
path: "/etc/periodic.conf.local"
marker: "# {mark} ANSIBLE MANAGED BLOCK log"
create: true
mode: 0644
owner: root
group: wheel
block: |
daily_output=/var/log/daily.log
weekly_output=/var/log/weekly.log
monthly_output=/var/log/monthly.log
- name: Enable periodic zfs scrub
when: install_zfs
blockinfile:
path: "/etc/periodic.conf.local"
marker: "# {mark} ANSIBLE MANAGED BLOCK zfs"
create: true
mode: 0644
owner: root
group: wheel
block: |
daily_scrub_zfs_enable="YES"
daily_scrub_zfs_default_threshold="14"
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
- name: Install loader.conf
copy:
src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- bbr
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
reload: false
sysctl_file: "/etc/sysctl.conf.local"
loop:
- name: net.inet.tcp.functions_default
value: "bbr"

View File

@@ -1,3 +1,11 @@
- name: Set timezone
file:
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
dest: /etc/localtime
owner: root
group: root
state: link
- name: Install packages - name: Install packages
package: package:
name: name:
@@ -7,6 +15,9 @@
- bind # dig - bind # dig
- man-db - man-db
- uutils-coreutils - uutils-coreutils
- usbutils # for lsusb
- bolt
- whois
state: present state: present
- name: Start pkgfile update service - name: Start pkgfile update service
@@ -16,17 +27,6 @@
daemon_reload: yes daemon_reload: yes
enabled: yes enabled: yes
# Of questionable value since I don't use swap on my machines
- name: Configure sysctls for swap
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/swap.conf
loop:
- name: vm.swappiness
value: 10
- name: Install scripts - name: Install scripts
copy: copy:
src: "files/{{ item.src }}" src: "files/{{ item.src }}"
@@ -39,3 +39,41 @@
dest: /usr/local/bin/mount_disk_image dest: /usr/local/bin/mount_disk_image
- src: watch_linux - src: watch_linux
dest: /usr/local/bin/ww dest: /usr/local/bin/ww
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/{{ item.file }}
loop:
# Of questionable value since I don't use swap on my machines
- name: vm.swappiness
value: 10
file: swap.conf
# Enable TCP packetization-layer PMTUD when an ICMP black hole is detected.
- name: net.ipv4.tcp_mtu_probing
value: 1
file: tcp.conf
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
- name: net.ipv4.tcp_congestion_control
value: bbr
file: tcp.conf
# Don't do a slow start after a connection has been idle for a single RTO.
- name: net.ipv4.tcp_slow_start_after_idle
value: 0
file: tcp.conf
# 3x time to accumulate filesystem changes before flushing to disk.
- name: vm.dirty_writeback_centisecs
value: 1500
file: power.conf
# Adjust ttl
- name: net.ipv4.ip_default_ttl
value: 65
file: ttl.conf
- name: net.ipv6.conf.all.hop_limit
value: 65
file: ttl.conf
- name: net.ipv6.conf.default.hop_limit
value: 65
file: ttl.conf

View File

@@ -1,2 +1 @@
bhyve_mountpoint: "/vm" bhyve_mountpoint: "/vm"
bhyve_list: []

View File

@@ -30,11 +30,40 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: ${BRIDGE_NAME:="bridge_$INTERFACE_NAME"} # or bridge_raw for RAW networks : ${BRIDGE_NAME:="bridge_$INTERFACE_NAME"} # or bridge_raw for RAW networks
: ${VNC_ENABLE:="NO"} : ${VNC_ENABLE:="NO"}
: ${VNC_LISTEN:="127.0.0.1:5900"} : ${VNC_LISTEN:="127.0.0.1:5900"}
: ${VNC_WIDTH:="1920"}
: ${VNC_HEIGHT:="1080"}
if [ "$VERBOSE" = "YES" ]; then if [ "$VERBOSE" = "YES" ]; then
set -x set -x
fi fi
############## Setup #########################
function cleanup {
for vm in "${vms[@]}"; do
log "Destroying bhyve vm $vm"
bhyvectl "--vm=$vm" --destroy
log "Destroyed bhyve vm $vm"
done
}
vms=()
for sig in EXIT; do
trap "set +e; sleep 10; cleanup" "$sig"
done
function die {
local status_code="$1"
shift
(>&2 echo "${@}")
exit "$status_code"
}
function log {
(>&2 echo "${@}")
}
############## Program #########################
function main { function main {
local cmd="$1" local cmd="$1"
shift 1 shift 1
@@ -47,13 +76,6 @@ function main {
fi fi
} }
function die {
local status_code="$1"
shift
(>&2 echo "${@}")
exit "$status_code"
}
function create_disk { function create_disk {
local zfs_path="$1" local zfs_path="$1"
local mount_path="$2" local mount_path="$2"
@@ -85,7 +107,8 @@ function start_vm {
local bridge_name="$BRIDGE_NAME" local bridge_name="$BRIDGE_NAME"
local ip_range="$IP_RANGE" # for raw this value does not matter local ip_range="$IP_RANGE" # for raw this value does not matter
local mac_address=$(calculate_mac_address "$name") local mac_address
mac_address=$(calculate_mac_address "$name")
local additional_args=() local additional_args=()
@@ -117,11 +140,12 @@ function start_vm {
# TODO: Look into using nmdm instead of stdio for serial console # TODO: Look into using nmdm instead of stdio for serial console
if [ -n "$mount_cd" ]; then if [ -n "$mount_cd" ]; then
additional_args+=("-s" "3,ahci-cd,$mount_cd") additional_args+=("-s" "5,ahci-cd,$mount_cd")
fi fi
if [ "$VNC_ENABLE" = "YES" ]; then if [ "$VNC_ENABLE" = "YES" ]; then
additional_args+=("-s" "29,fbuf,tcp=$VNC_LISTEN,w=1920,h=1080") additional_args+=("-s" "29,fbuf,tcp=$VNC_LISTEN,w=$VNC_WIDTH,h=$VNC_HEIGHT")
fi fi
vms+=("$name")
while true; do while true; do
set -x set -x
set +e set +e
@@ -129,7 +153,10 @@ function start_vm {
-D \ -D \
-c $CPU_CORES \ -c $CPU_CORES \
-m $MEMORY \ -m $MEMORY \
-S \
-H \ -H \
-P \
-o 'rtc.use_localtime=false' \
-s 0,hostbridge \ -s 0,hostbridge \
-s "4,nvme,/dev/zvol/${zfs_path}/disk0" \ -s "4,nvme,/dev/zvol/${zfs_path}/disk0" \
-s 30,xhci,tablet \ -s 30,xhci,tablet \
@@ -142,6 +169,7 @@ function start_vm {
set +x set +x
if [ $exit_code -eq 0 ]; then if [ $exit_code -eq 0 ]; then
echo "Rebooting." echo "Rebooting."
sleep 5
elif [ $exit_code -eq 1 ]; then elif [ $exit_code -eq 1 ]; then
echo "Powered off." echo "Powered off."
break break
@@ -156,9 +184,6 @@ function start_vm {
break break
fi fi
done done
bhyvectl "--vm=$name" --destroy
echo "Destroyed bhyve vm."
} }
function detect_available_link { function detect_available_link {
@@ -192,7 +217,7 @@ EOF
mkpeer ${host_interface_name}: bridge ether link0 mkpeer ${host_interface_name}: bridge ether link0
name ${host_interface_name}:ether $bridge_name name ${host_interface_name}:ether $bridge_name
EOF EOF
ifconfig $(ngctl msg "${host_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${host_interface_name}" "$ip_range" up ifconfig "$(ngctl msg "${host_interface_name}:" getifname | grep Args | cut -d '"' -f 2)" name "${host_interface_name}" "$ip_range" up
fi fi
} }
@@ -226,7 +251,8 @@ function ng_exists {
function calculate_mac_address { function calculate_mac_address {
local name="$1" local name="$1"
local source=$(md5 -r -s "$name" | awk '{print $1}') local source
source=$(md5 -r -s "$name" | awk '{print $1}')
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}" echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
} }

View File

@@ -0,0 +1,478 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Share a host directory to the guest via 9pfs.
#
# Inside the VM run:
# mount -t virtfs -o trans=virtio sharename /some/vm/path
# mount -t 9p -o cache=mmap -o msize=512000 sharename /mnt/9p
# mount -t 9p -o trans=virtio,cache=mmap,msize=512000 bind9p /path/to/mountpoint
# bhyve_options="-s 28,virtio-9p,sharename=/"
# Enable Sound
# bhyve_options="-s 16,hda,play=/dev/dsp,rec=/dev/dsp"
# Example usage:
#
# doas bhyverc create-disk zdata/vm/poudriere /vm/poudriere 10
# doas bhyverc start poudriere zdata/vm/poudriere /vm/poudriere /vm/iso/FreeBSD-13.2-RELEASE-amd64-bootonly.iso
# doas bhyverc start poudriere zdata/vm/poudriere /vm/poudriere
: ${VERBOSE:="NO"} # or YES
if [ "$VERBOSE" = "YES" ]; then
set -x
fi
: ${CPU_CORES:="1"}
: ${MEMORY:="1G"}
: ${NETWORK:="NAT"} # or RAW or BOTH
: ${IP_RANGE:="10.215.1.1/24"} # Ignored for RAW networks
: ${INTERFACE_NAME:="jail_nat"} # or the external interface like lagg0 for RAW networks
: ${BRIDGE_NAME:="bridge_$INTERFACE_NAME"} # or bridge_raw for RAW networks
: ${VNC_ENABLE:="NO"}
: ${VNC_LISTEN:="127.0.0.1:5900"}
: ${VNC_WIDTH:="1920"}
: ${VNC_HEIGHT:="1080"}
: ${BIND9P:=""}
: ${PREVENT_OOM:="NO"}
: "${CD:=}"
: ${SHUTDOWN_TIMEOUT:="600"} # 10 minutes
############## Setup #########################
function die {
local status_code="$1"
shift
(>&2 echo "${@}")
exit "$status_code"
}
function log {
(>&2 echo "${@}")
}
############## Program #########################
function main {
local cmd
cmd=$1
shift
if [ "$cmd" = "start" ]; then
init
start "${@}"
elif [ "$cmd" = "stop" ]; then
init
stop "${@}"
elif [ "$cmd" = "status" ]; then
init
status "${@}"
elif [ "$cmd" = "console" ]; then
init
console "${@}"
elif [ "$cmd" = "_start_body" ]; then
init
start_body "${@}"
elif [ "$cmd" = "create-disk" ]; then
create_disk "${@}"
else
(>&2 echo "Unknown command: $cmd")
exit 1
fi
}
function start {
local num_vms="$#"
if [ "$num_vms" -eq 0 ]; then
log "No VMs specified."
return 0
fi
while [ "$#" -gt 0 ]; do
local name="$1"
shift 1
log "Starting VM $name."
start_one "$name"
[ "$#" -eq 0 ] || sleep 5
done
}
function start_one {
local name="$1"
local tmux_name="$name"
/usr/local/bin/tmux new-session -d -s "$tmux_name" "$0" "_start_body" "$name"
# /usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=NO VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /home/talexander/launch_opnsense.bash"
}
function launch_pidfile {
local pidfile="$1"
shift 1
mkdir -p "$(dirname "$pidfile")"
cat > "${pidfile}" <<< "$$"
set -x
exec "${@}"
}
export -f launch_pidfile
function stop {
local num_vms="$#"
if [ "$num_vms" -eq 0 ]; then
log "No VMs specified."
return 0
fi
while [ "$#" -gt 0 ]; do
local name="$1"
shift 1
log "Stopping VM $name."
stop_one "$name"
[ "$#" -eq 0 ] || sleep 5
done
}
function stop_one {
local name="$1"
local pidfile="/run/bhyverc/${name}/pid"
if [ ! -e "$pidfile" ]; then
log "Pid file $pidfile does not exist."
return 0
fi
local bhyve_pid
bhyve_pid=$(cat "$pidfile")
if ps -p "$bhyve_pid" >/dev/null; then
# Send ACPI shutdown command
log "Sending ACPI shutdown to ${name}:${bhyve_pid}."
kill -SIGTERM "$bhyve_pid"
fi
local timeout_start timeout_end
timeout_start=$(date +%s)
while ps -p "$bhyve_pid" >/dev/null; do
timeout_end=$(date +%s)
if [ $((timeout_end-timeout_start)) -ge "$SHUTDOWN_TIMEOUT" ]; then
log "${name}:${bhyve_pid} took more than $SHUTDOWN_TIMEOUT seconds to shut down. Hard powering down."
break
fi
log "Waiting for ${name}:${bhyve_pid} to exit."
sleep 2
done
bhyvectl "--vm=$name" --destroy || true
local timeout_start timeout_end
timeout_start=$(date +%s)
while ps -p "$bhyve_pid" >/dev/null; do
timeout_end=$(date +%s)
if [ $((timeout_end-timeout_start)) -ge "$SHUTDOWN_TIMEOUT" ]; then
log "${name}:${bhyve_pid} took more than $SHUTDOWN_TIMEOUT seconds to hard power down. Giving up."
break
fi
log "Waiting for ${name}:${bhyve_pid} to hard power down."
sleep 2
done
rm -f "$pidfile"
log "Finished stopping $name."
}
function status {
local num_vms="$#"
if [ "$num_vms" -gt 0 ]; then
for name in "$@"; do
status_one "$name"
done
else
log "No VMs specified."
fi
}
function status_one {
local name="$1"
local pidfile="/run/bhyverc/${name}/pid"
if [ ! -e "$pidfile" ]; then
log "$name is not running."
return 0
fi
local bhyve_pid
bhyve_pid=$(cat "$pidfile")
if ! ps -p "$bhyve_pid" >/dev/null; then
log "$name is not running."
return 0
fi
log "$name is running as pid $bhyve_pid."
}
function console {
local num_vms="$#"
if [ "$num_vms" -gt 0 ]; then
for name in "$@"; do
log "Attaching to console of VM $name."
console_one "$name"
done
else
log "No VMs specified."
fi
}
function console_one {
local name="$1"
local tmux_name="$name"
exec tmux a -t "$tmux_name"
}
function init {
mkdir -p /run/bhyverc
}
############## Bhyve ###########################
function create_disk {
local zfs_path="$1"
local mount_path="$2"
local gigabytes="$3"
zfs create -o "mountpoint=$mount_path" "$zfs_path"
cp /usr/local/share/edk2-bhyve/BHYVE_UEFI_VARS.fd "${mount_path}/"
tee "${mount_path}/settings" <<EOF
CPU_CORES="$CPU_CORES"
MEMORY="$MEMORY"
NETWORK="$NETWORK"
IP_RANGE="$IP_RANGE"
BRIDGE_NAME="$BRIDGE_NAME"
INTERFACE_NAME="$INTERFACE_NAME"
EOF
zfs create -s "-V${gigabytes}G" -o volmode=dev -o primarycache=metadata -o secondarycache=none "$zfs_path/disk0"
}
function start_body {
local name="$1"
local zfs_path="zdata/vm/$name"
local mount_path="/vm/$name"
if [ -e "${mount_path}/settings" ]; then
source "${mount_path}/settings"
fi
local mount_cd="$CD"
local host_interface_name="$INTERFACE_NAME" # for raw, external interface
local bridge_name="$BRIDGE_NAME"
local ip_range="$IP_RANGE" # for raw this value does not matter
local mac_address
mac_address=$(calculate_mac_address "$name")
if [ "$PREVENT_OOM" = "YES" ]; then
protect -d -i -p "$$"
fi
local entry parsed_item
local additional_args=()
local next_pcie_slot=10
if [ "$NETWORK" = "NAT" ]; then
assert_bridge "$host_interface_name" "$bridge_name" "$ip_range"
local bridge_link_name=$(detect_available_link "${bridge_name}")
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
elif [ "$NETWORK" = "RAW" ]; then
assert_raw "$host_interface_name" "$bridge_name"
local bridge_link_name=$(detect_available_link "${bridge_name}")
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
elif [ "$NETWORK" = "BOTH" ]; then
assert_bridge "jail_nat" "$bridge_name" "$ip_range"
assert_raw "$host_interface_name" "bridge_raw"
local bridge_link_name=$(detect_available_link "${bridge_name}")
local raw_bridge_link_name=$(detect_available_link "bridge_raw")
local raw_mac_address=$(calculate_mac_address "${name}_raw")
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
additional_args+=("-s" "3:0,virtio-net,netgraph,path=bridge_raw:,peerhook=${raw_bridge_link_name},mac=${raw_mac_address}")
else
die 1 "Unrecognized NETWORK type $NETWORK"
fi
if [ -n "$BIND9P" ]; then
if [[ "$BIND9P" = *":"* ]]; then
IFS=':' read -ra entry <<<"$BIND9P"
for item in "${entry[@]}"; do
IFS='=' read -ra parsed_item <<<"$item"
additional_args+=("-s" "${next_pcie_slot},virtio-9p,${parsed_item[0]}=${parsed_item[1]}")
next_pcie_slot=$((next_pcie_slot+1))
done
else
additional_args+=("-s" "${next_pcie_slot},virtio-9p,bind9p=${BIND9P}")
next_pcie_slot=$((next_pcie_slot+1))
fi
fi
# -H release the CPU when guest issues HLT instruction. Otherwise 100% of core will be consumed.
# -s 3,ahci-cd,/vm/.iso/archlinux-2023.04.01-x86_64.iso \
# -s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080,wait \
# -s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080 \
# TODO: Look into using nmdm instead of stdio for serial console
if [ -n "$mount_cd" ]; then
additional_args+=("-s" "5,ahci-cd,$mount_cd")
fi
if [ "$VNC_ENABLE" = "YES" ]; then
additional_args+=("-s" "${next_pcie_slot},fbuf,tcp=$VNC_LISTEN,w=$VNC_WIDTH,h=$VNC_HEIGHT")
next_pcie_slot=$((next_pcie_slot+1))
fi
vms+=("$name")
while true; do
local pidfile="/run/bhyverc/${name}/pid"
trap "set +e; stop_one '${name}'" EXIT
local launch_cmd=()
launch_cmd+=(
launch_pidfile "$pidfile"
bhyve
-D
-c "$CPU_CORES"
-m "$MEMORY"
-S
-H
-o 'rtc.use_localtime=false'
-s "0,hostbridge"
-s "4,nvme,/dev/zvol/${zfs_path}/disk0"
-s "${next_pcie_slot},xhci,tablet"
-s "$((next_pcie_slot+1)),lpc" -l "com1,stdio"
-l "bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,${mount_path}/BHYVE_UEFI_VARS.fd"
"${additional_args[@]}"
"$name"
)
set +e
rm -f "$pidfile"
(
IFS=$' \n\t'
set -ex
bash -c "${launch_cmd[*]}"
)
local exit_code=$?
log "Exit code ${exit_code}"
set -e
if [ $exit_code -eq 0 ]; then
echo "Rebooting."
sleep 5
elif [ $exit_code -eq 1 ]; then
echo "Powered off."
break
elif [ $exit_code -eq 2 ]; then
echo "Halted."
break
elif [ $exit_code -eq 3 ]; then
echo "Triple fault."
break
elif [ $exit_code -eq 4 ]; then
echo "Exited due to an error."
break
fi
done
}
function detect_available_link {
local bridge_name="$1"
local linknum=1
while true; do
local link_name="link${linknum}"
if ! ng_exists "${bridge_name}:${link_name}"; then
echo "$link_name"
return
fi
linknum=$((linknum + 1))
if [ "$linknum" -gt 90 ]; then
(>&2 echo "No available links on bridge $bridge_name")
exit 1
fi
done
}
function assert_bridge {
local host_interface_name="$1"
local bridge_name="$2"
local ip_range="$3"
if ! ng_exists "${bridge_name}:"; then
ngctl -d -f - <<EOF
mkpeer . eiface hook ether
name .:hook $host_interface_name
EOF
ngctl -d -f - <<EOF
mkpeer ${host_interface_name}: bridge ether link0
name ${host_interface_name}:ether $bridge_name
EOF
ifconfig "$(ngctl msg "${host_interface_name}:" getifname | grep Args | cut -d '"' -f 2)" name "${host_interface_name}" "$ip_range" up
fi
}
function assert_raw {
local extif="$1"
local bridge_name="$2"
kldload -n ng_bridge ng_eiface ng_ether
if ! ng_exists "${bridge_name}:"; then
ngctlcat <<EOF
# Create a bridge.
mkpeer $extif: bridge lower link0
# Assign a name to the bridge.
name $extif:lower ${bridge_name}
# Since the host is also using $extif, we need to connect the upper hook also. Otherwise we will lose connectivity.
connect $extif: ${bridge_name}: upper link1
# Enable promiscuous mode so the host ethernet adapter accepts packets for all addresses
msg $extif: setpromisc 1
# Do not overwrite source address on packets
msg $extif: setautosrc 0
EOF
fi
}
function ng_exists {
ngctl status "${1}" >/dev/null 2>&1
}
function calculate_mac_address {
local name="$1"
local source
source=$(md5 -r -s "$name" | awk '{print $1}')
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
}
function find_available_port {
local start_port="$1"
local port="$start_port"
while true; do
sockstat -P tcp -p 443
port=$((port + 1))
done
}
function ngctlcat {
if [ "$VERBOSE" = "YES" ]; then
tee /dev/tty | ngctl -d -f -
else
ngctl -d -f -
fi
}
main "${@}"

View File

@@ -0,0 +1,37 @@
#!/bin/sh
#
# REQUIRE: LOGIN FILESYSTEMS
# PROVIDE: bhyverc
# KEYWORD: shutdown
. /etc/rc.subr
name=bhyverc
rcvar=${name}_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
status_cmd="${name}_status"
console_cmd="${name}_console"
extra_commands="console"
load_rc_config $name
bhyverc_start() {
export PATH="$PATH:/usr/local/bin"
exec /usr/local/bin/bhyverc start "${@}"
}
bhyverc_status() {
export PATH="$PATH:/usr/local/bin"
exec /usr/local/bin/bhyverc status "${@}"
}
bhyverc_stop() {
export PATH="$PATH:/usr/local/bin"
exec /usr/local/bin/bhyverc stop "${@}"
}
bhyverc_console() {
export PATH="$PATH:/usr/local/bin"
exec /usr/local/bin/bhyverc console "${@}"
}
run_rc_command "$@"

View File

@@ -22,6 +22,25 @@
loop: loop:
- src: bhyve_netgraph_bridge.bash - src: bhyve_netgraph_bridge.bash
dest: /usr/local/bin/bhyve_netgraph_bridge dest: /usr/local/bin/bhyve_netgraph_bridge
- src: bhyverc.bash
dest: /usr/local/bin/bhyverc
- name: Install rc script
copy:
src: "files/{{ item.src }}"
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
owner: root
group: wheel
mode: 0755
loop:
- src: bhyverc.sh
dest: bhyverc
- name: Enable bhyverc
community.general.sysrc:
name: bhyverc_enable
value: "YES"
path: /etc/rc.conf.d/bhyverc
- name: Create zfs dataset - name: Create zfs dataset
zfs: zfs:

View File

@@ -1,3 +1,43 @@
# - name: Create directories
# file:
# name: "{{ item }}"
# state: directory
# mode: 0755
# owner: root
# group: wheel
# loop:
# - /foo/bar
# - name: Install scripts
# copy:
# src: "files/{{ item.src }}"
# dest: "{{ item.dest }}"
# mode: 0755
# owner: root
# group: wheel
# loop:
# - src: foo.bash
# dest: /usr/local/bin/foo
# - name: Install Configuration
# copy:
# src: "files/{{ item.src }}"
# dest: "{{ item.dest }}"
# mode: 0600
# owner: root
# group: wheel
# loop:
# - src: foo.conf
# dest: /usr/local/etc/foo.conf
# - name: Clone Source
# git:
# repo: "https://foo.bar/baz.git"
# dest: /foo/bar
# version: "v1.0.2"
# force: true
# diff: false
- import_tasks: tasks/freebsd.yaml - import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"' when: 'os_flavor == "freebsd"'

View File

@@ -1 +0,0 @@
freebsd_version: "releng/13.2"

View File

@@ -1,6 +0,0 @@
include GENERIC-NODEBUG
# Disable Intel SD/MMC controller for reading eMMC
nodevice sdhci
ident CUSTOM

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
#
# If something is very wrong in pacman, this removes the keyring and the entire custom repo, then sets up pacman's keyring again. Running the ansible playbook is necessary to get the custom repo added.
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
doas rm -rf /var/cache/pacman/custom/ /etc/pacman.d/conf.d/aurutils.conf
doas rm -rf /etc/pacman.d/gnupg
doas pacman-key --init
doas pacman-key --populate archlinux
doas pacman -S archlinux-keyring

View File

@@ -5,4 +5,4 @@ set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
GPGKEY=27DE40D9B8455C1B exec aur sync --makepkg-conf /etc/aurutils/makepkg.conf -c --sign "$@" GPGKEY=4278299FB84F6875 exec aur sync --makepkg-conf /etc/aurutils/makepkg.conf -c --sign "$@"

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
# Update packages in aurutils with -git suffix.
#
# This has to be done manually because aurutils does not check for new git commits every time we run an update.
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pacman -Slq custom | grep -E -- '-git$' | xargs aurutils-sync --no-ver --reset "$@"

View File

@@ -1,20 +0,0 @@
#!/usr/bin/env bash
#
# Build and installs whatever is in /usr/src. Run step 1, reboot, then step 2.
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cores=$(sysctl -n hw.ncpu)
if sudo etcupdate status | grep -qE '^ C '; then
>&2 echo 'Conflicts remain in etcupdate. Run `etcupdate resolve` to fix them first.'
exit 1
fi
cd /usr/src
make -j "$cores" clean
make -j "$cores" buildworld buildkernel
sudo make installkernel
echo "FreeBSD update step 1 done. Please reboot."

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env bash
#
# Build and installs whatever is in /usr/src. Run step 1, reboot, then step 2.
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
sudo etcupdate -p
cd /usr/src
sudo make installworld
sudo etcupdate -B
if sudo etcupdate status | grep -qE '^ C '; then
>&2 echo 'Conflicts in etcupdate. Run `etcupdate resolve` to fix them first.'
exit 1
fi
echo "FreeBSD update step 2 done. Please reboot."

View File

@@ -1,34 +1,27 @@
-----BEGIN PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEXZwWGhYJKwYBBAHaRw8BAQdAfv7qozKkmf4D+5PDzADsMm4aAKDGLha7+Cu0 mDMEaNLjzBYJKwYBBAHaRw8BAQdAoegj6iXzJgxBkW8LyRS8ANRzp0LqyFbW1kRr
0H+RsWG0HVRvbSBBbGV4YW5kZXIgPHRvbUBmaXp6LmJ1eno+iJAEExYIADgWIQS4 Z4VtVRK0HlRvbSBBbGV4YW5kZXIgPHdvcmtAZml6ei5idXp6PoiQBBMWCAA4FiEE
SBWTY8KHeReVS+En3kDZuEVcGwUCXZwWGgIbAwULCQgHAgYVCAkKCwIEFgIDAQIe 0nLI1hZ/JoWUZ2ZvQngpn7hPaHUFAmjS7GoCGwEFCwkIBwIGFQoJCAsCBBYCAwEC
AQIXgAAKCRAn3kDZuEVcG9glAQDX3Bzaz9sQpycc40LeLxSKQsWplfJigfr8wWOg HgECF4AACgkQQngpn7hPaHXNRAEAxOHPULwbf/FIzS7spmdSYrcCX/foaB78rpCT
C15TywEAqkTtCrTNsltdZERLMre7qnv/6RSo54OW0C4pdN7UUAa0HlRvbSBBbGV4 /MzDPvMBANy0PcseR1ZxoHZDcAsYDa0CSCrO6oLwPFriVss3RA0GtB1Ub20gQWxl
YW5kZXIgPHdvcmtAZml6ei5idXp6PoiQBBMWCAA4FiEEuEgVk2PCh3kXlUvhJ95A eGFuZGVyIDx0b21AZml6ei5idXp6PoiTBBMWCAA7AhsBBQsJCAcCBhUKCQgLAgQW
2bhFXBsFAl+w+R0CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQJ95A2bhF AgMBAh4BAheAFiEE0nLI1hZ/JoWUZ2ZvQngpn7hPaHUFAmjS7MkCGQEACgkQQngp
XBt6fgD+NOYnw9gz5K/q3H5LE/JvqzCSHezJmeGgif0CuU4m1/MA+gPDKME7syEt n7hPaHX9fQEA4ngwEKr0nlKxH5bQV9u/EJeI3wbSgBjlnyTQuI79AB4BAO6+frGt
JsTpELEMrxWWpDW0tD/W1iJE7roGYPQPtB9Ub20gQWxleGFuZGVyIDx0b21AaGFy 8S+p6qFZ4ufqyGPfklxPeOJLSYk0PLKVNMcHuDMEaNLm8xYJKwYBBAHaRw8BAQdA
bW9uaWMuYWk+iJAEExYIADgWIQS4SBWTY8KHeReVS+En3kDZuEVcGwUCX7D5RAIb HDhppS6yD8j1Bb/i6ku16uQ3qhshDNA9cOQeMxBae9aI9QQYFggAJhYhBNJyyNYW
AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRAn3kDZuEVcGzjDAP9pM1ScstOk fyaFlGdmb0J4KZ+4T2h1BQJo0ubzAhsCBQkDwmcAAIEJEEJ4KZ+4T2h1diAEGRYI
ti+oRAsNSk8qsjIsCT9O5voDS0Q7plWlcwD/btKVFO9tPLsXhyvdB+NSwueVs7TA AB0WIQS9v3ap15pUELURqaY2yZ6LPDnYXwUCaNLm8wAKCRA2yZ6LPDnYXyaNAPsF
kRVjlW3hktpefg24OARdnBYaEgorBgEEAZdVAQUBAQdArbTYQgDBMG7EBFTKA6+f gR37jEqfgEByVsoKY6bB82T79o9d4FQe1iPsURyuLwD/fkQyV3NwGjysxkoZqYmK
4CWgwl26Lf2b6cyCGfUw2j4DAQgHiHgEGBYIACAWIQS4SBWTY8KHeReVS+En3kDZ mXJYqtWRBTe2G2UUkm6E/QafHwD+IbkCZ6sGTcexsqzex5x6U8TOvbdVS4dKjSf1
uEVcGwUCXZwWGgIbDAAKCRAn3kDZuEVcG03MAQCrkjrE+MhtvbfGaHGHlwz9QnF0 nVRGxvwBAPiIJsXWVuwmskWMDpcaW/qgQ8hOEuq7/vlkZDGOnMgOuDgEaNLnDBIK
Z519YzK8Xr8m0O+09QEA9BFCfkAzBM4D4JKeWJh/tmN9U6UexzLrRdY+W9cugAm4 KwYBBAGXVQEFAQEHQBcOCDGnrRwv51c5B7QVLMkLC2UKUzPPrahLZHT3RWhmAwEI
MwRdnBbKFgkrBgEEAdpHDwEBB0A/IgvgQaDhPkk72raSlUPLZaMyJfPedlfBhbgY B4h+BBgWCAAmFiEE0nLI1hZ/JoWUZ2ZvQngpn7hPaHUFAmjS5wwCGwwFCQPCZwAA
uhNiSIj1BBgWCAAmAhsCFiEEuEgVk2PCh3kXlUvhJ95A2bhFXBsFAl+w+hYFCQe4 CgkQQngpn7hPaHUZIAD/ZwQ9sLIwuO5qPFAAkqcaNyt68O6WkD8sKaq1r/TPviAA
fcwAgXYgBBkWCAAdFiEEgeZEOZZ1UC6xJRa606F5yaU8Dt4FAl2cFsoACgkQ06F5 /j92d7cRUIkJtS8odRYlK51r9eMeTGh2npaO+j3VKCgBuDMEaNLnJRYJKwYBBAHa
yaU8Dt6MngD+Krs3aYyHH6i85ebVESgBI8XeXhgACM4exepw+0UcoYkBAKK4DvV3 Rw8BAQdAPT7jOLbozd5hacityJHniQ6UbHN+AJcb6jh5rXOnOuSIfgQYFggAJhYh
oJD6o1ku6Rr8pUH962SQm8PO9pO2JBBAb6ADCRAn3kDZuEVcG9uAAP43vUsbe24/ BNJyyNYWfyaFlGdmb0J4KZ+4T2h1BQJo0uclAhsgBQkDwmcAAAoJEEJ4KZ+4T2h1
6tjEezAW0a4L2E1u4HNU8t53lolngs1kswEAy1HBdYEMR9TovX/kMeBHLcz1J2pM rREA/3QE6suVUDl4OS2tCi4z2fh/7kjt29I3IFo+/B0AOumgAP0ao8FGqJyFC8YA
VRSV0JnJhj5eZwa4MwRdnBcBFgkrBgEEAdpHDwEBB0BrvpOZa4q6JHVuc1XUVQTq 7V6T4qrXHbhlqTeofGhQ+iu7HqZVCw==
hDgLwD5SJBvzHSTXPYOZMoh+BBgWCAAmAhsgFiEEuEgVk2PCh3kXlUvhJ95A2bhF =OfDR
XBsFAl+w+hYFCQe4fZUACgkQJ95A2bhFXBs3NgEA3SFYTgRVstidfoEpEZV4DdSL
kXaOwN3Eyba4UniClyMA/2CCxQt24vu19TyvUtOXWCp9Zi8SyIqoeiXQ4ZmhhnQO
uDgEXZwXKBIKKwYBBAGXVQEFAQEHQA7S3cFTEu6iROopVyF4UBl3hQrEAbOc9CW+
xXKFZYgSAwEIB4h+BBgWCAAmAhsMFiEEuEgVk2PCh3kXlUvhJ95A2bhFXBsFAl+w
+hcFCQe4fW4ACgkQJ95A2bhFXBtUXAEAyEJCUNVSJ7qvQv5IXuwbYTX2Mh7JU3+F
GJHO7AWBXCQA/2aLAi9kYmz9ba770XYwTeBZIv9Y6UIwIwVmFdYHC/EM
=a/z4
-----END PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----

View File

@@ -0,0 +1,27 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEaNLjzBYJKwYBBAHaRw8BAQdAoegj6iXzJgxBkW8LyRS8ANRzp0LqyFbW1kRr
Z4VtVRK0HlRvbSBBbGV4YW5kZXIgPHdvcmtAZml6ei5idXp6PoiQBBMWCAA4FiEE
0nLI1hZ/JoWUZ2ZvQngpn7hPaHUFAmjS7GoCGwEFCwkIBwIGFQoJCAsCBBYCAwEC
HgECF4AACgkQQngpn7hPaHXNRAEAxOHPULwbf/FIzS7spmdSYrcCX/foaB78rpCT
/MzDPvMBANy0PcseR1ZxoHZDcAsYDa0CSCrO6oLwPFriVss3RA0GtB1Ub20gQWxl
eGFuZGVyIDx0b21AZml6ei5idXp6PoiTBBMWCAA7AhsBBQsJCAcCBhUKCQgLAgQW
AgMBAh4BAheAFiEE0nLI1hZ/JoWUZ2ZvQngpn7hPaHUFAmjS7MkCGQEACgkQQngp
n7hPaHX9fQEA4ngwEKr0nlKxH5bQV9u/EJeI3wbSgBjlnyTQuI79AB4BAO6+frGt
8S+p6qFZ4ufqyGPfklxPeOJLSYk0PLKVNMcHuDMEaNLm8xYJKwYBBAHaRw8BAQdA
HDhppS6yD8j1Bb/i6ku16uQ3qhshDNA9cOQeMxBae9aI9QQYFggAJhYhBNJyyNYW
fyaFlGdmb0J4KZ+4T2h1BQJo0ubzAhsCBQkDwmcAAIEJEEJ4KZ+4T2h1diAEGRYI
AB0WIQS9v3ap15pUELURqaY2yZ6LPDnYXwUCaNLm8wAKCRA2yZ6LPDnYXyaNAPsF
gR37jEqfgEByVsoKY6bB82T79o9d4FQe1iPsURyuLwD/fkQyV3NwGjysxkoZqYmK
mXJYqtWRBTe2G2UUkm6E/QafHwD+IbkCZ6sGTcexsqzex5x6U8TOvbdVS4dKjSf1
nVRGxvwBAPiIJsXWVuwmskWMDpcaW/qgQ8hOEuq7/vlkZDGOnMgOuDgEaNLnDBIK
KwYBBAGXVQEFAQEHQBcOCDGnrRwv51c5B7QVLMkLC2UKUzPPrahLZHT3RWhmAwEI
B4h+BBgWCAAmFiEE0nLI1hZ/JoWUZ2ZvQngpn7hPaHUFAmjS5wwCGwwFCQPCZwAA
CgkQQngpn7hPaHUZIAD/ZwQ9sLIwuO5qPFAAkqcaNyt68O6WkD8sKaq1r/TPviAA
/j92d7cRUIkJtS8odRYlK51r9eMeTGh2npaO+j3VKCgBuDMEaNLnJRYJKwYBBAHa
Rw8BAQdAPT7jOLbozd5hacityJHniQ6UbHN+AJcb6jh5rXOnOuSIfgQYFggAJhYh
BNJyyNYWfyaFlGdmb0J4KZ+4T2h1BQJo0uclAhsgBQkDwmcAAAoJEEJ4KZ+4T2h1
rREA/3QE6suVUDl4OS2tCi4z2fh/7kjt29I3IFo+/B0AOumgAP0ao8FGqJyFC8YA
7V6T4qrXHbhlqTeofGhQ+iu7HqZVCw==
=OfDR
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -1,3 +0,0 @@
KERNCONF=CUSTOM
BUILD_STATIC=YES

View File

@@ -31,10 +31,11 @@ Architecture = auto
# Misc options # Misc options
#UseSyslog #UseSyslog
#Color #Color
#TotalDownload NoProgressBar
# We cannot check disk space from within a chroot environment # We cannot check disk space from within a chroot environment
#CheckSpace #CheckSpace
#VerbosePkgLists VerbosePkgLists
ParallelDownloads = 5
# By default, pacman accepts packages signed by keys that its local keyring # By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages. # trusts (see pacman-key and its man page), as well as unsigned packages.
@@ -69,32 +70,24 @@ LocalFileSigLevel = Optional
# repo name header and Include lines. You can add preferred servers immediately # repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors. # after the header, and they will be used before the default mirrors.
#[testing] #[core-testing]
#Include = /etc/pacman.d/mirrorlist #Include = /etc/pacman.d/mirrorlist
[core] [core]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
#[extra-testing]
#Include = /etc/pacman.d/mirrorlist
[extra] [extra]
Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for # An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories. # tips on creating your own repositories.
#[custom] #[custom]
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
#Server = file:///home/custompkgs #Server = file:///home/custompkgs
[custom]
SigLevel = Required
Server = file:///var/cache/pacman/custom

View File

@@ -1,3 +1,5 @@
dependencies: dependencies:
- users - role: users
- gpg when: 'os_flavor == "linux"'
- role: gpg
when: 'os_flavor == "linux"'

View File

@@ -3,12 +3,3 @@
- import_tasks: tasks/linux.yaml - import_tasks: tasks/linux.yaml
when: 'os_flavor == "linux"' when: 'os_flavor == "linux"'
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user

View File

@@ -1,94 +0,0 @@
- name: Install packages
package:
name:
- git
state: present
- name: Create directories
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
loop:
- "/usr/src"
# - "/usr/ports"
- "/usr/obj"
- name: chown the FreeBSD source
file:
name: "{{ item }}"
state: directory
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
recurse: true
loop:
- "/usr/src"
- name: Clone FreeBSD Source
git:
repo: "https://git.FreeBSD.org/src.git"
dest: /usr/src
version: "{{ freebsd_version }}"
force: true
become: true
become_user: "{{ build_user.name }}"
diff: false
# - name: Clone Ports Tree
# git:
# repo: "https://git.FreeBSD.org/ports.git"
# dest: /usr/ports
# version: "main"
# force: true
# update: false
# become: true
# become_user: "{{ build_user.name }}"
# diff: false
- name: Install Configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: make.conf
dest: /etc/make.conf
- name: Install Configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
loop:
- src: CUSTOM
dest: /usr/src/sys/amd64/conf/CUSTOM
- name: Install Configuration
template:
src: "templates/{{ item.src }}.j2"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: src.conf
dest: /etc/src.conf
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0700
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
loop:
- src: freebsd_update_step1
dest: /usr/local/bin/freebsd_update_step1
- src: freebsd_update_step2
dest: /usr/local/bin/freebsd_update_step2

View File

@@ -39,12 +39,12 @@
- name: Trust my signing key - name: Trust my signing key
command: pacman-key -a - command: pacman-key -a -
args: args:
stdin: "{{ lookup('file', 'gpg.asc') }}" stdin: "{{ lookup('file', pgp_key|default('gpg.asc')) }}"
when: '"B848159363C2877917954BE127DE40D9B8455C1B" not in pacmankeys.stdout' when: '"D272C8D6167F26859467666F4278299FB84F6875" not in pacmankeys.stdout'
register: my_key_imported register: my_key_imported
- name: Sign my signing key - name: Sign my signing key
command: pacman-key --lsign-key "B848159363C2877917954BE127DE40D9B8455C1B" command: pacman-key --lsign-key "D272C8D6167F26859467666F4278299FB84F6875"
when: my_key_imported.changed when: my_key_imported.changed
- name: Build the aurutils package - name: Build the aurutils package
@@ -89,17 +89,26 @@
loop: loop:
- src: aurutils.conf - src: aurutils.conf
dest: /etc/pacman.d/conf.d/ dest: /etc/pacman.d/conf.d/
- src: pacman-custom.conf - src: pacman-x86_64.conf
dest: /etc/aurutils/ dest: /etc/aurutils/
- src: makepkg.conf # TODO: Is this needed or can I use the default from devtools? - src: makepkg.conf # TODO: Is this needed or can I use the default from devtools?
dest: /etc/aurutils/ dest: /etc/aurutils/
- name: chown the custom package db
file:
path: "{{ item }}"
owner: "{{ build_user.name }}"
recurse: true
loop:
- /var/cache/pacman/custom/
- name: Create custom repo db - name: Create custom repo db
command: repo-add --sign /var/cache/pacman/custom/custom.db.tar # shell: repo-add --new --sign /var/cache/pacman/custom/custom.db.tar "/home/{{ build_user.name }}/.config/ansible_deploy/aurutils/aurutils-*-any.pkg.tar.*"
command: repo-add --new --sign /var/cache/pacman/custom/custom.db.tar
become: true become: true
become_user: "{{ build_user.name }}" become_user: "{{ build_user.name }}"
args: args:
creates: /var/cache/pacman/custom/custom.db.tar creates: /var/cache/pacman/custom/custom.db.tar.sig
- name: Install scripts - name: Install scripts
copy: copy:
@@ -111,8 +120,12 @@
loop: loop:
- src: aurutils-purge - src: aurutils-purge
dest: /usr/local/bin/aurutils-purge dest: /usr/local/bin/aurutils-purge
- src: aurutils-nuke
dest: /usr/local/bin/aurutils-nuke
- src: aurutils-sync - src: aurutils-sync
dest: /usr/local/bin/aurutils-sync dest: /usr/local/bin/aurutils-sync
- src: aurutils-update-devel-packages
dest: /usr/local/bin/
- name: build aurutils inside aurutils - name: build aurutils inside aurutils
become_user: "{{ build_user.name }}" become_user: "{{ build_user.name }}"

View File

@@ -1,22 +0,0 @@
{% if cpu_opt is defined and cpu_opt %}
CPUTYPE?={{ cpu_opt }}
{% endif %}
OPTIMIZED_CFLAGS=YES
BUILD_OPTIMIZED=YES
WITH_CPUFLAGS=YES
WITH_MALLOC_PRODUCTION=YES
WITHOUT_LLVM_ASSERTIONS=YES
WITH_REPRODUCIBLE_BUILD=YES
# Would be fun to experiment with:
# WITHOUT_SOURCELESS=YES
# Questionable Optimizations
WITHOUT_FLOPPY=YES
WITHOUT_HTML=YES
WITHOUT_IPFW=YES
WITHOUT_IPFILTER=YES
WITHOUT_LLVM_TARGET_ALL=YES
# Commented out because maybe I want email alerts for failing disks
# WITHOUT_MAIL=YES
# WITHOUT_SENDMAIL=YES

View File

@@ -0,0 +1,2 @@
--ozone-platform-hint=auto
--enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE,AcceleratedVideoEncoder

View File

@@ -1,2 +1,2 @@
dependencies: dependencies:
- build - users

View File

@@ -0,0 +1,55 @@
# - name: Create directories
# file:
# name: "{{ item }}"
# state: directory
# mode: 0755
# owner: root
# group: wheel
# loop:
# - /foo/bar
# - name: Install scripts
# copy:
# src: "files/{{ item.src }}"
# dest: "{{ item.dest }}"
# mode: 0755
# owner: root
# group: wheel
# loop:
# - src: foo.bash
# dest: /usr/local/bin/foo
# - name: Install Configuration
# copy:
# src: "files/{{ item.src }}"
# dest: "{{ item.dest }}"
# mode: 0600
# owner: root
# group: wheel
# loop:
# - src: foo.conf
# dest: /usr/local/etc/foo.conf
# - name: Clone Source
# git:
# repo: "https://foo.bar/baz.git"
# dest: /foo/bar
# version: "v1.0.2"
# force: true
# diff: false
- import_tasks: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/linux.yaml
when: 'os_flavor == "linux"'
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
when: users is defined
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user

View File

@@ -0,0 +1,5 @@
# - name: Install packages
# package:
# name:
# - foo
# state: present

View File

@@ -0,0 +1,7 @@
# Check chrome://gpu/ to confirm hardware video decoding and vulkan rendering is working.
- name: Install packages
package:
name:
- chromium
state: present

View File

@@ -0,0 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics

View File

@@ -0,0 +1,10 @@
- name: Copy files
copy:
src: "files/{{ item.src }}"
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
mode: 0600
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- src: chromium-flags.conf
dest: .config/chromium-flags.conf

View File

@@ -1 +0,0 @@
aesni_load="YES"

View File

@@ -0,0 +1 @@
microcode_update_enable="YES"

View File

@@ -7,6 +7,12 @@ IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
perc=$1 perc=$1
if [ "$perc" -gt 100 ]; then
perc=100
fi
if [ "$perc" -lt 0 ]; then
perc=0
fi
epp=$((100 - perc)) epp=$((100 - perc))
sysctl -N dev.hwpstate_intel | grep -E 'dev.hwpstate_intel.[0-9]+.epp' | while read var; do sysctl -N dev.hwpstate_intel | grep -E 'dev.hwpstate_intel.[0-9]+.epp' | while read var; do

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
#
# Tell speedshift whether to maximize CPU performance (100) or energy
# efficiency (0).
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
perc=$1
if [ $perc -lt 50 ]; then
echo "power" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
else
echo "performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
fi

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
#
# Tell hardware p-states whether to maximize CPU performance (100) or
# energy efficiency (0).
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
perc=$1
if [ "$perc" -gt 80 ]; then
echo performance | tee /sys/firmware/acpi/platform_profile
elif [ "$perc" -ge 20 ]; then
echo balanced | tee /sys/firmware/acpi/platform_profile
else
echo low-power | tee /sys/firmware/acpi/platform_profile
fi
if [ "$perc" -ge 80 ]; then
echo "performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
elif [ "$perc" -ge 60 ]; then
echo "balance_performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
elif [ "$perc" -ge 40 ]; then
echo "default" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
elif [ "$perc" -ge 20 ]; then
echo "balance_power" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
else
echo "power" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
fi

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
#
# Tell speedshift whether to maximize CPU performance (100) or energy
# efficiency (0). If set to 101 this will enable turboboost.
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
perc=$1
if [ "$perc" -gt 100 ]; then
echo 0 | tee /sys/devices/system/cpu/intel_pstate/no_turbo
else
echo 1 | tee /sys/devices/system/cpu/intel_pstate/no_turbo
fi
if [ "$perc" -ge 80 ]; then
echo "performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
elif [ "$perc" -ge 60 ]; then
echo "balance_performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
elif [ "$perc" -ge 40 ]; then
echo "default" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
elif [ "$perc" -ge 20 ]; then
echo "balance_power" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
else
echo "power" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
fi

View File

@@ -0,0 +1 @@
cryptodev_load="YES"

View File

@@ -0,0 +1,6 @@
# Load Intel microcode at boot before the kernel does feature detection.
#
# The alternative would have been /etc/rc.conf with:
# microcode_update_enable="YES"
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/intel-ucode.bin"

View File

@@ -0,0 +1,2 @@
# Favor energy efficiency for platform profile (EC / system, not CPU)
w- /sys/firmware/acpi/platform_profile - - - - low-power

View File

@@ -1,3 +1,9 @@
- name: Install packages
package:
name:
- cpu-microcode-amd
state: present
- name: Install loader.conf - name: Install loader.conf
copy: copy:
src: "files/{{ item }}_loader.conf" src: "files/{{ item }}_loader.conf"
@@ -17,8 +23,10 @@
group: wheel group: wheel
loop: loop:
- power_profile - power_profile
- amd_microcode
- name: Install loader.conf - name: Install loader.conf
when: hwpstate is defined and hwpstate
copy: copy:
src: "files/{{ item }}_loader.conf" src: "files/{{ item }}_loader.conf"
dest: "/boot/loader.conf.d/{{ item }}.conf" dest: "/boot/loader.conf.d/{{ item }}.conf"
@@ -26,4 +34,5 @@
owner: root owner: root
group: wheel group: wheel
loop: loop:
- aesni - per_core_hwpstate
- cryptodev

View File

@@ -3,6 +3,7 @@
name: name:
- lscpu # need to kldload cpuctl - lscpu # need to kldload cpuctl
- powermon # need to kldload cpuctl - powermon # need to kldload cpuctl
- cpu-microcode-intel
state: present state: present
- name: Install loader.conf - name: Install loader.conf
@@ -15,7 +16,7 @@
loop: loop:
- coretemp - coretemp
- cpuctl - cpuctl
- aesni - intel_microcode
- name: Install service configuration - name: Install service configuration
copy: copy:
@@ -76,4 +77,5 @@
owner: root owner: root
group: wheel group: wheel
loop: loop:
- percorespeedshift - per_core_hwpstate
- cryptodev

View File

@@ -0,0 +1,40 @@
- name: Install packages
package:
name:
- powertop
state: present
- name: Favor energy efficiency for hardware p-states
when: hwpstate is defined and hwpstate and cores is defined
template:
src: "templates/{{ item.src }}.j2"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: energy_performance_preference.conf
dest: /etc/tmpfiles.d/energy_performance_preference.conf
- name: Install tmpfiles.d configuration
when: hwpstate is defined and hwpstate and cores is defined
copy:
src: "files/{{ item }}_tmpfiles.conf"
dest: "/etc/tmpfiles.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- platform_profile
- name: Install scripts
when: hwpstate is defined and hwpstate
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: cpu_set_perf_perc_linux_amd
dest: /usr/local/bin/cpu_set_perf_perc

View File

@@ -19,7 +19,7 @@
template: template:
src: "templates/{{ item.src }}.j2" src: "templates/{{ item.src }}.j2"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
mode: 0755 mode: 0644
owner: root owner: root
group: wheel group: wheel
loop: loop:
@@ -35,5 +35,5 @@
owner: root owner: root
group: wheel group: wheel
loop: loop:
- src: cpu_set_perf_perc_linux - src: cpu_set_perf_perc_linux_intel
dest: /usr/local/bin/cpu_set_perf_perc dest: /usr/local/bin/cpu_set_perf_perc

View File

@@ -1,4 +1,4 @@
# Favor energy efficiency for Speed Shift # Favor energy efficiency for hardware p-states
{% for core in range(0, cores, 1) %} {% for core in range(0, cores, 1) %}
w- /sys/devices/system/cpu/cpufreq/policy{{core}}/energy_performance_preference - - - - power w- /sys/devices/system/cpu/cpufreq/policy{{core}}/energy_performance_preference - - - - power
{% endfor %} {% endfor %}

View File

@@ -0,0 +1,25 @@
# [localrules=10]
# add path 'input/*' mode 0660 group video
# add path 'usb/*' mode 0660 group usb
[tajailwg=13]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'bpf*' unhide
add path pf unhide
add path pflog unhide
add path pfsynv unhide
add path 'tun*' unhide
[tajaildhcp=14]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'bpf*' unhide
[tajailrand=15]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path urandom unhide

View File

@@ -2,6 +2,8 @@
package: package:
name: name:
- docker - docker
- docker-compose
- docker-buildx
state: present state: present
- name: Create docker zfs dataset - name: Create docker zfs dataset

View File

@@ -0,0 +1 @@
emacs_flavor: "plain" # or full for systems where I do real development.

View File

@@ -1,106 +0,0 @@
(package-initialize)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")
)
(when (not package-archive-contents)
(package-refresh-contents))
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-delete-old-versions t
auto-package-update-interval 14)
(auto-package-update-maybe))
(defconst private-dir (expand-file-name "private" user-emacs-directory))
(defconst temp-dir (format "%s/cache" private-dir)
"Hostname-based elisp temp directories")
;; Emacs customizations
(setq-default
inhibit-startup-screen t
initial-scratch-message nil
;; Send prompts to mini-buffer not the GUI
use-dialog-box nil
confirm-nonexistent-file-or-buffer t
save-interprogram-paste-before-kill t
mouse-yank-at-point t
require-final-newline t
visible-bell nil
ring-bell-function 'ignore
custom-file "~/.emacs.d/.custom.el"
;; http://ergoemacs.org/emacs/emacs_stop_cursor_enter_prompt.html
minibuffer-prompt-properties
'(read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt)
;; Disable non selected window highlight
cursor-in-non-selected-windows nil
highlight-nonselected-windows nil
;; PATH
exec-path (append exec-path '("/usr/local/bin/"))
indent-tabs-mode nil
tab-width 4
inhibit-startup-message t
fringes-outside-margins t
x-select-enable-clipboard t
use-package-always-ensure t
ispell-program-name "aspell"
browse-url-browser-function 'browse-url-generic
browse-url-generic-program "firefox-developer-edition"
frame-title-format '("" invocation-name ": "(:eval (if (buffer-file-name)
(abbreviate-file-name (buffer-file-name))
"%b")))
;; mouse-wheel-progressive-speed nil ;; Don't accelerate mouse wheel
;; mouse-wheel-scroll-amount '(5 ((shift) . 3))
use-short-answers t
package-native-compile t
delete-selection-mode t
)
(defun assert-directory (p)
(unless (file-exists-p p) (make-directory p t))
p
)
(assert-directory (concat temp-dir "/auto-save-list/"))
(setq autoload-directory (concat user-emacs-directory (file-name-as-directory "elisp") (file-name-as-directory "autoload")))
(add-to-list 'load-path (assert-directory autoload-directory))
;; Bookmarks
(setq
;; persistent bookmarks
bookmark-save-flag t
bookmark-default-file (concat temp-dir "/bookmarks"))
;; Backups enabled, use nil to disable
(setq
history-length 1000
backup-inhibited nil
make-backup-files nil
auto-save-default nil
auto-save-list-file-name (concat temp-dir "/autosave")
create-lockfiles nil
backup-directory-alist `((".*" . ,(concat temp-dir "/backup/")))
auto-save-file-name-transforms `((".*" ,(concat temp-dir "/auto-save-list/") t)))
;; Disable toolbar & menubar
(menu-bar-mode -1)
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when ( fboundp 'scroll-bar-mode)
(scroll-bar-mode -1))
(context-menu-mode +1)
;; Delete trailing whitespace before save
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(use-package diminish)
(provide 'base)
;;; base ends here

View File

@@ -1,41 +0,0 @@
(use-package eglot
:commands (eglot eglot-ensure)
:bind (:map eglot-mode-map
;; M-.
;; ([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
;; M-?
;; ([remap xref-find-references] . lsp-ui-peek-find-references)
("C-c C-a" . eglot-code-actions)
)
:hook (
(eglot-managed-mode . (lambda ()
(when (eglot-managed-p)
(corfu-mode +1)
)
))
)
:config
;; Increase garbage collection threshold for performance (default 800000)
(setq gc-cons-threshold 100000000)
;; Increase amount of data read from processes, default 4k
(when (>= emacs-major-version 27)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
)
(set-face-attribute 'eglot-highlight-symbol-face nil :background "#0291a1" :foreground "black")
(set-face-attribute 'eglot-mode-line nil :inherit 'mode-line :bold nil)
(use-package consult-eglot
:bind (
:map eglot-mode-map
;; C-M-.
([remap xref-find-apropos] . #'consult-eglot-symbols)
)
)
:custom
(eglot-autoshutdown t "Shut down server when last buffer is killed.")
(eglot-sync-connect 0 "Don't block on language server starting.")
)
(provide 'common-lsp)

View File

@@ -0,0 +1,25 @@
(setq gc-cons-threshold (* 128 1024 1024)) ;; 128MiB Increase garbage collection threshold for performance (default 800000)
;; Increase amount of data read from processes, default 4k
(when (version<= "27.0" emacs-version)
(setq read-process-output-max (* 10 1024 1024)) ;; 10MiB
)
;; Suppress warnings
(setq byte-compile-warnings '(not obsolete))
(setq warning-suppress-log-types '((comp) (bytecomp)))
(setq native-comp-async-report-warnings-errors 'silent)
;; Set up default visual settings
(setq frame-resize-pixelwise t)
;; Disable toolbar & menubar
(menu-bar-mode -1)
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when (display-graphic-p)
(context-menu-mode +1))
(setq default-frame-alist '((fullscreen . maximized)
(vertical-scroll-bars . nil)
(horizontal-scroll-bars . nil)
;; Set dark colors in early-init to prevent flashes of white.
(background-color . "#000000")))

View File

@@ -1,5 +1,7 @@
(use-package diminish)
;; Eglot recommends pulling the latest of the standard libraries it ;; Eglot recommends pulling the latest of the standard libraries it
;; uses from ELPA if you're not tracking the current emacs development ;; uses from ELPA if you're not tracking the current.config/emacsevelopment
;; branch. ;; branch.
(use-package xref (use-package xref
:pin gnu :pin gnu
@@ -27,46 +29,56 @@
:config :config
(dashboard-setup-startup-hook)) (dashboard-setup-startup-hook))
(use-package ediff
:config
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq-default ediff-highlight-all-diffs 'nil)
(setq ediff-diff-options "-w"))
(when (version<= "26.0.50" emacs-version ) (when (version<= "26.0.50" emacs-version )
(add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'prog-mode-hook 'display-line-numbers-mode)
(add-hook 'prog-mode-hook 'column-number-mode) (add-hook 'prog-mode-hook 'column-number-mode)
) )
(use-package page-break-lines) ;; Display a horizontal line instead of ^L for page break characters
(use-package page-break-lines
:diminish
:config
(global-page-break-lines-mode +1)
)
(use-package recentf (use-package recentf
;; This is an emacs built-in but we're pulling the latest version ;; This is an emacs built-in but we're pulling the latest version
:config :config
(setq recentf-max-saved-items 100) (setq recentf-max-saved-items 100)
(setq recentf-save-file (recentf-expand-file-name "~/.emacs.d/private/cache/recentf")) (setq recentf-save-file (recentf-expand-file-name "~/.config/emacs/private/cache/recentf"))
(recentf-mode 1)) (recentf-mode 1))
;; Persist history over Emacs restarts. Vertico sorts by history position. ;; Persist history over Emacs restarts. Vertico sorts by history position.
(use-package savehist (use-package savehist
;; This is an emacs built-in but we're pulling the latest version ;; This is an emacs built-in but we're pulling the latest version
:pin gnu
:config :config
(savehist-mode)) (savehist-mode))
(use-package which-key (use-package which-key
:pin gnu
:diminish :diminish
:config :config
(which-key-mode)) (which-key-mode))
(use-package windmove (use-package windmove
:config ;; This is an emacs built-in but we're pulling the latest version
(windmove-default-keybindings)) :pin gnu
:bind
(
("S-<up>" . windmove-up)
("S-<right>" . windmove-right)
("S-<down>" . windmove-down)
("S-<left>" . windmove-left)
)
)
(setq tramp-default-method "ssh") (setq tramp-default-method "ssh")
(use-package dockerfile-mode)
(use-package nginx-mode (use-package nginx-mode
:mode (
("headers\\.include\\'" . nginx-mode)
)
:config :config
(setq nginx-indent-level 4)) (setq nginx-indent-level 4))

View File

@@ -55,6 +55,14 @@
)) ))
(mapc load-it (directory-files dir nil "\\.el$")))) (mapc load-it (directory-files dir nil "\\.el$"))))
(defun generate-vc-link ()
(interactive)
(or
(generate-github-link)
(generate-source-hut-link)
)
)
(defun generate-github-link () (defun generate-github-link ()
"Generate a permalink to the current line." "Generate a permalink to the current line."
(interactive) (interactive)
@@ -69,10 +77,37 @@
(let* ( (let* (
(gh-org (match-string 2 repository-url)) (gh-org (match-string 2 repository-url))
(gh-repo (match-string 3 repository-url)) (gh-repo (match-string 3 repository-url))
(full-url (format "https://github.com/%s/%s/blob/%s/%s#L%s" gh-org gh-repo current-rev relative-path line-number)) (full-url (format "https://github.com/%s/%s/blob/%s/%s?plain=1#L%s" gh-org gh-repo current-rev relative-path line-number))
) )
(message "%s" full-url) (message "%s" full-url)
(kill-new full-url) (kill-new full-url)
t
)
)
)
)
)
(defun generate-source-hut-link ()
"Generate a permalink to the current line."
(interactive)
(let (
(current-rev (vc-working-revision buffer-file-name))
(line-number (line-number-at-pos))
(repository-url (vc-git-repository-url buffer-file-name))
(relative-path (file-relative-name buffer-file-name (vc-root-dir)))
)
(message "Using repo url %s" repository-url)
(save-match-data
(and (string-match "https://git.sr.ht/\\([^/]+\\)/\\([^/]+\\)" repository-url)
(let* (
(sh-org (match-string 1 repository-url))
(sh-repo (match-string 2 repository-url))
(full-url (format "https://git.sr.ht/%s/%s/tree/%s/%s#L%s" sh-org sh-repo current-rev relative-path line-number))
)
(message "%s" full-url)
(kill-new full-url)
t
) )
) )
) )

View File

@@ -7,6 +7,6 @@
;; dabbrev-expand. Seems to be some sort of dumb-expand. Accidentally hitting it when trying to use M-? ;; dabbrev-expand. Seems to be some sort of dumb-expand. Accidentally hitting it when trying to use M-?
(global-unset-key (kbd "M-/")) (global-unset-key (kbd "M-/"))
(global-set-key (kbd "C-x g l") 'generate-github-link) (global-set-key (kbd "C-x g l") 'generate-vc-link)
(provide 'base-global-keys) (provide 'base-global-keys)

Some files were not shown because too many files have changed in this diff Show More