generated from ublue-os/udev-rules
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Split justfiles into multiple numbered files to fix issue with d…
…efault command on other releases. (#118) * fix: Split justfiles into multiple numbered files to fix issue with default command on other releases. * chore: Set vim syntax highlighting on just files * fix: Allow duplicate recipes to prevent any errors being thrown, ignore comments in just commands. * feat(just): Use new fedora-distrobox image * chore: Clean up 40-nvidia.just * feat: Create /usr/share/ublue-os/justfile which points to every file in /usr/share/ublue-os/just/*.just * chore: Modify ublue-os-just.sh to create .justfile in home pointing to new /usr/share/ublue-os/justfile fixme: Modify existing .justfiles to have this same change in a non-destructive way. * chore: Adjust versions * fix: Reset previously added .just files for existing users and preserve user-added lines. chore: Minor spec cleanup * feat: Add support for fish shell * feat: Add 50-akmods just file with wl and xbox driver toggling. feat: Add installer for obs-studio-portable * feat: Add a check when running certain nvidia commands for the nvidia module, print a helpful message if it's not found. * fix(just): Correctly disable WL * feat(just): Show a helpful error if nvidia-smi isn't present
- Loading branch information
Showing
12 changed files
with
163 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# vim: set ft=make : | ||
|
||
set allow-duplicate-recipes | ||
set ignore-comments | ||
|
||
_default: | ||
@just --unstable --list --list-heading $'Available commands:\n' --list-prefix $' - ' | ||
|
||
# Boot into this device's BIOS/UEFI screen | ||
bios: | ||
systemctl reboot --firmware-setup | ||
|
||
# Show the changelog | ||
changelogs: | ||
rpm-ostree db diff --changelogs | ||
|
||
# Enroll Nvidia driver & KMOD signing key for secure boot - Enter password "ublue-os" if prompted | ||
enroll-secure-boot-key: | ||
sudo mokutil --import /etc/pki/akmods/certs/akmods-ublue.der | ||
echo 'Enter password "ublue-os" if prompted' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# vim: set ft=make : | ||
|
||
# Update system, flatpaks, and containers all at once | ||
update: | ||
rpm-ostree update | ||
flatpak update -y | ||
distrobox upgrade -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# vim: set ft=make : | ||
|
||
# Clean up old containers and flatpaks | ||
clean-system: | ||
#!/usr/bin/env bash | ||
podman system prune -a | ||
flatpak uninstall --unused | ||
rpm-ostree cleanup -bm | ||
if [ -x "$(command -v nix-store)" ]; then | ||
nix-store --gc | ||
nix-store --optimise | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# vim: set ft=make : | ||
|
||
# Set needed kernel arguments for Nvidia GPUs | ||
nvidia-set-kargs: | ||
#!/usr/bin/env bash | ||
if command -v nvidia-smi; then | ||
rpm-ostree kargs \ | ||
--append-if-missing=rd.driver.blacklist=nouveau \ | ||
--append-if-missing=modprobe.blacklist=nouveau \ | ||
--append-if-missing=nvidia-drm.modeset=1 \ | ||
--delete-if-present=nomodeset | ||
else | ||
echo 'You do not appear to be on a Nvidia image, please refer to the README for your uBlue-OS image.' | ||
fi | ||
|
||
# Test CUDA support for Nvidia GPUs | ||
nvidia-test-cuda: | ||
#!/usr/bin/env bash | ||
if lsmod | grep -wq "nvidia"; then | ||
podman run \ | ||
--user 1000:1000 \ | ||
--security-opt=no-new-privileges \ | ||
--cap-drop=ALL \ | ||
--security-opt label=type:nvidia_container_t \ | ||
docker.io/mirrorgooglecontainers/cuda-vector-add:v0.1 | ||
else | ||
echo 'The Nvidia kernel module is not loaded. You may be using secure boot without the needed signing key, lacking the needed kargs, or may not be on a Nvidia image. See "just enroll-secure-boot-key" and "just nvidia-set-kargs".' | ||
fi | ||
|
||
# Enable VAAPI in Firefox Flatpak for Nvidia GPUs | ||
nvidia-setup-firefox-vaapi: | ||
#!/usr/bin/env bash | ||
if lsmod | grep -wq "nvidia"; then | ||
flatpak override \ | ||
--user \ | ||
--filesystem=host-os \ | ||
--env=LIBVA_DRIVER_NAME=nvidia \ | ||
--env=LIBVA_DRIVERS_PATH=/run/host/usr/lib64/dri \ | ||
--env=LIBVA_MESSAGING_LEVEL=1 \ | ||
--env=MOZ_DISABLE_RDD_SANDBOX=1 \ | ||
--env=NVD_BACKEND=direct \ | ||
--env=MOZ_ENABLE_WAYLAND=1 \ | ||
org.mozilla.firefox | ||
else | ||
echo 'The Nvidia kernel module is not loaded. You may be using secure boot without the needed signing key, lacking the needed kargs, or may not be on a Nvidia image. See "just enroll-secure-boot-key" and "just nvidia-set-kargs".' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# vim: set ft=make : | ||
|
||
# Use stock gamepad drivers | ||
use-stock-gamepads: | ||
#!/usr/bin/env bash | ||
sudo bash -c '> /etc/modprobe.d/xone.conf' | ||
sudo bash -c '> /etc/modprobe.d/xpadneo.conf' | ||
sudo bash -c '> /etc/modprobe.d/xpad-noone-blacklist.conf' | ||
sudo bash -c '> /etc/modules-load.d/xpad-noone.conf' | ||
|
||
# Use uBlue gamepad drivers (Default) | ||
use-ublue-gamepads: | ||
#!/usr/bin/env bash | ||
sudo rm -f /etc/modprobe.d/xone.conf | ||
sudo rm -f /etc/modprobe.d/xpadneo.conf | ||
sudo rm -f /etc/modprobe.d/xpad-noone-blacklist.conf | ||
sudo rm -f /etc/modules-load.d/xpad-noone.conf | ||
|
||
# Disable Broadcom WL driver (Default - WL breaks numerous other Wi-Fi adapters) | ||
disable-broadcom-wl: | ||
#!/usr/bin/env bash | ||
sudo bash -c '> /etc/modules-load.d/broadcom-wl-blacklist.conf' | ||
sudo bash -c 'echo "blacklist wl" > /etc/modules-load.d/default-disable-broadcom-wl.conf' | ||
|
||
# Use Broadcom WL driver | ||
use-broadcom-wl: | ||
#!/usr/bin/env bash | ||
sudo rm -f /etc/modprobe.d/broadcom-wl-blacklist.conf | ||
sudo rm -f /etc/modprobe.d/default-disable-broadcom-wl.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# vim: set ft=make : | ||
|
||
# Enable xwaylandvideobridge | ||
fixscreenshare: | ||
cp /usr/share/applications/org.kde.xwaylandvideobridge.desktop $HOME/.config/autostart/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Name: ublue-os-just | ||
Packager: ublue-os | ||
Vendor: ublue-os | ||
Version: 0.2 | ||
Version: 0.3 | ||
Release: 1%{?dist} | ||
Summary: ublue-os just integration | ||
License: MIT | ||
|
@@ -11,9 +11,13 @@ BuildArch: noarch | |
Supplements: just | ||
|
||
Source0: ublue-os-just.sh | ||
Source1: custom.just | ||
Source2: main.just | ||
Source3: nvidia.just | ||
Source1: 00-default.just | ||
Source2: 10-update.just | ||
Source3: 20-clean.just | ||
Source4: 30-distrobox.just | ||
Source5: 40-nvidia.just | ||
Source6: 50-akmods.just | ||
Source7: 60-custom.just | ||
|
||
%global sub_name %{lua:t=string.gsub(rpm.expand("%{NAME}"), "^ublue%-os%-", ""); print(t)} | ||
|
||
|
@@ -26,18 +30,29 @@ Adds ublue-os just integration for easier setup | |
%build | ||
|
||
mkdir -p -m0755 %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} | ||
cp %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} | ||
install -Dm755 %{SOURCE0} %{buildroot}%{_sysconfdir}/profile.d/ublue-os-just.sh | ||
install -Dm755 %{SOURCE0} %{buildroot}%{_datarootdir}/fish/vendor_conf.d/ublue-os-just.fish | ||
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name} | ||
|
||
# Create justfile which contains all .just files included in this package | ||
for justfile in %{buildroot}%{_datadir}/%{VENDOR}/%{sub_name}/*.just; do | ||
echo "!include %{_datadir}/%{VENDOR}/%{sub_name}/${justfile}" >> "%{buildroot}%{_datadir}/%{VENDOR}/justfile" | ||
done | ||
|
||
%files | ||
%dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name} | ||
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/custom.just | ||
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/main.just | ||
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/nvidia.just | ||
%attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/ublue-os-just.sh | ||
%attr(0755,root,root) %{_sysconfdir}/profile.d/ublue-os-just.sh | ||
%attr(0755,root,root) %{_datarootdir}/fish/vendor_conf.d/ublue-os-just.fish | ||
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/*.just | ||
%attr(0644,root,root) %{_datadir}/%{VENDOR}/justfile | ||
|
||
%changelog | ||
* Thu Sep 21 2023 Kyle Gospodnetich <[email protected]> - 0.3 | ||
- Modify just files to be numbered for ordered loading | ||
- Move to using a single master justfile | ||
- Clean up previous installs to point to new file | ||
- Add support for fish shell | ||
|
||
* Sat May 13 2023 Benjamin Sherman <[email protected]> - 0.2 | ||
- Refactor directory structure | ||
- Rename justfile to main.just | ||
|