function deploySoftware -d "Deploys a the specified software action" -a action
    set -l dir (status dirname)
    . "$dir/software.fish"

    if [ -z "$action" ]
        set action "install"
    end

    set -l isInstall (
        if [ "$action" = "install" ]
            echo true
        else
            echo false
        end
    )

    if isOSEnabled secureBoot
        source "$dir/../Config/SecureBoot/main.fish" $argv
    end

    and if isOSEnabled hardware.surfaceBook
        source "$dir/../Drivers/SurfaceBook2/main.fish" $argv
    end

    and if isOSEnabled hardware.nvidiaGPU
        source "$dir/../Software/nvidia-dkms/main.fish" $argv
    end

    and if isOSEnabled hardware.xoneReceiver
        source "$dir/../Software/xone/main.fish" $argv
    end

    and for component in (getOSConfig hardware.components --json | jq '.[]' --raw-output0 | string split0)
        if [ "$component" = "Logitech G903" ]
            source "$dir/../../Common/Drivers/Logitech G903/main.fish" $argv
        end
    end

    and if isEnabled valhalla.windows.dualboot.enable && $isInstall
        yayinst bt-dualboot
    end

    and if collectionActive essential
        if $isInstall
            yayinst \
                mkinitcpio-firmware \
                neofetch \
                bash-completion \
                wget \
                screen \
                tmux \
                htop \
                lsof \
                zsh \
                fish \
                pkgfile \
                sl \
                rar

            and sudo pkgfile --update
        end

        and source "$dir/../../Common/Software/bash/main.fish" $argv
        and source "$dir/../../Common/Software/nuke-usb/main.fish" $argv
        and source "$dir/../Software/sudo/main.fish" $argv
        and source "$dir/../Software/aliae/main.fish" $argv
        and source "$dir/../Software/Oh My Posh/main.fish" $argv
        and source "$dir/../Software/openssh/main.fish" $argv
        and source "$dir/../Software/vim/main.fish" $argv
        and source "$dir/../Software/git/main.fish" $argv
        and source "$dir/../Software/zoxide/main.fish" $argv
        and source "$dir/../Software/logo-ls/main.fish" $argv

        # GRUB Shenanigans - if that's not essential I don't know what is!
        and source "$dir/../Software/minegrub-theme/main.fish" $argv
    end

    and if collectionActive common
        if $isInstall
            yayinst \
                tldr \
                btop \
                terminal-parrot
        end
    end

    and if collectionActive desktopExperience
        source "$dir/../Software/KDE/main.fish" $argv
        and source "$dir/../Software/sddm/main.fish" $argv

        and if $isInstall
            yayinst \
                maliit-keyboard \
                dconf-editor \
                flatpak (
                    # Fixes: https://www.reddit.com/r/flatpak/comments/168tav2/how_to_fix_blurry_flatpaks_on_high_resolution/
                ) xdg-desktop-portal-gtk

            # Fonts
            and yayinst \
                ttf-cascadia-code-nerd \
                ttf-ms-win11-auto \
                otf-cascadia-code \
                ttf-droid

            # Password Management
            and yayinst \
                bitwarden \
                keepass \
                keepassxc

            # Tools
            and yayinst \
                android-tools \
                blackbox-terminal \
                cpu-x \
                gnome-calculator \
                yubikey-manager-qt \
                wireshark-qt \
                linux-wifi-hotspot

            # Remote Access
            and yayinst \
                remmina (
                    # RDP support for Remmina
                ) freerdp

            # Creativity
            and yayinst \
                gimp \
                inkscape

            # Office stuff
            and yayinst \
                libreoffice-fresh \
                naps2-bin \
                pdfarranger \
                protonmail-bridge \
                thunderbird

            and yayinst \
                texlive \
                texlive-langgerman

            # Virtualization
            and yayinst propertree-git # mac .plist config file editor

            and if collectionActive school
                yayinst \
                    teams-for-linux \
                    xournalpp-git \
                    rnote
            end
        end

        # Internet Access
        and source "$dir/../Software/Firefox/main.fish" $argv
        and source "$dir/../Software/brave/main.fish" $argv
        and source "$dir/../Software/Pennywise/main.fish" $argv

        # Virtualization
        and source "$dir/../Software/waydroid/main.fish" $argv
        and source "$dir/../Software/Virtual Machine Manager/main.fish" $argv

        and if collectionActive coding
            if $isInstall
                yayinst \
                    devdocs-desktop \
                    godot-mono
            end

            and source "$dir/../Software/vscode/main.fish" $argv
        end
    end

    and if collectionActive server
    else
        if $isInstall
            # Energy Saving
            yayinst power-profiles-daemon
            and sudo systemctl enable --now power-profiles-daemon

            # Networking
            and yayinst \
                networkmanager-openvpn \
                networkmanager-openconnect \
                proton-vpn-gtk-app \
                protonvpn-cli-community
        end

        and if collectionActive common
            if $isInstall
                and yayinst \
                    img2pdf \
                    numbat-bin \
                    nvtop \
                    pdf2svg \
                    tnef
            end

            and source "$dir/../Software/IcedTea/main.fish" $argv
        end
    end

    and if collectionActive media && $isInstall
        yayinst \
            ytmdesktop-bin \
            netflix \
            spotube-bin \
            stremio \
            tidal-dl-ng \
            tidal-hifi-bin \
            nuclear-player-bin \
            audius-client-bin
    end

    and if collectionActive fileSync
        if $isInstall
            yayinst nextcloud-client
        end

        and source "$dir/../Software/rclone/main.fish" $argv
    end

    and if collectionActive socialMedia && $isInstall
        yayinst \
            signal-desktop \
            vesktop-bin

        and begin
            yes y | runYay threema-desktop
        end

        and begin
            yes y | runYay nodejs
        end
    end

    and if collectionActive productivity && $isInstall
        yayinst \
            anki-bin
    end

    and if collectionActive school && $isInstall
        yayinst \
            jdk17-temurin \
            gradle \
            jetbrains-toolbox

        and source "$dir/../../Common/Software/udev/ct-board.fish"
    end

    and if collectionActive coding
        if $isInstall
            yayinst \
                archiso \
                wimlib (
                    # ISO support for wimlib
                ) cdrkit \
                tea \
                woodpecker-cli (
                    # AsciiDocs
                ) python-docutils (
                    # reStructuredText
                ) esbonio
        end

        and source "$dir/../Software/n/main.fish" $argv
        and source "$dir/../Software/docker/main.fish" $argv
    end

    and if collectionActive python
        if $isInstall
            yayinst \
                python \
                python-pip \
                python-pipenv
        end

        and source "$dir/../Software/pyenv/main.fish" $argv
    end

    and if collectionActive gaming
        if $isInstall
            yayinst \
                chiaki-ng \
                osu-lazer-bin \
                libretro \
                supertux \
                gamepad-tool-bin

            and sudo flatpak install -y flathub com.usebottles.bottles
        end

        and source "$dir/../Software/Lutris/main.fish" $argv
        and source "$dir/../Software/steam/main.fish" $argv
    end

    and if collectionActive essential && $isInstall
        yayinst bb
    end
end

deploySoftware $argv