449 Commits

Author SHA1 Message Date
Tom Alexander
6cdb8f066f Disable optimizations for quick iteration. 2025-09-19 19:08:31 -04:00
Tom Alexander
c73ecf422c Switch to using my fork of nixpkgs. 2025-09-19 19:08:30 -04:00
Tom Alexander
b179bee277 Pull in improvements from nixpkgs PR. 2025-09-06 20:32:25 -04:00
Tom Alexander
b1c85417e1 Update to linux 6.16. 2025-09-06 17:39:04 -04:00
Tom Alexander
96ea6c4232 Reduce abmlevel to 2.
Everything got dimmer in 6.14 so I am reducing the abmlevel.
2025-09-04 18:51:14 -04:00
Tom Alexander
2a584915e4 Install d2. 2025-09-04 18:51:14 -04:00
Tom Alexander
a6a50d7c22 Add d2 to emacs. 2025-09-04 18:51:14 -04:00
Tom Alexander
edfafd1017 Add latex packages for org export. 2025-09-04 18:51:13 -04:00
Tom Alexander
9adff4ebc1 Add laptop-only entry in shikane. 2025-09-01 18:48:42 -04:00
Tom Alexander
a788879d92 Preserve poetry venvs. 2025-09-01 18:48:38 -04:00
Tom Alexander
955c5963c8 Disable machine learning in firefox. 2025-08-31 22:21:34 -04:00
Tom Alexander
11436c0efe Set vscode navigate backwards to be scoped to the editor. 2025-08-27 20:33:37 -04:00
Tom Alexander
5b487330e1 Use json for talking to nix output monitor. 2025-08-24 17:36:06 -04:00
Tom Alexander
d25e9173dd Merge branch 'amd_s2idle' into nix 2025-08-21 20:30:35 -04:00
Tom Alexander
8bddf10e9d Fix description. 2025-08-21 20:30:23 -04:00
Tom Alexander
64c94e9b06 Add run-time dependencies. 2025-08-17 20:48:35 -04:00
Tom Alexander
c87957b8cb Introduce a cysystemd package. 2025-08-17 20:32:20 -04:00
Tom Alexander
bf419b6f4a Switch to buildPythonApplication. 2025-08-17 19:01:07 -04:00
Tom Alexander
b224a78b89 Add amd_s2idle script for debugging s2idle. 2025-08-17 10:37:51 -04:00
Tom Alexander
748584c78e Merge branch 'copy_files_mixin' into nix 2025-08-10 16:22:19 -04:00
Tom Alexander
64e8903ae4 Remove test code. 2025-08-10 16:19:13 -04:00
Tom Alexander
f4338ec8df Replace uses of home-manager. 2025-08-10 16:12:09 -04:00
Tom Alexander
c947def321 Fix handling ownership of parent directories. 2025-08-10 12:54:34 -04:00
Tom Alexander
f1eaaf12b3 Support separate permissions for containing directories. 2025-08-10 11:52:55 -04:00
Tom Alexander
2b485f7f1d Support recursive. 2025-08-10 11:41:06 -04:00
Tom Alexander
6db8e01309 Honor ownership. 2025-08-09 21:19:13 -04:00
Tom Alexander
03e389195c Filter out blank lines. 2025-08-09 21:01:35 -04:00
Tom Alexander
2c3e5483e9 Centralize the logic for escaping the shell values. 2025-08-09 20:54:54 -04:00
Tom Alexander
6b42a09468 Make the paths relative to the user's home directory. 2025-08-09 20:43:01 -04:00
Tom Alexander
eb5815048f Add a check and uninstall phase. 2025-08-09 20:27:27 -04:00
Tom Alexander
1cb4fa4234 Add support for symlinking. 2025-08-09 20:05:29 -04:00
Tom Alexander
146dc5f79a Switch to nested attrsets. 2025-08-09 19:13:37 -04:00
Tom Alexander
f667c9daa6 Switch to a systemd unit file to remove the need for home-manager. 2025-08-09 11:09:21 -04:00
Tom Alexander
83eaba357f Fix bug where it used the path in the option name rather than the target value inside the option. 2025-08-09 11:09:21 -04:00
Tom Alexander
6284ce8d86 Add method parameter. 2025-08-09 11:09:21 -04:00
Tom Alexander
c26d6f34ea Start a user-specific variant of the install file command. 2025-08-09 11:09:21 -04:00
Tom Alexander
c3f715d010 Add the install_file module from the steam deck config. 2025-08-09 11:09:21 -04:00
Tom Alexander
45514d147c Disable turboboost. 2025-08-09 10:42:20 -04:00
Tom Alexander
aafa880b7c Fix accelerated video decode on chromium. 2025-08-06 22:56:02 -04:00
Tom Alexander
dde8be4d9f Do not update refs when rebasing. 2025-08-06 22:23:16 -04:00
Tom Alexander
03ae8d3b0a Change how we bundle meld into git. 2025-07-19 18:41:57 -04:00
Tom Alexander
03f0721e1f Set up typescript language server and add meld to git. 2025-07-15 22:57:03 -04:00
Tom Alexander
8847063948 Install direnv. 2025-07-13 16:51:58 -04:00
Tom Alexander
399379cea0 Fix eglot rust-analyzer settings. 2025-07-07 19:26:55 -04:00
Tom Alexander
1cdfebf392 Disable cranelift.
It was causing problems (errors during build) while not providing much benefit for my use-cases.
2025-07-07 18:44:12 -04:00
Tom Alexander
045fed0748 Fix crashes on shadps4 launch. 2025-07-05 17:08:33 -04:00
Tom Alexander
7fe153bfd3 Update packages. 2025-07-05 10:01:09 -04:00
Tom Alexander
52490457f0 Install shadps4. 2025-06-29 10:22:09 -04:00
Tom Alexander
e5e9bba2a5 Pin old version of linux-firmware to fix wifi on laptop. 2025-06-28 09:47:40 -04:00
Tom Alexander
7ef079afc0 Update to Linux kernel 6.15. 2025-06-28 01:10:47 -04:00
Tom Alexander
a06fece8f1 Update packages. 2025-06-26 23:31:12 -04:00
Tom Alexander
51c7888347 Add dhcpcd for USB tethering and use upstream linux-firmware. 2025-06-23 13:02:10 -04:00
Tom Alexander
7656c30a29 Update packages. 2025-06-22 01:12:03 -04:00
Tom Alexander
929401b359 Switch to memtest86+. 2025-06-22 01:11:41 -04:00
Tom Alexander
16746d58d2 Add a git alias to list the number of commits from each author. 2025-06-20 17:55:06 -04:00
Tom Alexander
82a016ec68 Reduce risk of crashing from savestates. 2025-06-10 17:21:27 -04:00
Tom Alexander
eed2bd4f13 Persist Demon's Souls settings. 2025-06-08 12:08:47 -04:00
Tom Alexander
99f1b1a51b Update packages. 2025-06-01 20:12:34 -04:00
Tom Alexander
99bc8c6d79 Pin the version of linux-firmware.
New versions of linux-firmware break my wifi on my laptop. I am pinning the firmware version so I can update the rest of my software.
2025-06-01 20:10:25 -04:00
Tom Alexander
0f2c595538 Perform weekly garbage collects. 2025-06-01 11:21:57 -04:00
Tom Alexander
996cb27a89 Merge branch 'rpcs3' into nix 2025-05-26 19:26:13 -04:00
Tom Alexander
9008d9b7c6 Clean up steam rom manager. 2025-05-26 19:25:10 -04:00
Tom Alexander
38a1168a32 Persist persistent_settings.dat on steam deck. 2025-05-26 18:23:10 -04:00
Tom Alexander
3a4344a112 Copy the RPCS3 setup improvements to the steam deck config. 2025-05-26 16:26:48 -04:00
Tom Alexander
18cb758986 Fix lag in the home button menu. 2025-05-26 16:02:34 -04:00
Tom Alexander
e28c7f8968 Persist icons and play stats. 2025-05-26 15:46:10 -04:00
Tom Alexander
5c17148635 Write color buffers to fix black screen on Demon's Souls. 2025-05-26 15:32:10 -04:00
Tom Alexander
199bb38dfb Fix rpcs3 config. 2025-05-26 15:24:50 -04:00
Tom Alexander
5af4a95940 Add the rpcs3 config.yml file. 2025-05-26 14:51:13 -04:00
Tom Alexander
daf35778c5 Add rpcs3 (ps3 emulator). 2025-05-26 14:51:12 -04:00
Tom Alexander
1866cf6290 Disable cargo in emacs because it is causing errors. 2025-05-24 22:46:38 -04:00
Tom Alexander
23ef4d50b9 Add a comment about how to read ECC memory errors. 2025-05-23 18:01:24 -04:00
Tom Alexander
4aec400388 Auto-format typescript in vscode. 2025-05-19 19:11:21 -04:00
Tom Alexander
f211282376 Fix the build after the software update. 2025-05-15 20:13:27 -04:00
Tom Alexander
96a96a0bc4 Move CPU optimizations into their own role.
This is remove duplication between the individual hosts folders.
2025-05-12 22:53:56 -04:00
Tom Alexander
554a6aff65 Update software. 2025-05-11 14:39:36 -04:00
Tom Alexander
14c5c7d0fd Improve video convert script. 2025-05-11 00:11:29 -04:00
Tom Alexander
22f9a0efcd I think I figured out howto enable cross compiling between zen versions. 2025-05-10 23:11:33 -04:00
Tom Alexander
3e80452235 Merge branch '9pfs' into nix 2025-05-10 22:24:43 -04:00
Tom Alexander
c68c069667 Add a new ionlybootzfs host for the test VM.
This way it will install far less software.
2025-05-10 22:11:59 -04:00
Tom Alexander
e08d93425a Remove games from VMs. 2025-05-10 21:14:34 -04:00
Tom Alexander
5b7cae49c3 Removing the 9pfs nix store.
The experiment was good for mounting directories with various overlay patterns from the host to the guest, but using it specifically for /nix/store was a bad idea. It would be better to just serve the host nix store with nix-serve -p 8080 and add that as a substituter during install.
2025-05-10 20:47:45 -04:00
Tom Alexander
e65504b5f3 Add a role for mounting the nix store over 9pfs.
This is useful for virtual machines since we can have a persistent /nix/store on the host machine.
2025-05-10 20:47:45 -04:00
Tom Alexander
158188c4c6 Fix disabling optimizations in iso builds. 2025-05-10 16:41:55 -04:00
Tom Alexander
c587fcc2ac Re-enable fwupd. Without it, gnome-firmwarm seems to not work. 2025-05-10 15:34:50 -04:00
Tom Alexander
9d16c7bd7b Update emacs config. 2025-05-10 12:44:12 -04:00
Tom Alexander
2b3b9af70b Disable teleparty.
The firefox version has been buggy.
2025-05-10 12:04:48 -04:00
Tom Alexander
53f370b1ee Add yt-dlp. 2025-05-10 11:58:55 -04:00
Tom Alexander
25c8c30488 Add mkvmerge. 2025-05-07 23:31:17 -04:00
Tom Alexander
4d754355b7 Merge branch 'nix_worker' into nix 2025-05-04 16:40:24 -04:00
Tom Alexander
902c6e1127 Switch to quark's buildMachine config being entirely in nix rather than in root's ssh config. 2025-05-04 16:26:41 -04:00
Tom Alexander
98f98a8895 Centralize the config for buildMachines. 2025-05-04 16:22:02 -04:00
Tom Alexander
4a303d17d8 Add a nix_worker role for nix builders. 2025-05-04 15:53:49 -04:00
Tom Alexander
7f4c41bb32 Add odo deploy scripts. 2025-05-04 15:16:44 -04:00
Tom Alexander
c68a6aaa19 Introduce config.me.optimizations.enable to toggle optimizations.
This is more granular than the buildingIso setting.
2025-05-04 15:12:41 -04:00
Tom Alexander
a36ebbf94c Switching --no-build-nix to --fast because it fixes remote deploys to machines with different architectures.
I thought these flags were synonymous?
2025-05-04 14:50:14 -04:00
Tom Alexander
1044aa16b0 Update to linux 6.14. 2025-05-04 12:09:57 -04:00
Tom Alexander
efcefc129a Update versions and regenerate lockfile. 2025-04-28 18:24:37 -04:00
Tom Alexander
16dd93668d Keep build outputs on odo. 2025-04-27 22:44:12 -04:00
Tom Alexander
c457f6414b Fix sm64ex. 2025-04-25 20:14:24 -04:00
Tom Alexander
844466c2ca Update versions. 2025-04-21 08:14:20 -04:00
Tom Alexander
6cf6e61193 Add quark as a /etc/hosts entry. 2025-04-19 21:14:40 -04:00
Tom Alexander
ca3ef67533 Disable lvfs and minor bug fix in copy_files util. 2025-04-19 20:58:16 -04:00
Tom Alexander
56c0add33f Add Quark to nix config. 2025-04-19 20:47:10 -04:00
Tom Alexander
ba81687d42 Add duckstation to the steam deck. 2025-04-15 21:44:53 -04:00
Tom Alexander
144f83982d Copy over some networking sysctls from my ansible playbook. 2025-04-11 19:38:14 -04:00
Tom Alexander
a97a03f642 Sort imports. 2025-04-11 17:41:55 -04:00
Tom Alexander
fc47359184 Add support for yuzu and ryujinx. 2025-04-05 21:53:36 -04:00
Tom Alexander
812a762652 Import disko through the flake inputs instead of fetchTarball. 2025-04-05 12:22:33 -04:00
Tom Alexander
fb785e036b Add a comment. 2025-04-05 12:22:33 -04:00
Tom Alexander
cdc7d13225 Fix screen scaling during screen sharing. 2025-04-05 12:22:33 -04:00
Tom Alexander
ec4583b79e Switch to shikane.
Kanshi has been fine, but I want to see if I am missing anything that shikane offers.
2025-04-05 12:22:32 -04:00
Tom Alexander
cab8c8d955 Switch to regular emacs package instead of pinned-version. 2025-04-05 12:22:32 -04:00
Tom Alexander
33f582d17a Enable optimization for hydra ISO. 2025-04-05 12:22:32 -04:00
Tom Alexander
295ac24361 Verify all the optimized builds. 2025-04-05 12:22:32 -04:00
Tom Alexander
42dd67f9da Enable optimizations for shipwright (Ocarina of Time PC Port). 2025-03-30 18:43:15 -04:00
Tom Alexander
c173ea87cf Auto-create persist directories. 2025-03-30 18:32:32 -04:00
Tom Alexander
33f45c56bf Add dolphin for gamecube and wii. 2025-03-30 17:10:43 -04:00
Tom Alexander
83389cb5cf Add ares for snes and nintendo 64. 2025-03-30 13:51:50 -04:00
Tom Alexander
4db3ef1ed3 Put steam rom manager data in the persist folder. 2025-03-29 19:19:41 -04:00
Tom Alexander
fe7a083a7b Pass along args in steam wrappers. 2025-03-29 16:46:52 -04:00
Tom Alexander
cd0578d0a6 Stop forcing cascadia. 2025-03-29 16:30:27 -04:00
Tom Alexander
f56dcc7c42 Start a hydra role. 2025-03-29 16:30:27 -04:00
Tom Alexander
83de1e3708 Add support for persistent disks in the hydra iso. 2025-03-29 16:30:27 -04:00
Tom Alexander
2b20ab5123 Fix remote builder config. 2025-03-27 22:15:53 -04:00
Tom Alexander
3ecb2fc790 Enable optimized builds for steam deck. 2025-03-24 21:59:43 -04:00
Tom Alexander
44a49d7ac7 Add rpcs3 (PS3 emulator) to steam deck. 2025-03-24 21:59:43 -04:00
Tom Alexander
acfc9ac1a4 Add hydra as a distributed build machine. 2025-03-24 21:59:42 -04:00
Tom Alexander
e733dcdcbf Add a target for the hydra server. 2025-03-23 18:19:49 -04:00
Tom Alexander
3099a18424 Enable optimization on odo. 2025-03-23 18:19:49 -04:00
Tom Alexander
15c209fdd9 Add support for pcsx2. 2025-03-22 13:39:13 -04:00
Tom Alexander
ee181b535e Compiling with optimizations still failing. 2025-03-17 08:26:39 -04:00
Tom Alexander
4d0fc61e13 Upgrade to 6.13. 2025-03-14 23:17:30 -04:00
Tom Alexander
2b54630053 Add some scripts that are helpful for configuring kubernetes. 2025-03-08 17:22:32 -05:00
Tom Alexander
84bd6be8e6 Hide the libultraship splash screen for a more authentic feel. 2025-03-01 22:53:33 -05:00
Tom Alexander
dd96520ad1 Add support for authenticating to GKE with gcloud. 2025-03-01 14:49:19 -05:00
Tom Alexander
11a1d61581 Integrate some git config suggestions from https://blog.gitbutler.com/how-git-core-devs-configure-git/ . 2025-02-26 17:06:44 -05:00
Tom Alexander
bab2cfdc7b Update to emacs 30. 2025-02-24 22:09:23 -05:00
Tom Alexander
fd0c92f3eb Persist the gcloud config directory. 2025-02-23 18:44:59 -05:00
Tom Alexander
6ac33d2538 Update lockfile. 2025-02-21 19:30:58 -05:00
Tom Alexander
8d4b345414 Install ipcalc. 2025-02-19 20:43:27 -05:00
Tom Alexander
8beaf00693 Add terraform-ls to emacs. 2025-02-18 18:23:40 -05:00
Tom Alexander
181e650094 Install steam-run-free. 2025-02-18 17:58:35 -05:00
Tom Alexander
449f288214 Add gcloud. 2025-02-18 17:52:50 -05:00
Tom Alexander
f6df27d7a9 Remove config that was causing extra prompts with no noticeable impact. 2025-02-16 20:57:08 -05:00
Tom Alexander
e3a7a410c4 Merge branch 'steam_deck' into nix 2025-02-16 09:18:07 -05:00
Tom Alexander
345c62a477 Add wrappers for 2ship2harkinian and sm64ex also.
Set the steam launcher to run /home/deck/.nix-profile/bin/steam_<GAME> to have it work inside steam gaming mode.
2025-02-15 20:50:34 -05:00
Tom Alexander
e7528765a9 Add a wrapper script to launch ship of harkinian in gaming mode. 2025-02-15 20:22:29 -05:00
Tom Alexander
54860370c0 Add a desktop file for sm64ex. 2025-02-15 19:31:16 -05:00
Tom Alexander
46b21370bd Auto-clean-up steam deck nix store. 2025-02-15 12:18:59 -05:00
Tom Alexander
381e3fb591 Switch to deploying 2ship2harkinian config file and fix launching it from KDE plasma's start menu. 2025-02-15 12:15:58 -05:00
Tom Alexander
5d4ebf90b3 Fix launching ship of harkinian from KDE plasma's start menu. 2025-02-15 11:53:19 -05:00
Tom Alexander
7dcdcc906c Switch to deploying the ship of harkinian config file. 2025-02-15 11:53:19 -05:00
Tom Alexander
a4abb96de3 Switch to deploying the sm64ex config file. 2025-02-15 10:57:18 -05:00
Tom Alexander
5859a06c5d Add icon to steam rom manager. 2025-02-15 10:32:50 -05:00
Tom Alexander
02223deb64 Switch steam rom manager to using the AppImage. 2025-02-15 08:50:58 -05:00
Tom Alexander
20e247f8ed Add a role for sm64ex for the deck. 2025-02-13 21:24:31 -05:00
Tom Alexander
b0186dc85b Add a role for 2ship2harkinian (Majora's Mask PC port). 2025-02-13 20:45:49 -05:00
Tom Alexander
cac15febfa Add impermanence for ship of harkinian's files. 2025-02-13 20:10:59 -05:00
Tom Alexander
48fa3c7436 Move steam rom manager to a role. 2025-02-13 19:33:07 -05:00
Tom Alexander
7dd922c2a2 Add a blank role. 2025-02-13 19:26:52 -05:00
Tom Alexander
ab6f7dbea5 Add a role for ship of harkinian (the pc port of Ocarina of Time). 2025-02-13 19:21:53 -05:00
Tom Alexander
fea86b00b4 Install nixGL to support running graphical programs on non-nixos. 2025-02-13 17:57:33 -05:00
Tom Alexander
197b8fcced Add ssh config. 2025-02-10 18:14:18 -05:00
Tom Alexander
0bec3dbe63 Switch to home-manager. 2025-02-10 01:17:58 -05:00
Tom Alexander
53caf8bc81 Add a steam deck nix config. 2025-02-10 00:09:26 -05:00
Tom Alexander
c37d0d9b9e Add decrypt k8s secret script. 2025-02-09 20:24:13 -05:00
Tom Alexander
a663a90ada Install sops for encrypting kubernetes secrets. 2025-02-09 11:06:53 -05:00
Tom Alexander
2d976a1cf3 Install dmidecode. 2025-02-09 10:08:32 -05:00
Tom Alexander
d8e8781287 Support compiling openssl-sys with rust. 2025-02-08 20:41:37 -05:00
Tom Alexander
502e18fdec Set up vdpau. 2025-02-08 16:06:57 -05:00
Tom Alexander
24d83e95a5 Fix shift-arrowkey hotkeys in org mode. 2025-02-07 19:01:49 -05:00
Tom Alexander
3ed43b1b8a Configure rustup toolchain, cargo credentials, and put dependencies under cargo. 2025-02-02 08:30:26 -05:00
Tom Alexander
64e735abbf Add role for gnuplot. 2025-02-01 14:38:51 -05:00
Tom Alexander
ed11bf1e65 Link docker credentials. 2025-02-01 13:34:19 -05:00
Tom Alexander
c0afe006b8 Add prettier to emacs. 2025-02-01 12:27:29 -05:00
Tom Alexander
1fe305576b Add a role for tekton. 2025-02-01 11:32:25 -05:00
Tom Alexander
fc400a98db Add role for flux. 2025-02-01 11:30:52 -05:00
Tom Alexander
4a63e1c23e Move rust-analyzer to inside emacs' path. 2025-02-01 00:03:02 -05:00
Tom Alexander
379795f6e8 Disable tmpfs on neelix so it can compile the kernel. 2025-01-31 22:46:36 -05:00
Tom Alexander
edd3c6a266 Add doas-sudo-shim to support remote builds. 2025-01-31 21:29:05 -05:00
Tom Alexander
dd785692ce Add lsof and fix styling of right-click menu in waybar. 2025-01-29 19:40:44 -05:00
Tom Alexander
c6ff6a1f24 Install wavemon. 2025-01-28 21:28:34 -05:00
Tom Alexander
2f2d33296b Persist ares data. 2025-01-26 19:04:17 -05:00
Tom Alexander
2c1cf54de0 Update packages. 2025-01-26 18:55:53 -05:00
Tom Alexander
65be133ffe Update lanzaboote. 2025-01-26 16:57:18 -05:00
Tom Alexander
ee47c3cfa3 Enable debugging on ath12k. 2025-01-26 10:11:53 -05:00
Tom Alexander
ff8bb0653b Enable bluetooth on odo. 2025-01-25 21:28:14 -05:00
Tom Alexander
ff98873b32 Persist save data for ship of harkinian and 2ship2harkinian. 2025-01-25 21:22:55 -05:00
Tom Alexander
67ad4e2dff Persist sm64ex save data. 2025-01-25 20:47:48 -05:00
Tom Alexander
60452b0aeb Persist the nix-index index. 2025-01-25 20:22:41 -05:00
Tom Alexander
e043320e5c Clean up experiments in the gpg role. 2025-01-25 19:35:05 -05:00
Tom Alexander
2f8c4fbfe8 Disable verbose logging for gpg. 2025-01-25 19:10:48 -05:00
Tom Alexander
233bf4e967 Put the sleep back into wireguard. 2025-01-25 17:58:56 -05:00
Tom Alexander
f7adfaf54d Update lockfile. 2025-01-25 16:28:53 -05:00
Tom Alexander
78c9dec4c4 Disable rom name override.
The latest nixpkgs does not support overriding the name so I am removing it now for compatibility.
2025-01-25 16:22:04 -05:00
Tom Alexander
53c12a5b1e Add sshjail as an ansible plugin. 2025-01-25 15:30:30 -05:00
Tom Alexander
7d94210d8f Add cmake support to emacs. 2025-01-25 10:20:22 -05:00
Tom Alexander
1ebf31dc11 Remove sleep from wireguard service. 2025-01-25 10:20:22 -05:00
Tom Alexander
82c30bdb77 Add a role for 2ship2harkinian (Majora's Mask). 2025-01-24 21:25:41 -05:00
Tom Alexander
d5e7fdd097 Add bsdtar. 2025-01-24 20:58:03 -05:00
Tom Alexander
40fd7931d0 Add a persist folder for the talexander user. 2025-01-24 20:36:37 -05:00
Tom Alexander
835fd340a2 Add role for Ocarina of Time (shipwright). 2025-01-24 20:23:49 -05:00
Tom Alexander
94ef9ff3c8 Add role to build sm64ex. 2025-01-24 20:08:10 -05:00
Tom Alexander
62d3c010f5 Install nix-tree. 2025-01-24 19:01:51 -05:00
Tom Alexander
e9e792961c Add a not-working snippet to show where system packages are imported. 2025-01-24 18:53:57 -05:00
Tom Alexander
281dffc9c0 Do not install foot. 2025-01-24 18:42:57 -05:00
Tom Alexander
5bd67bb02a Move defaultPackages into the reset role. 2025-01-24 18:36:14 -05:00
Tom Alexander
4a76097a5e Refactor the wireguard role to use lib.mkMerge. 2025-01-24 17:59:07 -05:00
Tom Alexander
facfd01661 Make zsh install conditional. 2025-01-23 21:55:22 -05:00
Tom Alexander
2ce4520cd6 Make zrepl a conditional install. 2025-01-23 21:52:50 -05:00
Tom Alexander
814769b3e9 Do not install waybar on neelix. 2025-01-23 21:43:08 -05:00
Tom Alexander
6424129da3 Do not install wasm role on neelix. 2025-01-23 21:41:08 -05:00
Tom Alexander
415edbad91 Do not install vscode on neelix. 2025-01-23 21:39:57 -05:00
Tom Alexander
a773f94593 Do not install vnc client on neelix. 2025-01-23 21:37:16 -05:00
Tom Alexander
226610c926 Do not install steam or terraform on neelix. 2025-01-23 21:37:15 -05:00
Tom Alexander
7c6afef2bb Do not install pavucontrol on non-graphical installs. 2025-01-23 21:25:19 -05:00
Tom Alexander
55654fafb1 Do not install rust on neelix. 2025-01-23 21:21:37 -05:00
Tom Alexander
8946868fd6 Do not install qemu on neelix. 2025-01-23 21:18:57 -05:00
Tom Alexander
cd8e9002d0 Do not install python on neelix. 2025-01-23 21:15:48 -05:00
Tom Alexander
e1a274c88e Do not install media role on neelix. 2025-01-23 21:06:11 -05:00
Tom Alexander
cdc4bdffb6 Git buildEnv is failing. 2025-01-23 20:59:39 -05:00
Tom Alexander
9b9a103e49 Do not install gnome-firmware on non-graphical installs. 2025-01-23 20:46:03 -05:00
Tom Alexander
ea7bf809fc Do not install the launch keyboard configurator on neelix or non-graphical installs. 2025-01-23 20:42:22 -05:00
Tom Alexander
88a6d046b8 Do not install LaTeX on neelix. 2025-01-23 20:38:54 -05:00
Tom Alexander
d8e16f0b05 Do not install kubernetes clients on neelix. 2025-01-23 20:35:28 -05:00
Tom Alexander
e3fee206a1 Don't install kanshi on non-graphical installs. 2025-01-23 20:20:08 -05:00
Tom Alexander
3be710b4ad Install meld to git's path when doing a graphical install. 2025-01-23 20:07:23 -05:00
Tom Alexander
b37f8a8e1a Do not install my git config on neelix. 2025-01-23 19:55:13 -05:00
Tom Alexander
509cceb220 Only install fonts in graphical installs. 2025-01-23 19:48:25 -05:00
Tom Alexander
47408cfce0 Do not install firefox on neelix. 2025-01-23 19:14:25 -05:00
Tom Alexander
812dc40257 Do not install docker on neelix. 2025-01-23 19:09:59 -05:00
Tom Alexander
0e370c0d62 Do not install chromium or catt on neelix. 2025-01-23 19:04:19 -05:00
Tom Alexander
0598c796b7 Do not install ares on neelix. 2025-01-23 18:53:36 -05:00
Tom Alexander
df2efb728d Don't install alacritty on neelix or non-graphical installs. 2025-01-23 18:47:03 -05:00
Tom Alexander
62fc955b68 Merge branch 'plainmacs' into nix 2025-01-23 18:44:30 -05:00
Tom Alexander
e0644a069d Add support for non-graphical emacs. 2025-01-23 01:52:56 -05:00
Tom Alexander
054e056d00 Switch to buildEnv instead of symlinkJoin for better control over the joining process. 2025-01-23 01:52:56 -05:00
Tom Alexander
d3ea8b3667 Introduce a plainmacs emacs install flavor. 2025-01-22 21:01:34 -05:00
Tom Alexander
3f945f8ae3 Merge branch 'neelix' into nix 2025-01-22 20:29:12 -05:00
Tom Alexander
93c4aa4c76 Clean up the host-specific configs. 2025-01-22 20:28:58 -05:00
Tom Alexander
4664804d90 Comment out the kodi configs so they remain mutable until I've made a config I like. 2025-01-22 20:12:50 -05:00
Tom Alexander
edc48d00a2 Add some config files. 2025-01-21 23:07:05 -05:00
Tom Alexander
37aa0e6732 Add a bluetooth role. 2025-01-21 22:19:28 -05:00
Tom Alexander
a739728d41 Add neelix public key to sftp server. 2025-01-21 21:23:21 -05:00
Tom Alexander
48c5aebd82 Install jmespath for ansible. 2025-01-21 20:56:48 -05:00
Tom Alexander
c33a1b6c50 Set up memtest86 on neelix. 2025-01-20 22:50:44 -05:00
Tom Alexander
368c455b7f Persist ssh keys for kodi user. 2025-01-20 22:38:54 -05:00
Tom Alexander
5a5d34911c Add /etc/hosts entry for neelix. 2025-01-20 21:00:35 -05:00
Tom Alexander
d0c1bb1b65 Do not install sway on neelix. 2025-01-20 20:14:59 -05:00
Tom Alexander
9d49eb9d6a Add an empty kodi role. 2025-01-20 19:40:54 -05:00
Tom Alexander
ccbc999744 Add a global options role. 2025-01-20 19:27:49 -05:00
Tom Alexander
d537aa599b Stop the sway-session.target when exiting sway. 2025-01-20 18:43:54 -05:00
Tom Alexander
95d06dfe0e Enable memtest86 when building the ISO. 2025-01-20 18:43:54 -05:00
Tom Alexander
f2adb9328b Build zfs into the ISO image. 2025-01-20 18:43:54 -05:00
Tom Alexander
7bc6e0c470 Add a config for neelix. 2025-01-20 18:43:54 -05:00
Tom Alexander
99edb2d161 Use full emacs for e alias. 2025-01-19 23:15:33 -05:00
Tom Alexander
938f8676ff Add chromecast support. 2025-01-19 13:44:01 -05:00
Tom Alexander
d365b6aea9 Add ncdu to inspect disk usage. 2025-01-19 11:05:00 -05:00
Tom Alexander
8d911ff893 Wrap tofi without forcing a rebuild. 2025-01-19 10:53:54 -05:00
Tom Alexander
2aca77ea1a Merge branch 'emacs_refactor' into nix 2025-01-19 10:16:27 -05:00
Tom Alexander
1b342d3402 Switch from buildEnv to symlinkJoin to keep dependencies out of the system path. 2025-01-19 10:09:49 -05:00
Tom Alexander
9976e232e6 Move packages out of systemPackages and into the emacs_full package. 2025-01-18 23:11:35 -05:00
Tom Alexander
3baf18f435 Install aspell into the emacs_full environment. 2025-01-18 22:53:09 -05:00
Tom Alexander
e00331bf94 Wrap emacs settings in a mkMerge. 2025-01-18 21:26:17 -05:00
Tom Alexander
8e22d8febb Switch to a 300hz tickless kernel and enable BBR.
Aside from BBR, these settings are copied from arch linux.
2025-01-18 20:15:20 -05:00
Tom Alexander
ed0d1e41d6 Add a notification daemon. 2025-01-18 18:44:00 -05:00
Tom Alexander
2c27d580f4 Add a mode to force focus a window. 2025-01-18 18:40:08 -05:00
Tom Alexander
75ac4b91f3 Add screenshot / screen recording. 2025-01-18 18:33:46 -05:00
Tom Alexander
9abe43096b Add swaylock. 2025-01-18 18:13:30 -05:00
Tom Alexander
1535800e2f Replace wofi with tofi. 2025-01-18 17:39:51 -05:00
Tom Alexander
dcffced35a Add rofimoji. 2025-01-18 14:32:44 -05:00
Tom Alexander
1da36ab7c5 Remove unused portion of zshrc.
I will probably move to a similar import system to what I am doing with sway.
2025-01-18 13:18:06 -05:00
Tom Alexander
c694c6ae4c Make zsh-histdb use sqlite3 directly instead of depending on systemPackages. 2025-01-18 13:12:24 -05:00
Tom Alexander
f524aa168a Stick with imv instead of swayimg. 2025-01-18 12:16:11 -05:00
Tom Alexander
308206d1cc Launch a terminal at boot in the live ISO. 2025-01-18 11:55:12 -05:00
Tom Alexander
8ac235cb8c Move disabling wifi power saving to a host-specific file. 2025-01-18 11:48:53 -05:00
Tom Alexander
5170678a25 Don't garbage collect in a built ISO.
The ISO is immutable so garbage collection does not make sense.
2025-01-18 11:33:39 -05:00
Tom Alexander
19cf31b094 Move a zfs setting into the zfs role. 2025-01-18 11:14:19 -05:00
Tom Alexander
4f0024c4f9 Move some graphics bits into the graphics role. 2025-01-18 11:00:30 -05:00
Tom Alexander
41138ab34a Update to the new secureboot location. 2025-01-18 10:54:34 -05:00
Tom Alexander
f9b18809f9 An update fixed firefox's launch time. 2025-01-17 22:42:57 -05:00
Tom Alexander
fefe46b512 Remove kvm-amd from boot.kernelModules. 2025-01-17 21:36:34 -05:00
Tom Alexander
b4947bcff6 Add vnc client. 2025-01-17 20:30:16 -05:00
Tom Alexander
14baaddcff Persist factorio data. 2025-01-17 19:07:54 -05:00
Tom Alexander
1c8f2f1c74 Switch back to regular linux. 2025-01-17 18:55:59 -05:00
Tom Alexander
1bfe24f457 Remove duplicate entry for xdg-desktop-portal-wlr. 2025-01-16 20:51:17 -05:00
Tom Alexander
08feb8bad6 Add more tracing commands. 2025-01-15 21:12:28 -05:00
Tom Alexander
cb3b01a74c Blacklist hardward watchdog for AMD 700 chipset series for power savings. 2025-01-15 21:01:30 -05:00
Tom Alexander
0e95edd8e7 Switch to unstable. 2025-01-15 21:00:57 -05:00
Tom Alexander
d172b1dea2 Add some wasm utilities. 2025-01-14 23:57:24 -05:00
Tom Alexander
2a97a1ee92 Add vscode role. 2025-01-14 23:57:24 -05:00
Tom Alexander
ba4085df1a Add terraform. 2025-01-14 23:17:26 -05:00
Tom Alexander
7c542364a2 Add firmware updating through fwupd via the Linux Vendor firmware Service (LVFS). 2025-01-14 22:42:52 -05:00
Tom Alexander
0299ebcb43 Add nvme role. 2025-01-14 21:51:53 -05:00
Tom Alexander
c23245b97c Add TODO. 2025-01-14 21:40:38 -05:00
Tom Alexander
491412c33c Add seatd. 2025-01-14 21:10:03 -05:00
Tom Alexander
5a5839482d Add support for the system76 launch keyboard configurator. 2025-01-14 20:16:06 -05:00
Tom Alexander
63408f5664 Set up latex. 2025-01-14 18:04:04 -05:00
Tom Alexander
d338b77d23 Install sshfs. 2025-01-14 17:56:29 -05:00
Tom Alexander
ce9140aa73 Add role for zrepl. 2025-01-13 17:59:03 -05:00
Tom Alexander
dbf3f2e983 Disable the fallback DNS servers. 2025-01-13 17:43:38 -05:00
Tom Alexander
0ca26e73fb Add more firefox extensions. 2025-01-12 22:43:23 -05:00
Tom Alexander
0fb53a4294 Add preparations for the new location for secureboot keys. 2025-01-12 21:17:47 -05:00
Tom Alexander
4019e6d132 Fix buildkit access to SSH agent. 2025-01-12 21:17:47 -05:00
Tom Alexander
8b1e76d9d7 Add a script to resume a zfs send/recv. 2025-01-12 19:55:15 -05:00
Tom Alexander
477637ae62 Add a script to test fetching PGP keys from a Web Key Directory (WKD). 2025-01-12 18:29:48 -05:00
Tom Alexander
5146a114eb Introduce a variable for sway includes and disable relatime on the zfs legacy mounts. 2025-01-12 15:39:46 -05:00
Tom Alexander
a817464b38 Preserve steam directories. 2025-01-11 22:36:09 -05:00
Tom Alexander
1acf889c68 Instll steam and the zfs_clone_send / zfs_clone_recv scripts. 2025-01-11 13:48:46 -05:00
Tom Alexander
af07d43c18 Add asian fonts. 2025-01-11 12:50:13 -05:00
Tom Alexander
33f13d898d Switch to ares instead of bsnes. 2025-01-11 12:09:02 -05:00
Tom Alexander
47d9e203f3 Add media role. 2025-01-10 22:54:32 -05:00
Tom Alexander
1a2ff987fe Add fw-ectool to framework laptop. 2025-01-09 23:31:27 -05:00
Tom Alexander
16480b3749 Switch to ladspa. 2025-01-09 21:32:37 -05:00
Tom Alexander
0d3901788d Installing ccid and libusb-compat does not fix it. 2025-01-09 19:04:44 -05:00
Tom Alexander
a3cb2c8632 Add kanshi. 2025-01-09 18:14:45 -05:00
Tom Alexander
6b9660bc44 Switch to mono noise suppression for voice and disable vulkan for chromium. 2025-01-09 17:56:46 -05:00
Tom Alexander
5c41b7efa2 Update software. 2025-01-08 21:43:39 -05:00
Tom Alexander
ead5db241e Install packages needed to run amd_s2idle. 2025-01-07 23:02:22 -05:00
Tom Alexander
8b074617e8 Use Adwaita cursor theme. 2025-01-06 19:34:28 -05:00
Tom Alexander
13970b53ad Only decrypt the nix zfs dataset. 2025-01-06 19:21:20 -05:00
Tom Alexander
13d7319a0f Add nix-index. 2025-01-06 14:32:07 -05:00
Tom Alexander
bd9a85efd3 Add klog alias. 2025-01-05 15:43:23 -05:00
Tom Alexander
4a4c54def4 Disable DNS settings for hotel. 2025-01-02 22:50:55 -05:00
Tom Alexander
18d372c8ee Revert "Switching to a home-manager config did not fix it."
This reverts commit 4599b38ebf.
2025-01-02 10:27:25 -05:00
Tom Alexander
4599b38ebf Switching to a home-manager config did not fix it. 2025-01-02 10:27:21 -05:00
Tom Alexander
04a95a2543 More failed attempts to get gpg working. 2025-01-02 09:43:00 -05:00
Tom Alexander
7c5f14ee61 Persist kubernetes client config. 2025-01-02 09:03:19 -05:00
Tom Alexander
d49f12f58f Enable panel replay. 2025-01-01 19:59:02 -05:00
Tom Alexander
936d3bc34d Add rust. 2025-01-01 19:16:08 -05:00
Tom Alexander
1b34841921 Comment out specific version of gpg. 2025-01-01 18:43:29 -05:00
Tom Alexander
611904761e Add kubernetes client. 2025-01-01 18:43:29 -05:00
Tom Alexander
f843b7924f Add docker. 2025-01-01 18:29:27 -05:00
Tom Alexander
7bb7b89b82 Try a specific version of gpg. 2025-01-01 13:35:29 -05:00
Tom Alexander
c1103775b6 Keep 30 days of /nix. 2025-01-01 13:31:45 -05:00
Tom Alexander
24d89ed704 Default to power-saving mode. 2024-12-31 12:51:23 -05:00
Tom Alexander
e8dff5ece1 Set up wireguard networks using functions. 2024-12-31 11:04:24 -05:00
Tom Alexander
e22b5c1c6c Add power management kernel parameters. 2024-12-31 10:27:15 -05:00
Tom Alexander
d9bc4f15d8 Add powertop. 2024-12-31 07:44:02 -05:00
Tom Alexander
77ae96ca7a Set up python. 2024-12-31 07:37:48 -05:00
Tom Alexander
d2f908005c Persist the .ssh known_hosts. 2024-12-31 07:00:41 -05:00
Tom Alexander
5e74a874ba Persist sound settings (for example, muted status) and do not enable wireguard in built ISO. 2024-12-29 15:45:52 -05:00
Tom Alexander
fe820e5843 Move remaining nix configs into folders. 2024-12-29 15:27:03 -05:00
Tom Alexander
81315e4c7b Add a snes emulator. 2024-12-29 15:12:31 -05:00
Tom Alexander
ce8718b042 Add wgh wireguard network. 2024-12-28 21:05:45 -05:00
Tom Alexander
720164497d More attempts to fix gpg decrypt with yubikey. 2024-12-27 20:53:43 -05:00
Tom Alexander
0b31b91c69 Set up wireguard. 2024-12-27 15:44:00 -05:00
Tom Alexander
2ef181cfab Attempt to fix gpg decrypt with yubikey. Did not succeed. 2024-12-27 13:09:13 -05:00
Tom Alexander
5a3450fdf8 Add gvfs and git-crypt. 2024-12-26 21:28:31 -05:00
Tom Alexander
aae534308a Add noise supression to microphone. 2024-12-25 09:17:30 -05:00
Tom Alexander
cbd8f70ce4 Merge branch 'zsh' into nix 2024-12-25 09:17:23 -05:00
Tom Alexander
64d495afa5 Use zsh-histdb package. 2024-12-23 17:28:31 -05:00
Tom Alexander
5e424b35e4 Make a zsh-histdb package. 2024-12-23 15:41:45 -05:00
Tom Alexander
7decd40844 Switch to zsh. 2024-12-23 11:14:18 -05:00
Tom Alexander
9c0f3ce601 Use dark themes. 2024-12-23 10:56:57 -05:00
Tom Alexander
e09eea2049 Switch to zen kernel optimized for znver4. 2024-12-23 10:00:01 -05:00
Tom Alexander
5d23126205 Enable secure boot. 2024-12-22 22:03:03 -05:00
Tom Alexander
748e6dee68 Set firefox as default browser. 2024-12-22 16:14:12 -05:00
Tom Alexander
27aa2f077b Set up chromium with support for wayland and widevine. 2024-12-22 00:48:57 -05:00
Tom Alexander
69098488f6 Switch to a raw file for fontconfig. 2024-12-21 17:15:54 -05:00
Tom Alexander
14e6e78aee Add the waybar scripts. 2024-12-21 16:25:40 -05:00
Tom Alexander
a0f9f4baa4 Set up waybar and building ISOs. 2024-12-21 15:46:05 -05:00
Tom Alexander
a7f3754d25 Add more sway config files. 2024-12-20 23:03:51 -05:00
Tom Alexander
54c8459fa1 Switch to vulkan renderer for sway. 2024-12-20 22:45:09 -05:00
Tom Alexander
e26118af4f Reformat all nix files. 2024-12-20 22:37:44 -05:00
Tom Alexander
764a8c58ce Add alias for emacs. 2024-12-20 22:36:32 -05:00
Tom Alexander
8f89f1c6c1 Add alacritty config. 2024-12-20 21:59:20 -05:00
Tom Alexander
862829c57c Preserve firefox cache. 2024-12-20 21:38:19 -05:00
Tom Alexander
aba96213c3 Enable the nixd language server in emacs. 2024-12-20 21:19:22 -05:00
Tom Alexander
e7ab762ee4 Fix firefox launch time. 2024-12-20 21:06:04 -05:00
Tom Alexander
b314982196 Set up firefox. 2024-12-20 18:30:35 -05:00
Tom Alexander
27060fed8d Preserve gpg directory. 2024-12-20 16:50:27 -05:00
Tom Alexander
20c1c46d12 Set up fonts. 2024-12-20 16:07:12 -05:00
Tom Alexander
3b133ed86c Do not launch alacritty at the start. 2024-12-20 15:34:02 -05:00
Tom Alexander
0aad0c39f4 Enable wayland support for emacs.
This unfortunately means pinning to a specific version (or using 3rd party emacs-overlay).
2024-12-20 15:30:51 -05:00
Tom Alexander
fe1033fa4b Switch to uid/gid 11235. 2024-12-20 15:22:46 -05:00
Tom Alexander
2ce635d028 Fix emacs config. 2024-12-20 15:03:33 -05:00
Tom Alexander
ba3a6e74eb Add git config and initial emacs config. 2024-12-20 13:17:13 -05:00
Tom Alexander
7e768022e7 Add hotkeys and window management to sway. 2024-12-19 23:08:19 -05:00
Tom Alexander
a76bd4ebd3 Fix wifi config 2024-12-19 22:20:55 -05:00
Tom Alexander
df89d1b973 Enable redistributable firmware. 2024-12-19 19:52:27 -05:00
Tom Alexander
50811aad77 Set up building an ISO from the config. 2024-12-19 19:36:10 -05:00
Tom Alexander
df3528d62a Enable graphics acceleration. 2024-12-19 18:59:38 -05:00
Tom Alexander
e97c570bb2 Trust wheel. 2024-12-19 18:09:48 -05:00
Tom Alexander
fbcb0826d2 Extremely minimal sway setup. 2024-12-19 17:33:21 -05:00
Tom Alexander
74499fb6a0 Switch to a different way of building the VM. 2024-12-19 16:28:40 -05:00
Tom Alexander
fbbff409a0 Add a build for a qemu virtual machine. 2024-12-19 16:14:47 -05:00
Tom Alexander
05da118d8f Start module for sway. 2024-12-19 15:13:56 -05:00
Tom Alexander
033d695fd9 Only set bootloader when in VM. 2024-12-19 15:06:57 -05:00
Tom Alexander
6953cdb81f Set up a minimal initial config. 2024-12-17 16:46:44 -05:00
Tom Alexander
48f700b803 Add script for managing nix testing vm. 2024-12-17 16:46:43 -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
410 changed files with 45542 additions and 257 deletions

View File

@@ -4,6 +4,7 @@ pkgbase_url: "https://freebsdpkg.fizz.buzz/pkgbase/14broadwell-repo/FreeBSD:14:a
zfs_snapshot_datasets: zfs_snapshot_datasets:
- path: zroot/freebsd/computer/be - path: zroot/freebsd/computer/be
- path: zmass/encrypted/vm - path: zmass/encrypted/vm
- path: zmass/encrypted/data
users: users:
talexander: talexander:
initialize: true initialize: true
@@ -24,6 +25,8 @@ users:
gitconfig: "gitconfig_home" gitconfig: "gitconfig_home"
sshd_enabled: true sshd_enabled: true
sshd_conf: "sshd_config" sshd_conf: "sshd_config"
prefer_ipv6: true
dummynet_config: "dnctl.conf"
pf_config: "homeserver_pf.conf" pf_config: "homeserver_pf.conf"
pflog_conf: pflog_conf:
- name: 0 - name: 0
@@ -64,6 +67,9 @@ jail_list:
- name: certificate - name: certificate
conf: conf:
src: certificate src: certificate
- name: momlaptop
conf:
src: momlaptop
# - name: mumble # - name: mumble
# conf: # conf:
# src: mumble # src: mumble
@@ -71,9 +77,17 @@ jail_list:
# - name: mumbledb # - name: mumbledb
# mount: /var/db/murmur # 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:
- wgh - wgh
linfi:
enabled: true
zfs_dataset: zmass/unencrypted/vm/linfi
zfs_mountpoint: /vm/linfi
driver_blocklist: "ath if_ath if_ath_pci ath_hal if_iwm if_iwlwifi"
pci_blocklist: "6/0/0"
amd: false

View File

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

View File

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

View File

@@ -8,3 +8,4 @@ public_dns ansible_ssh_host=public_dns@10.217.2.1 ansible_connection=sshjail
sftp ansible_ssh_host=sftp@homeserver ansible_connection=sshjail sftp ansible_ssh_host=sftp@homeserver ansible_connection=sshjail
bastion ansible_ssh_host=bastion@homeserver ansible_connection=sshjail bastion ansible_ssh_host=bastion@homeserver ansible_connection=sshjail
certificate ansible_ssh_host=certificate@homeserver ansible_connection=sshjail certificate ansible_ssh_host=certificate@homeserver ansible_connection=sshjail
momlaptop ansible_ssh_host=momlaptop@homeserver ansible_connection=sshjail

View File

@@ -5,10 +5,12 @@ zfs_snapshot_datasets:
- path: zroot/freebsd/current/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"
@@ -40,13 +42,14 @@ users:
devfs_rules: "odo_devfs.rules" devfs_rules: "odo_devfs.rules"
jail_zfs_dataset: zroot/freebsd/current/jails jail_zfs_dataset: zroot/freebsd/current/jails
jail_zfs_dataset_mountpoint: /jail 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/current/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 efi_dev: /dev/diskid/DISK-SJB7N717610407Q0Hp1
sway_conf_files: sway_conf_files:
@@ -56,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

@@ -1,4 +1,5 @@
os_flavor: "freebsd" os_flavor: "freebsd"
sshd_enabled: true
custom_repo: "file:///usr/local/poudriere/data/packages/currentznver4-default-framework" 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" pkgbase_url: "file:///usr/local/poudriere/data/images/currentznver4-repo/FreeBSD:15:amd64/latest"
poudriere_builds: poudriere_builds:

View File

@@ -27,6 +27,7 @@
- sway - sway
- emacs - emacs
- firefox - firefox
- chromium
- devfs - devfs
- ssh_client - ssh_client
- sshfs - sshfs
@@ -67,9 +68,12 @@
ansible_become: True ansible_become: True
roles: roles:
- sudo # for poudboot script - sudo # for poudboot script
- doas
- fstab - fstab
- package_manager - package_manager
- zsh
- termcap - termcap
- sshd
- portshaker - portshaker
- poudriere - poudriere
- poudrierenginx - poudrierenginx
@@ -122,12 +126,14 @@
vars: vars:
ansible_become: True ansible_become: True
roles: roles:
- linfi
- framework_laptop - framework_laptop
- hosts: homeserver - hosts: homeserver
vars: vars:
ansible_become: True ansible_become: True
roles: roles:
- linfi
- homeserver - homeserver
- hosts: odowork - hosts: odowork
@@ -154,3 +160,9 @@
ansible_become: True ansible_become: True
roles: roles:
- jail_certificate - jail_certificate
- hosts: momlaptop
vars:
ansible_become: True
roles:
- jail_momlaptop

View File

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

View File

@@ -8,6 +8,7 @@
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 amend = commit --amend --no-edit
authorcount = shortlog --summary --numbered --all --no-merges
[core] [core]
excludesfile = ~/.gitignore_global excludesfile = ~/.gitignore_global
[commit] [commit]

View File

@@ -8,6 +8,7 @@
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 amend = commit --amend --no-edit
authorcount = shortlog --summary --numbered --all --no-merges
[core] [core]
excludesfile = ~/.gitignore_global excludesfile = ~/.gitignore_global
[commit] [commit]

View File

@@ -44,6 +44,7 @@ default:\
:pseudoterminals=unlimited:\ :pseudoterminals=unlimited:\
:kqueues=unlimited:\ :kqueues=unlimited:\
:umtxp=unlimited:\ :umtxp=unlimited:\
:pipebuf=unlimited:\
:priority=0:\ :priority=0:\
:ignoretime@:\ :ignoretime@:\
:umask=022:\ :umask=022:\

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

@@ -19,6 +19,7 @@
- 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: Install packages - name: Install packages

View File

@@ -13,6 +13,7 @@
- gsed - gsed
- gmake - gmake
- rust-coreutils - rust-coreutils
- shuf
state: present state: present
- name: Install service configuration - name: Install service configuration
@@ -38,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}}"
@@ -119,3 +108,65 @@
group: wheel group: wheel
loop: loop:
- 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="7"
# 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

@@ -67,3 +67,13 @@
- name: vm.dirty_writeback_centisecs - name: vm.dirty_writeback_centisecs
value: 1500 value: 1500
file: power.conf 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,6 +30,8 @@ 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
@@ -45,7 +47,7 @@ function cleanup {
done done
} }
vms=() vms=()
for sig in EXIT INT QUIT HUP TERM; do for sig in EXIT; do
trap "set +e; sleep 10; cleanup" "$sig" trap "set +e; sleep 10; cleanup" "$sig"
done done
@@ -105,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=()
@@ -140,7 +143,7 @@ function start_vm {
additional_args+=("-s" "5,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") vms+=("$name")
while true; do while true; do
@@ -151,6 +154,8 @@ function start_vm {
-c $CPU_CORES \ -c $CPU_CORES \
-m $MEMORY \ -m $MEMORY \
-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 \
@@ -245,7 +250,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,2 @@
--ozone-platform-hint=auto
--enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE

View File

@@ -0,0 +1,2 @@
dependencies:
- 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,29 @@
- include_role:
name: per_user
# - name: Create directories
# file:
# name: "{{ account_homedir.stdout }}/{{ item }}"
# state: directory
# mode: 0700
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"
# loop:
# - ".config/foo"
# - 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: foo.conf
# dest: .config/foo/foo.conf
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"'

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

@@ -17,3 +17,9 @@ add include $devfsrules_hide_all
add include $devfsrules_unhide_basic add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login add include $devfsrules_unhide_login
add path 'bpf*' unhide 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,2 @@
pipe 1 config bw 100KByte/s
pipe 2 config

View File

@@ -0,0 +1,28 @@
#!/bin/sh
#
#
# PROVIDE: dummynet
# BEFORE: pf ipfw
# KEYWORD: nojailvnet
. /etc/rc.subr
name="dummynet"
desc="Dummynet packet queuing and scheduling"
rcvar="${name}_enable"
load_rc_config $name
start_cmd="${name}_start"
required_files="$dummynet_rules"
required_modules="dummynet"
dummynet_start()
{
startmsg -n "Enabling ${name}"
cat "$dnctl_rules" | while read l; do
dnctl $l
done
startmsg '.'
}
run_rc_command $*

View File

@@ -0,0 +1,2 @@
dummynet_enable="YES"
dummynet_rules="/etc/dnctl.conf"

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,30 @@
- name: Install Configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0600
owner: root
group: wheel
loop:
- src: "{{ dummynet_config }}"
dest: /etc/dnctl.conf
- 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: dummynet
- name: Install service configuration
copy:
src: "files/{{ item }}_rc.conf"
dest: "/etc/rc.conf.d/{{ item }}"
mode: 0644
owner: root
group: wheel
loop:
- dummynet

View File

@@ -0,0 +1,29 @@
# - name: Build aur packages
# register: buildaur
# become_user: "{{ build_user.name }}"
# command: "aurutils-sync --no-view {{ item }}"
# args:
# creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
# loop:
# - foo
# - name: Update cache
# when: buildaur.changed
# pacman:
# name: []
# state: present
# update_cache: true
# - name: Install packages
# package:
# name:
# - foo
# state: present
# - name: Enable services
# systemd:
# enabled: yes
# name: "{{ item }}"
# daemon_reload: yes
# loop:
# - foo.service

View File

@@ -0,0 +1,2 @@
- import_tasks: tasks/common.yaml
when: (dummynet_config is defined and os_flavor == "freebsd") or (os_flavor == "linux")

View File

@@ -0,0 +1,29 @@
- include_role:
name: per_user
# - name: Create directories
# file:
# name: "{{ account_homedir.stdout }}/{{ item }}"
# state: directory
# mode: 0700
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"
# loop:
# - ".config/foo"
# - 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: foo.conf
# dest: .config/foo/foo.conf
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"'

View File

@@ -1,7 +1,7 @@
(setq gc-cons-threshold (* 128 1024 1024)) ;; Increase garbage collection threshold for performance (default 800000) (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 ;; Increase amount of data read from processes, default 4k
(when (version<= "27.0" emacs-version) (when (version<= "27.0" emacs-version)
(setq read-process-output-max (* 1024 1024)) ;; 1mb (setq read-process-output-max (* 10 1024 1024)) ;; 10MiB
) )
;; Suppress warnings ;; Suppress warnings

View File

@@ -0,0 +1,22 @@
(require 'common-lsp)
(require 'util-tree-sitter)
(use-package nix-mode
:mode (("\\.nix\\'" . nix-mode)
)
:commands nix-mode
:hook (
(nix-mode . (lambda ()
;; (eglot-ensure)
;; (defclass my/eglot-nix (eglot-lsp-server) ()
;; :documentation
;; "Own eglot server class.")
;; (add-to-list 'eglot-server-programs
;; '(nix-mode . (my/eglot-nix "nixd")))
;; (add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
))
)
)
(provide 'lang-nix)

View File

@@ -4,6 +4,8 @@
:bind ( :bind (
("C-c l" . org-store-link) ("C-c l" . org-store-link)
("C-c a" . org-agenda) ("C-c a" . org-agenda)
("C--" . org-timestamp-down)
("C-=" . org-timestamp-up)
) )
:hook ( :hook (
(org-mode . (lambda () (org-mode . (lambda ()

View File

@@ -36,4 +36,6 @@
(require 'lang-xml) (require 'lang-xml)
(require 'lang-nix)
(load-directory autoload-directory) (load-directory autoload-directory)

View File

@@ -15,7 +15,8 @@ INIT_SCRIPT=$(cat <<EOF
;; Set default font ;; Set default font
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono") (set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
;; Set fallback font for unicode glyphs ;; Set fallback font for unicode glyphs
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji")) (when (display-graphic-p)
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji")))
(menu-bar-mode -1) (menu-bar-mode -1)
(when (fboundp 'tool-bar-mode) (when (fboundp 'tool-bar-mode)
(tool-bar-mode -1)) (tool-bar-mode -1))

View File

@@ -11,7 +11,8 @@
;; Set default font ;; Set default font
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono") (set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
;; Set fallback font for unicode glyphs ;; Set fallback font for unicode glyphs
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji")) (when (display-graphic-p)
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji")))
(menu-bar-mode -1) (menu-bar-mode -1)
(when (fboundp 'tool-bar-mode) (when (fboundp 'tool-bar-mode)
(tool-bar-mode -1)) (tool-bar-mode -1))

View File

@@ -7,3 +7,5 @@ dependencies:
when: 'emacs_flavor == "full"' when: 'emacs_flavor == "full"'
- role: terraform - role: terraform
when: 'emacs_flavor == "full"' when: 'emacs_flavor == "full"'
- role: nix
when: 'emacs_flavor == "full"'

View File

@@ -13,3 +13,33 @@ firefox_config:
browser.newtabpage.activity-stream.feeds.section.topstories: false browser.newtabpage.activity-stream.feeds.section.topstories: false
browser.newtabpage.pinned: "[]" browser.newtabpage.pinned: "[]"
browser.newtabpage.activity-stream.section.highlights.includePocket: false browser.newtabpage.activity-stream.section.highlights.includePocket: false
# Disable cache when devtools are open.
devtools.cache.disabled: true
# Do not track header.
privacy.donottrackheader.enabled: true
# Tell websites not to share or sell my data.
privacy.globalprivacycontrol.enabled: true
# Disable "studies" (slice testing)
app.shield.optoutstudies.enabled: false
# Disable attribution which is used by advertisers to track you.
dom.private-attribution.submission.enabled: false
# Disable battery status, used to track users.
dom.battery.enabled: false
# Disable that websites can get notifications if you copy, paste, or cut something from a web page, and it lets them know which part of the page had been selected.
#
# This breaks copying from BigQuery https://github.com/microsoft/monaco-editor/issues/1540
# dom.event.clipboardevents.enabled: false
# Isolates all browser identifier sources (e.g. cookies) to the first party domain, with the goal of preventing tracking across different domains.
privacy.firstparty.isolate: true
# Do not preload URLs that auto-complete in the address bar.
browser.urlbar.speculativeConnect.enabled: false
# Do not resist fingerprinting because that tells websites to use light mode.
# https://bugzilla.mozilla.org/show_bug.cgi?id=1732114
privacy.resistFingerprinting: null # (default false)
# Instead, enable fingerprinting protection, which allows configuring an override.
privacy.fingerprintingProtection: true
# Allow sending dark mode preference to websites.
# Allow sending timezone to websites.
privacy.fingerprintingProtection.overrides: "+AllTargets,-CSSPrefersColorScheme,-JSDateTimeUTC,-CanvasExtractionBeforeUserInputIsBlocked"
# Disable weather on new tab page
browser.newtabpage.activity-stream.showWeather: false

View File

@@ -10,12 +10,21 @@
register: firefox_about_config register: firefox_about_config
- name: Configure Firefox about:config - name: Configure Firefox about:config
when: item[1].value != None
lineinfile: lineinfile:
path: "{{ item[0].path }}" path: "{{ item[0].path }}"
regexp: '"{{ item[1].key }}", [^")\n]*\)' regexp: '"{{ item[1].key }}", [^")\n]*\)'
line: 'user_pref("{{ item[1].key }}", {{ item[1].value | to_json }});' line: 'user_pref("{{ item[1].key }}", {{ item[1].value | to_json }});'
loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}" loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}"
- name: Configure Firefox about:config
when: item[1].value == None
lineinfile:
path: "{{ item[0].path }}"
regexp: '"{{ item[1].key }}", [^")\n]*\)'
state: absent
loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}"
- import_tasks: tasks/peruser_freebsd.yaml - import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"' when: 'os_flavor == "freebsd"'

View File

@@ -1,9 +1,10 @@
ext_if = "{ igb0 igb1 ix0 ix1 wlan0 }" ext_if = "{ igb0 igb1 ix0 ix1 linfi_host }"
not_ext_if = "{ !igb0 !igb1 !ix0 !ix1 !wlan0 }" not_ext_if = "{ !igb0 !igb1 !ix0 !ix1 !linfi_host }"
jail_nat_v4 = "{ 10.215.1.0/24 }" jail_nat_v4 = "{ 10.215.1.0/24 }"
not_jail_nat_v4 = "{ any, !10.215.1.0/24 }" not_jail_nat_v4 = "{ any, !10.215.1.0/24 }"
restricted_nat_v4 = "{ 10.215.2.0/24 }" restricted_nat_v4 = "{ 10.215.2.0/24 }"
not_restricted_nat_v4 = "{ any, !10.215.2.0/24 }" not_restricted_nat_v4 = "{ any, !10.215.2.0/24 }"
rfc1918 = "{ 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 }"
dhcp = "{ bootpc, bootps }" dhcp = "{ bootpc, bootps }"
allow = "{ wgh wgf }" allow = "{ wgh wgf }"
@@ -18,39 +19,50 @@ unifi_ports = "{ 8443 3478 10001 8080 1900 8843 8880 6789 5514 }"
set skip on lo set skip on lo
# queueing # queueing
# altq on wlan0 cbq queue { def, stuff } # altq on linfi_host cbq queue { def, stuff }
# queue def cbq(default borrow) # queue def cbq(default borrow)
# queue stuff bandwidth 8Mb cbq { dagger } # queue stuff bandwidth 8Mb cbq { dagger }
# queue dagger cbq(borrow) # queue dagger cbq(borrow)
# redirections # redirections
nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (wlan0) nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (linfi_host)
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 172.16.0.1 port 53 rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 172.16.0.1 port 53
# cloak # cloak
nat pass on $ext_if inet from 10.215.2.0/24 to !10.215.2.0/24 -> (wlan0) nat pass on $ext_if inet from 10.215.2.0/24 to !10.215.2.0/24 -> (linfi_host)
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.2.1 port 53 -> 172.16.0.1 port 53 rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.2.1 port 53 -> 172.16.0.1 port 53
# bastion # bastion
rdr pass on $ext_if inet proto tcp from { any, !10.215.1.0/24, !10.215.2.0/24 } to any port 8081 -> 10.215.1.217 port 443 rdr pass on $ext_if inet proto {tcp, udp} from { any, !10.215.1.0/24, !10.215.2.0/24 } to any port 8081 -> 10.215.1.217 port 443
nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.217 port 443 -> 10.215.1.1 nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.217 port 443 -> 10.215.1.1
nat pass on restricted_nat proto {tcp, udp} from 10.215.1.217/32 to 10.215.2.2 port 8081 -> 10.215.2.1 nat pass on restricted_nat proto {tcp, udp} from 10.215.1.217/32 to 10.215.2.2 port 8081 -> 10.215.2.1
# cloak -> olddagger # cloak -> olddagger
rdr pass on $ext_if inet proto tcp from $not_restricted_nat_v4 to any port 8082 -> 10.215.2.2 port 8082 rdr pass on $ext_if inet proto {tcp, udp} from $not_restricted_nat_v4 to any port 8082 -> 10.215.2.2 port 8082
nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8082 -> 10.215.2.1 nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8082 -> 10.215.2.1
# cloak -> dagger old
rdr pass on $ext_if inet proto {tcp, udp} from $not_restricted_nat_v4 to any port 8083 -> 10.215.2.2 port 8083
nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8083 -> 10.215.2.1
# -> sftp # -> sftp
# TODO: Limit bandwidth for sftp # TODO: Limit bandwidth for sftp
rdr pass on $ext_if inet proto tcp from $not_jail_nat_v4 to any port 8022 -> 10.215.1.216 port 22 rdr pass on $ext_if inet proto {tcp, udp} from $not_jail_nat_v4 to any port 8022 -> 10.215.1.216 port 22
nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.216 port 22 -> 10.215.1.1 nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.216 port 22 -> 10.215.1.1
# Forward ports for unifi controller # Forward ports for unifi controller
# rdr pass on $ext_if inet proto tcp from any to any port 65022 -> 10.213.177.8 port 22 # rdr pass on $ext_if inet proto {tcp, udp} from any to any port 65022 -> 10.213.177.8 port 22
rdr pass on $ext_if inet proto {udp, tcp} from any to any port $unifi_ports -> 10.215.1.202 rdr pass on $ext_if inet proto {udp, tcp} from any to any port $unifi_ports -> 10.215.1.202
# -> momlaptop
rdr pass on $ext_if inet proto {tcp, udp} from $not_jail_nat_v4 to any port 8033 -> 10.215.1.218 port 443
nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.218 port 443 -> 10.215.1.1
# filtering # filtering
# match in on jail_nat from any to any dnpipe(1, 2)
# match in on restricted_nat from any to any dnpipe(1, 2)
block log all block log all
pass out on $ext_if pass out on $ext_if

View File

@@ -33,7 +33,7 @@ scrub in on $ext_if all fragment reassemble
# redirections # redirections
nat on $ext_if inet from ! ($ext_if) to ! ($ext_if) -> ($ext_if) nat on $ext_if inet from ! ($ext_if) to ! ($ext_if) -> ($ext_if)
rdr pass proto {tcp, udp} from any to 10.215.1.1 port 53 tag REDIREXTERNAL -> 1.1.1.1 port 53 rdr pass on jail_nat proto {tcp, udp} from any to 10.215.1.1 port 53 tag REDIREXTERNAL -> 1.1.1.1 port 53
rdr pass on $ext_if proto {tcp, udp} to ($ext_if) port 6443 -> 10.215.1.204 port 6443 rdr pass on $ext_if proto {tcp, udp} to ($ext_if) port 6443 -> 10.215.1.204 port 6443
rdr pass on jail_nat proto {tcp, udp} to ($ext_if) port 6443 tag REDIRINTERNAL -> 10.215.1.204 port 6443 rdr pass on jail_nat proto {tcp, udp} to ($ext_if) port 6443 tag REDIRINTERNAL -> 10.215.1.204 port 6443
@@ -63,6 +63,7 @@ pass quick on $allow
# Single interface kubernetes cluster is working with the following run on mrmanager: # Single interface kubernetes cluster is working with the following run on mrmanager:
# doas route add -host 74.80.180.139 -interface jail_nat # doas route add -host 74.80.180.139 -interface jail_nat
# doas route add -net 10.129.0.0/16 -interface jail_nat
# doas sysctl net.link.ether.inet.proxyall=1 # doas sysctl net.link.ether.inet.proxyall=1
# Plus this in pf.conf: # Plus this in pf.conf:
# pass quick from any to 74.80.180.139 # pass quick from any to 74.80.180.139

View File

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

View File

@@ -0,0 +1,2 @@
dependencies:
- dummynet

View File

@@ -0,0 +1,3 @@
# Disable power save for wifi card because power save caused video stuttering in google meet on Linux. Both of these are currently the default on FreeBSD but I'm saving it just in case that default changes.
compat.linuxkpi.iwlwifi_power_save="0"
compat.linuxkpi.iwlwifi_mvm_power_scheme="1"

View File

@@ -1,5 +1,13 @@
options iwlwifi power_save=1 # Manually disable power save:
# iw wlan0 set power_save off
options iwlwifi uapsd_disable=0 ## High power:
options iwlwifi power_save=0
# options iwlwifi uapsd_disable=1
options iwlmvm power_scheme=1 # 1-active, 2-balanced, 3-low power, default: 2 (int)
options iwlmvm power_scheme=3 ## Low power:
# options iwlwifi power_save=1
# ? power_level:default power save level (range from 1 - 5, default: 1) (int)
# options iwlwifi uapsd_disable=0
# options iwlmvm power_scheme=3

View File

@@ -0,0 +1,285 @@
#!/usr/local/bin/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 sharename /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 bhyve_netgraph_bridge create-disk zdata/vm/poudriere /vm/poudriere 10
# doas bhyve_netgraph_bridge start poudriere zdata/vm/poudriere /vm/poudriere /vm/iso/FreeBSD-13.2-RELEASE-amd64-bootonly.iso
# doas bhyve_netgraph_bridge start poudriere zdata/vm/poudriere /vm/poudriere
: ${VERBOSE:="NO"} # or YES
: ${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"}
if [ "$VERBOSE" = "YES" ]; then
set -x
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 {
local cmd="$1"
shift 1
if [ "$cmd" = "create-disk" ]; then
create_disk "${@}"
elif [ "$cmd" = "start" ]; then
start_vm "${@}"
else
die 1 "Unrecognized command $cmd"
fi
}
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 -o volblocksize=64K "$zfs_path/disk0"
}
function start_vm {
local name="$1"
local zfs_path="$2"
local mount_path="$3"
local mount_cd="${4:-}"
if [ -e "${mount_path}/settings" ]; then
source "${mount_path}/settings"
fi
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")
local additional_args=()
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,e1000,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}")
elif [ "$NETWORK" = "NONE" ]; then
(>&2 echo "Not using any network.")
else
die 1 "Unrecognized NETWORK type $NETWORK"
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" "29,fbuf,tcp=$VNC_LISTEN,w=$VNC_WIDTH,h=$VNC_HEIGHT,wait")
fi
vms+=("$name")
# Removes CPU_CORES because windows must be a single CPU in bhyve
# -c $CPU_CORES \
# We need tpm
# -l "tpm,passthru,/dev/tpm0" \
# -S \
while true; do
set -x
set +e
bhyve \
-D \
-c sockets=1,cores=2,threads=2 \
-m $MEMORY \
-H \
-w \
-o 'rtc.use_localtime=false' \
-s 0,hostbridge \
-s "4,nvme,/dev/zvol/${zfs_path}/disk0" \
-s 16,hda,play=/dev/dsp,rec=/dev/dsp \
-s 30,xhci,tablet \
-s 31,lpc -l com1,stdio \
-l "bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,${mount_path}/BHYVE_UEFI_VARS.fd" \
-U '5a63bcd1-5cb4-4401-8a6f-d4042fb928a6' \
"${additional_args[@]}" \
"$name"
local exit_code=$?
set -e
set +x
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 @@
options cfg80211 ieee80211_regdom=US

View File

@@ -0,0 +1,46 @@
#!/bin/sh
#
# REQUIRE: LOGIN
# PROVIDE: windows
# KEYWORD: shutdown
. /etc/rc.subr
name=windows
rcvar=${name}_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
status_cmd="${name}_status"
load_rc_config $name
tmux_name="windows"
windows_start() {
/usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=YES VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /usr/local/bin/launch_windows start windows zroot/freebsd/current/vm/windows /vm/windows /vm/.iso/Win11_23H2_English_x64v2.iso"
}
windows_status() {
if /usr/local/bin/tmux has-session -t $tmux_name 2>/dev/null; then
echo "$tmux_name is running."
else
echo "$tmux_name is not running."
return 1
fi
}
windows_stop() {
/usr/local/bin/tmux has-session -t $tmux_name 2>/dev/null && (
/usr/local/bin/tmux kill-session -t $tmux_name
sleep 10
bhyvectl --vm=windows --destroy
# kill `cat /var/run/windows.pid`
)
windows_wait_for_end
}
windows_wait_for_end() {
while /usr/local/bin/tmux has-session -t $tmux_name 2>dev/null; do
sleep 1
done
}
run_rc_command "$1"

View File

@@ -0,0 +1,3 @@
dependencies:
- role: bhyve
when: 'os_flavor == "freebsd"'

View File

@@ -1,5 +1,30 @@
# - name: Install packages - name: Install loader.conf
# package: copy:
# name: src: "files/{{ item }}_loader.conf"
# - foo dest: "/boot/loader.conf.d/{{ item }}.conf"
# state: present mode: 0644
owner: root
group: wheel
loop:
- disable_wifi_powersave
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: launch_windows.bash
dest: /usr/local/bin/launch_windows
- 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: windows

View File

@@ -30,6 +30,7 @@
- iwlwifi - iwlwifi
- snd_hda_intel - snd_hda_intel
- disable_sp5100_watchdog - disable_sp5100_watchdog
- wifi_us
- name: Configure kernel command line - name: Configure kernel command line
zfs: zfs:
@@ -42,7 +43,8 @@
# amd_pstate=passive :: Fully automated hardware pstate control. # amd_pstate=passive :: Fully automated hardware pstate control.
# amd_pstate=active :: Same as passive except we can set the energy performance preference (EPP) to suggest how much we prefer performance or energy efficiency. # amd_pstate=active :: Same as passive except we can set the energy performance preference (EPP) to suggest how much we prefer performance or energy efficiency.
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds. # amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
"org.zfsbootmenu:commandline": "rw quiet amdgpu.abmlevel=3 pcie_aspm=force pcie_aspm.policy=powersupersave nowatchdog" # amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
"org.zfsbootmenu:commandline": "rw quiet amdgpu.abmlevel=3 pcie_aspm=force pcie_aspm.policy=powersupersave nowatchdog amdgpu.dcdebugmask=0x10"
- name: Install Configuration - name: Install Configuration
copy: copy:
@@ -65,3 +67,34 @@
loop: loop:
- gpe10-boot.service - gpe10-boot.service
- gpe10-sleep.service - gpe10-sleep.service
# install swtpm
# install edk2-ovmf for /usr/share/ovmf/OVMF.fd
# install qemu-system-x86
# doas qemu-system-x86_64 -cdrom /vm/.iso/Win11_23H2_English_x64v2.iso -cpu Skylake-Client-v3 -enable-kvm -m 8192 —device chardev,socket,id=chrtpm,path=/tmp/emulated_tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 -smp 2 -device intel-hda -device hda-duplex -usb -nic user,ipv6=off,model=rtl8139,mac=84:1b:77:c9:03:a6 -bios /usr/share/edk2/x64/OVMF.fd -drive file=/dev/zvol/zroot/freebsd/current/vm/windows/disk0,format=raw,media=disk,if=none,id=nvm -device nvme,drive=nvm,serial=foo,opt_io_size=4096,min_io_size=4096,logical_block_size=4096,physical_block_size=4096
# doas mkdir /tmp/emulated_tpm
# doas swtpm socket --tpmstate dir=/tmp/emulated_tpm --ctrl type=unixio,path=/tmp/emulated_tpm/swtpm-sock --log level=20 --tpm2
- name: Build aur packages
register: buildaur
become_user: "{{ build_user.name }}"
command: "aurutils-sync --no-view {{ item }}"
args:
creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
loop:
- fw-ectool-git
- name: Update cache
when: buildaur.changed
pacman:
name: []
state: present
update_cache: true
- name: Install packages
package:
name:
- fw-ectool-git
- wireless-regdb
state: present

View File

@@ -8,7 +8,6 @@
- libva-utils # for vainfo - libva-utils # for vainfo
- vdpauinfo # for vdpauinfo - vdpauinfo # for vdpauinfo
- libvdpau-va-gl # vdpau support - libvdpau-va-gl # vdpau support
- igt-gpu-tools # for intel_gpu_top
- vulkan-tools # For vulkaninfo - vulkan-tools # For vulkaninfo
state: present state: present

View File

@@ -1,4 +1,4 @@
tmpfs /jail/bastion/tmp tmpfs rw,mode=777 0 0 tmpfs /jail/bastion/tmp tmpfs rw,mode=777 0 0
tmpfs /jail/bastion/var/run tmpfs rw,mode=755 0 0 tmpfs /jail/bastion/var/run tmpfs rw,mode=755 0 0
/jail/certificate/usr/local/etc/letsencrypt/archive/stuff.fizz.buzz /jail/bastion/stuff.fizz.buzz nullfs ro,noexec 0 0 /jail/certificate/usr/local/etc/letsencrypt /jail/bastion/letsencrypt nullfs ro,noexec 0 0

View File

@@ -23,11 +23,15 @@ function start_jail {
jail_interface_name=$(sanitize_interface_name "$2") jail_interface_name=$(sanitize_interface_name "$2")
ip_range="$3" ip_range="$3"
local mac_address
mac_address=$(calculate_mac_address "$jail_interface_name")
assert_bridge "$host_interface_name" "$bridge_name" "$ip_range" assert_bridge "$host_interface_name" "$bridge_name" "$ip_range"
bridge_link_name=$(detect_available_link "${bridge_name}") bridge_link_name=$(detect_available_link "${bridge_name}")
ngctl -d -f - <<EOF ngctl -d -f - <<EOF
mkpeer ${bridge_name}: eiface $bridge_link_name ether mkpeer ${bridge_name}: eiface $bridge_link_name ether
msg ${bridge_name}:$bridge_link_name set $mac_address
name ${bridge_name}:$bridge_link_name $jail_interface_name name ${bridge_name}:$bridge_link_name $jail_interface_name
EOF EOF
ifconfig $(ngctl msg "${jail_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${jail_interface_name}" up ifconfig $(ngctl msg "${jail_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${jail_interface_name}" up
@@ -121,4 +125,11 @@ function sanitize_interface_name {
echo "${1:0:15}" echo "${1:0:15}"
} }
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}"
}
main "${@}" main "${@}"

View File

@@ -2,7 +2,7 @@ admin_git {
path = "/jail/${name}"; path = "/jail/${name}";
vnet; vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
devfs_ruleset = 14; devfs_ruleset = 14;

View File

@@ -2,7 +2,7 @@ bastion {
path = "/jail/${name}"; path = "/jail/${name}";
vnet; vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
devfs_ruleset = 14; devfs_ruleset = 14;

View File

@@ -2,7 +2,7 @@ certificate {
path = "/jail/${name}"; path = "/jail/${name}";
vnet; vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
devfs_ruleset = 14; devfs_ruleset = 14;

View File

@@ -4,8 +4,8 @@ cloak {
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start restricted_nat jail${name} 10.215.2.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start restricted_nat jail${name} 10.215.2.1/24";
# Create a dummy interface that is never used, just to create the cloak bridge that is used by children. # Create a dummy interface that is never used, just to create the cloak bridge that is used by children.
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak dummy${name} 192.168.1.0/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak dummy${name} 192.168.1.0/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop cloak dummy{name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop cloak dummy{name}";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop restricted_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop restricted_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
vnet.interface += "cloak"; vnet.interface += "cloak";

View File

@@ -4,8 +4,10 @@ dagger {
vnet.interface += "dagger"; vnet.interface += "dagger";
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak ${name} 192.168.1.0/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak ${name} 192.168.1.0/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop cloak ${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop cloak ${name}";
devfs_ruleset = 15;
mount.devfs;
mount.fstab = "/etc/fstab.${name}"; mount.fstab = "/etc/fstab.${name}";
exec.start += "/bin/sh /etc/rc"; exec.start += "/bin/sh /etc/rc";

View File

@@ -0,0 +1,15 @@
momlaptop {
path = "/jail/${name}";
vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}";
devfs_ruleset = 14;
mount.devfs;
mount.fstab = "/etc/fstab.${name}";
exec.start += "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
exec.consolelog = "/var/log/jail_${name}_console.log";
}

View File

@@ -2,7 +2,7 @@ nat_dhcp {
path = "/jail/${name}"; path = "/jail/${name}";
vnet; vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
devfs_ruleset = 14; devfs_ruleset = 14;

View File

@@ -4,7 +4,7 @@ olddagger {
vnet.interface += "olddagger"; vnet.interface += "olddagger";
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak ${name} 192.168.1.0/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak ${name} 192.168.1.0/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop cloak ${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop cloak ${name}";
mount.fstab = "/etc/fstab.${name}"; mount.fstab = "/etc/fstab.${name}";

View File

@@ -2,7 +2,7 @@ public_dns {
path = "/jail/${name}"; path = "/jail/${name}";
vnet; vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
devfs_ruleset = 14; devfs_ruleset = 14;

View File

@@ -2,7 +2,7 @@ sample {
path = "/jail/${name}"; path = "/jail/${name}";
vnet; vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
devfs_ruleset = 14; devfs_ruleset = 14;

View File

@@ -2,7 +2,7 @@ sftp {
path = "/jail/${name}"; path = "/jail/${name}";
vnet; vnet;
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24"; exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}"; exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
vnet.interface += "jail${name}"; vnet.interface += "jail${name}";
devfs_ruleset = 14; devfs_ruleset = 14;

View File

@@ -36,8 +36,8 @@ http {
include conf.d/tls_settings.include; include conf.d/tls_settings.include;
# RSA # RSA
ssl_certificate /stuff.fizz.buzz/fullchain1.pem; ssl_certificate /letsencrypt/live/stuff.fizz.buzz/fullchain.pem;
ssl_certificate_key /stuff.fizz.buzz/privkey1.pem; ssl_certificate_key /letsencrypt/live/stuff.fizz.buzz/privkey.pem;
# Nginx by default only allows file uploads up to 1M in size # Nginx by default only allows file uploads up to 1M in size
client_max_body_size 50M; client_max_body_size 50M;

View File

@@ -17,7 +17,7 @@
owner: root owner: root
group: wheel group: wheel
loop: loop:
- /stuff.fizz.buzz - /letsencrypt
- /etc/rc.conf.d - /etc/rc.conf.d
- /usr/local/etc/nginx/conf.d - /usr/local/etc/nginx/conf.d

View File

@@ -0,0 +1,15 @@
# Enable HTTP Strict Transport Security (HSTS) to force clients to
# always connect via HTTPS (do not use if only testing)
add_header Strict-Transport-Security "max-age=31536000;" always;
# Enable cross-site filter (XSS) and tell browser to block detected
# attacks
add_header X-XSS-Protection "1; mode=block" always;
# Prevent some browsers from MIME-sniffing a response away from the
# declared Content-Type
add_header X-Content-Type-Options "nosniff" always;
# Disallow the site to be rendered within a frame (clickjacking
# protection)
add_header X-Frame-Options "DENY" always;
# Indicate that we are serving http3 on port 443
add_header Alt-Svc 'h3=":8033"; ma=864000';

Binary file not shown.

View File

@@ -0,0 +1,2 @@
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/var/log/nginx/*.log 640 5 1000 @T00 GYC /var/run/nginx.pid SIGUSR1

View File

@@ -0,0 +1,48 @@
worker_processes auto;
user www www;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
types {
text/plain log;
}
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
include conf.d/headers.include;
server {
listen 443 quic reuseport;
listen [::]:443 quic reuseport;
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name momlaptop.fizz.buzz;
include conf.d/tls_settings.include;
# RSA
ssl_certificate /momlaptop.fizz.buzz/tls.crt;
ssl_certificate_key /momlaptop.fizz.buzz/tls.key;
# Nginx by default only allows file uploads up to 50M in size
client_max_body_size 50M;
location / {
auth_basic "Stuff";
auth_basic_user_file conf.d/htpasswd;
alias /srv/http/;
autoindex on;
}
}
}

View File

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

View File

@@ -0,0 +1,9 @@
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# Settings for keepalive module for upstreams
proxy_http_version 1.1;
proxy_set_header Connection "";
# Requests sent with early data are subject to replay attacks so the application needs to protect against that by using the Early-Data header.
# proxy_set_header Early-Data $ssl_early_data;

View File

@@ -0,0 +1,3 @@
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;

View File

@@ -0,0 +1,2 @@
dependencies:
- syslog

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,81 @@
- name: Create www group
group:
name: www
- name: Create www user
user:
name: www
home: /srv/http
createhome: false
group: www
- name: Create directories
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: root
group: wheel
loop:
- /momlaptop.fizz.buzz
- /etc/rc.conf.d
- /usr/local/etc/nginx/conf.d
- name: Create directories
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: www
group: www
loop:
- /srv/http
- name: Install packages
package:
name:
- nginx
state: present
# validate fails because nginx config relies on a local mime.types
- name: Install Configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: nginx.conf
dest: /usr/local/etc/nginx/nginx.conf
- src: headers.include
dest: /usr/local/etc/nginx/conf.d/headers.include
- src: proxy.include
dest: /usr/local/etc/nginx/conf.d/proxy.include
- src: tls_settings.include
dest: /usr/local/etc/nginx/conf.d/tls_settings.include
# Generate htpasswd with `htpasswd -c files/htpasswd user1`
# or `printf "USER:$(openssl passwd)\n" >> files/htpasswd`
- src: htpasswd
dest: /usr/local/etc/nginx/conf.d/htpasswd
- name: Install newsyslog configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0600
owner: root
group: wheel
loop:
- src: newsyslog.conf
dest: /usr/local/etc/newsyslog.conf.d/nginx.conf
- name: Install service configuration
copy:
src: "files/{{ item }}_rc.conf"
dest: "/etc/rc.conf.d/{{ item }}"
mode: 0644
owner: root
group: wheel
loop:
- nginx

View File

@@ -0,0 +1,29 @@
# - name: Build aur packages
# register: buildaur
# become_user: "{{ build_user.name }}"
# command: "aurutils-sync --no-view {{ item }}"
# args:
# creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
# loop:
# - foo
# - name: Update cache
# when: buildaur.changed
# pacman:
# name: []
# state: present
# update_cache: true
# - name: Install packages
# package:
# name:
# - foo
# state: present
# - name: Enable services
# systemd:
# enabled: yes
# name: "{{ item }}"
# daemon_reload: yes
# loop:
# - foo.service

View File

@@ -0,0 +1,2 @@
- import_tasks: tasks/common.yaml
# when: foo is defined

View File

@@ -0,0 +1,29 @@
- include_role:
name: per_user
# - name: Create directories
# file:
# name: "{{ account_homedir.stdout }}/{{ item }}"
# state: directory
# mode: 0700
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"
# loop:
# - ".config/foo"
# - 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: foo.conf
# dest: .config/foo/foo.conf
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"'

View File

@@ -6,6 +6,7 @@
"subnet4": [ "subnet4": [
{ {
"subnet": "10.215.1.0/24", "subnet": "10.215.1.0/24",
"id": 1,
"pools": [ { "pool": "10.215.1.10-10.215.1.200" } ], "pools": [ { "pool": "10.215.1.10-10.215.1.200" } ],
"option-data": [ "option-data": [
{ {
@@ -61,12 +62,12 @@
}, },
{ {
// admin_git // admin_git
"hw-address": "58:9c:fc:10:fc:5a", "hw-address": "06:4c:9f:0e:e2:cc",
"ip-address": "10.215.1.210" "ip-address": "10.215.1.210"
}, },
{ {
// public_dns // public_dns
"hw-address": "58:9c:fc:10:ff:80", "hw-address": "06:81:a6:f4:ab:24",
"ip-address": "10.215.1.211" "ip-address": "10.215.1.211"
}, },
{ {
@@ -80,14 +81,19 @@
"ip-address": "10.215.1.215" "ip-address": "10.215.1.215"
}, },
{ {
// sftp // sftp - hard-coded in rc.conf, reproduced here to reserve ip
"hw-address": "58:9c:fc:10:ff:ab", "hw-address": "06:7b:e0:08:16:5d",
"ip-address": "10.215.1.216" "ip-address": "10.215.1.216"
}, },
{ {
// bastion // bastion - hard-coded in rc.conf, reproduced here to reserve ip
"hw-address": "58:9c:fc:10:ff:a2", "hw-address": "06:ca:1a:10:74:09",
"ip-address": "10.215.1.217" "ip-address": "10.215.1.217"
},
{
// momlaptop - hard-coded in rc.conf, reproduced here to reserve ip
"hw-address": "06:85:69:c5:6a:d6",
"ip-address": "10.215.1.218"
} }
] ]
} }

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
kubectl get pipelinerun --all-namespaces -o go-template='{{range .items}}{{.metadata.namespace}}/{{.metadata.name}}{{"\n"}}{{end}}' | while read p; do namespace=$(cut -d '/' -f 1 <<<"$p"); name=$(cut -d '/' -f 2 <<<"$p"); kubectl patch pipelinerun -n "$namespace" "$name" -p '{"metadata":{"finalizers":null}}' --type=merge; done

View File

@@ -13,7 +13,7 @@ function cleanup {
done done
} }
pods=() pods=()
for sig in EXIT INT QUIT HUP TERM; do for sig in EXIT; do
trap "set +e; cleanup" "$sig" trap "set +e; cleanup" "$sig"
done done

View File

@@ -508,98 +508,372 @@
] ]
}, },
"key_leds": { "key_leds": {
"K00": null, "K00": [
"K01": null, 0,
"K02": null, 0
"K03": null, ],
"K04": null, "K01": [
"K05": null, 0,
"K06": null, 0
"K07": null, ],
"K08": null, "K02": [
"K09": null, 0,
"K0A": null, 0
"K0B": null, ],
"K0C": null, "K03": [
"K0D": null, 0,
"K0E": null, 0
"K10": null, ],
"K11": null, "K04": [
"K12": null, 0,
"K13": null, 0
"K14": null, ],
"K15": null, "K05": [
"K16": null, 0,
"K17": null, 0
"K18": null, ],
"K19": null, "K06": [
"K1A": null, 0,
"K1B": null, 0
"K1C": null, ],
"K1D": null, "K07": [
"K1E": null, 0,
"K20": null, 0
"K21": null, ],
"K22": null, "K08": [
"K23": null, 0,
"K24": null, 0
"K25": null, ],
"K26": null, "K09": [
"K27": null, 0,
"K28": null, 0
"K29": null, ],
"K2A": null, "K0A": [
"K2B": null, 0,
"K2C": null, 0
"K2D": null, ],
"K2E": null, "K0B": [
"K30": null, 0,
"K31": null, 0
"K32": null, ],
"K33": null, "K0C": [
"K34": null, 0,
"K35": null, 0
"K36": null, ],
"K37": null, "K0D": [
"K38": null, 0,
"K39": null, 0
"K3A": null, ],
"K3B": null, "K0E": [
"K3C": null, 0,
"K3D": null, 0
"K40": null, ],
"K41": null, "K10": [
"K42": null, 0,
"K43": null, 0
"K44": null, ],
"K45": null, "K11": [
"K46": null, 0,
"K47": null, 0
"K48": null, ],
"K49": null, "K12": [
"K4A": null, 0,
"K4B": null, 0
"K4C": null, ],
"K50": null, "K13": [
"K51": null, 0,
"K52": null, 0
"K53": null, ],
"K54": null, "K14": [
"K55": null, 0,
"K56": null, 0
"K57": null, ],
"K58": null, "K15": [
"K59": null, 0,
"K5A": null, 0
"K5B": null ],
"K16": [
0,
0
],
"K17": [
0,
0
],
"K18": [
0,
0
],
"K19": [
0,
0
],
"K1A": [
0,
0
],
"K1B": [
0,
0
],
"K1C": [
0,
0
],
"K1D": [
0,
0
],
"K1E": [
0,
0
],
"K20": [
0,
0
],
"K21": [
0,
0
],
"K22": [
0,
0
],
"K23": [
0,
0
],
"K24": [
0,
0
],
"K25": [
0,
0
],
"K26": [
0,
0
],
"K27": [
0,
0
],
"K28": [
0,
0
],
"K29": [
0,
0
],
"K2A": [
0,
0
],
"K2B": [
0,
0
],
"K2C": [
0,
0
],
"K2D": [
0,
0
],
"K2E": [
0,
0
],
"K30": [
0,
0
],
"K31": [
0,
0
],
"K32": [
0,
0
],
"K33": [
0,
0
],
"K34": [
0,
0
],
"K35": [
0,
0
],
"K36": [
0,
0
],
"K37": [
0,
0
],
"K38": [
0,
0
],
"K39": [
0,
0
],
"K3A": [
0,
0
],
"K3B": [
0,
0
],
"K3C": [
0,
0
],
"K3D": [
0,
0
],
"K40": [
0,
0
],
"K41": [
0,
0
],
"K42": [
0,
0
],
"K43": [
0,
0
],
"K44": [
0,
0
],
"K45": [
0,
0
],
"K46": [
0,
0
],
"K47": [
0,
0
],
"K48": [
0,
0
],
"K49": [
0,
0
],
"K4A": [
0,
0
],
"K4B": [
0,
0
],
"K4C": [
0,
0
],
"K50": [
0,
0
],
"K51": [
0,
0
],
"K52": [
0,
0
],
"K53": [
0,
0
],
"K54": [
0,
0
],
"K55": [
0,
0
],
"K56": [
0,
0
],
"K57": [
0,
0
],
"K58": [
0,
0
],
"K59": [
0,
0
],
"K5A": [
0,
0
],
"K5B": [
0,
0
]
}, },
"layers": [ "layers": [
{ {
"mode": [ "mode": [
7, 0,
127 127
], ],
"brightness": 135, "brightness": 109,
"color": [
0,
0
]
},
{
"mode": [
13,
127
],
"brightness": 109,
"color": [
21,
255
]
},
{
"mode": [
13,
127
],
"brightness": 109,
"color": [ "color": [
142, 142,
255 255
@@ -610,29 +884,7 @@
13, 13,
127 127
], ],
"brightness": 135, "brightness": 109,
"color": [
142,
255
]
},
{
"mode": [
13,
127
],
"brightness": 135,
"color": [
142,
255
]
},
{
"mode": [
13,
127
],
"brightness": 135,
"color": [ "color": [
142, 142,
255 255

View File

@@ -0,0 +1,7 @@
# 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

@@ -0,0 +1,239 @@
#!/usr/local/bin/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 sharename /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 bhyve_netgraph_bridge create-disk zdata/vm/poudriere /vm/poudriere 10
# doas bhyve_netgraph_bridge start poudriere zdata/vm/poudriere /vm/poudriere /vm/iso/FreeBSD-13.2-RELEASE-amd64-bootonly.iso
# doas bhyve_netgraph_bridge start poudriere zdata/vm/poudriere /vm/poudriere
: ${VERBOSE:="NO"} # or YES
: ${CPU_CORES:="1"}
: ${MEMORY:="1G"}
: ${NETWORK:="NAT"} # or RAW or BOTH
: ${IP_RANGE:="10.215.1.1/24"} # Ignored for RAW networks
: ${INTERFACE_NAME:="linfi_host"} # 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"}
: ${PASSTHROUGH:="1/0/0"}
if [ "$VERBOSE" = "YES" ]; then
set -x
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 {
local cmd="$1"
shift 1
if [ "$cmd" = "create-disk" ]; then
create_disk "${@}"
elif [ "$cmd" = "start" ]; then
start_vm "${@}"
else
die 1 "Unrecognized command $cmd"
fi
}
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 -o volblocksize=64K "$zfs_path/disk0"
}
function start_vm {
local name="$1"
local zfs_path="$2"
local mount_path="$3"
local mount_cd="${4:-}"
if [ -e "${mount_path}/settings" ]; then
source "${mount_path}/settings"
fi
local additional_args=()
local host_interface_name="linfi_host"
local bridge_name="linfi_bridge"
assert_bridge "$host_interface_name" "$bridge_name"
local mac_address
mac_address=$(calculate_mac_address "$name")
local bridge_link_name
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}")
# -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" "29,fbuf,tcp=$VNC_LISTEN,w=$VNC_WIDTH,h=$VNC_HEIGHT")
fi
vms+=("$name")
while true; do
set -x
set +e
bhyve \
-D \
-c sockets=1,cores=1,threads=1 \
-m "$MEMORY" \
-H \
-w \
-o 'rtc.use_localtime=false' \
-s 0,hostbridge \
-s "4,nvme,/dev/zvol/${zfs_path}/disk0" \
-S \
-s "7,passthru,${PASSTHROUGH}" \
-s 30,xhci,tablet \
-s 31,lpc -l com1,stdio \
-l "bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,${mount_path}/BHYVE_UEFI_VARS.fd" \
-U '08421734-875e-11ef-a0f3-f426796942c7' \
"${additional_args[@]}" \
"$name"
local exit_code=$?
set -e
set +x
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"
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}" 192.168.253.2/24 up
route add default 192.168.253.1
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 @@
linfi_enable="YES"

View File

@@ -0,0 +1,3 @@
dependencies:
- role: bhyve
when: 'os_flavor == "freebsd"'

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,50 @@
- name: Install loader.conf
template:
src: "templates/{{ item }}_loader.conf.j2"
dest: "/boot/loader.conf.d/{{ item }}.conf"
mode: 0644
owner: root
group: wheel
loop:
- linfi
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: launch_linfi.bash
dest: /usr/local/bin/launch_linfi
- name: Install rc script
template:
src: "templates/{{ item.src }}.j2"
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
owner: root
group: wheel
mode: 0755
loop:
- src: linfi
- name: Install service configuration
copy:
src: "files/{{ item }}_rc.conf"
dest: "/etc/rc.conf.d/{{ item }}"
mode: 0644
owner: root
group: wheel
loop:
- linfi
- name: Install service configuration
template:
src: "templates/{{ item }}_rc.conf.j2"
dest: "/etc/rc.conf.d/{{ item }}"
mode: 0644
owner: root
group: wheel
loop:
- devmatch

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