├── .gitignore ├── .gitlab-ci.yml ├── LICENSE ├── README.md ├── bin ├── build ├── remove └── sync ├── ci ├── build-aur ├── build-local ├── builder │ └── Dockerfile ├── generate-ci-config └── publish ├── installer ├── install-arch └── install-router ├── pacman.conf └── pkg └── mdaffin ├── PKGBUILD ├── add-nvim-plugin ├── files-base ├── etc │ ├── profile.d │ │ └── mdaffin-base.sh │ ├── sudoers.d │ │ └── mdaffin-base │ └── vconsole.conf └── usr │ ├── etc │ └── npmrc │ └── lib │ └── systemd │ └── system │ └── multi-user.target.wants │ └── systemd-timesyncd.service ├── files-dell-xps-13 └── etc │ ├── X11 │ ├── xinit │ │ └── xinitrc.d │ │ │ └── 20-hidpi.sh │ └── xorg.conf.d │ │ └── 90-hidpi-monitor.conf │ └── sway │ └── config.d │ └── mdaffin-dell-xps-13.conf ├── files-desktop ├── etc │ ├── rofi.conf │ ├── skel │ │ └── .config │ │ │ └── alacritty │ │ │ └── alacritty.yml │ ├── sway │ │ └── config.d │ │ │ └── mdaffin.conf │ └── xdg │ │ └── waybar │ │ ├── mdaffin-config │ │ └── mdaffin-style.css └── usr │ ├── lib │ ├── sddm │ │ └── sddm.conf.d │ │ │ └── z-mdaffin.conf │ └── systemd │ │ ├── network │ │ ├── 90-mdaffin-base-enp.network │ │ └── 90-mdaffin-base-wlp.network │ │ └── system │ │ └── multi-user.target.wants │ │ ├── avahi-daemon.service │ │ ├── rngd.service │ │ ├── sddm.service │ │ ├── systemd-networkd.service │ │ └── systemd-resolved.service │ └── share │ ├── X11 │ ├── xinit │ │ └── xinitrc.d │ │ │ └── 30-mdaffin-desktop.sh │ └── xorg.conf.d │ │ ├── 00-keyboard.conf │ │ └── 50-mouse-acceleration.conf │ ├── alacritty │ └── alacritty.yml │ ├── mdaffin │ └── etc │ │ ├── i3 │ │ └── config │ │ └── libinput-gestures.conf │ └── wayland-sessions │ └── mdaffin-sway.desktop ├── files-neovim └── usr │ ├── bin │ ├── vi │ └── vim │ └── share │ └── nvim │ └── runtime │ └── pack │ └── plugin │ └── start │ └── base │ ├── lua │ └── lsp.lua │ └── plugin │ └── workspace.vim ├── mdaffin-base.install └── mdaffin-desktop.install /.gitignore: -------------------------------------------------------------------------------- 1 | *.pkg.tar.xz 2 | *.pkg.tar.zst 3 | *.tar.gz 4 | /pkg/**/pkg/ 5 | /pkg/**/src/ 6 | repo/ 7 | *.log 8 | root/ 9 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | image: docker 2 | 3 | stages: 4 | - build 5 | - test 6 | 7 | generate-config: 8 | image: alpine 9 | stage: build 10 | script: ./ci/generate-ci-config > generated-config.yml 11 | artifacts: 12 | paths: 13 | - generated-config.yml 14 | variables: 15 | BUCKET: s3://repository-b1b999c 16 | only: 17 | refs: 18 | - pipelines2 19 | - master 20 | 21 | build:builder: 22 | stage: build 23 | services: 24 | - docker:dind 25 | before_script: 26 | - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY" 27 | script: 28 | - docker build -t "$CI_REGISTRY_IMAGE/builder" ci/builder 29 | - docker push "$CI_REGISTRY_IMAGE/builder" 30 | only: 31 | refs: 32 | - pipelines2 33 | - master 34 | changes: 35 | - "ci/builder/**/*" 36 | 37 | child-pipeline: 38 | stage: test 39 | trigger: 40 | include: 41 | - artifact: generated-config.yml 42 | job: generate-config 43 | only: 44 | refs: 45 | - pipelines2 46 | - master 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Michael Daffin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arch Linux Repository 2 | 3 | A set of meta-packages and tooling for managing Arch Linux installs via a custom 4 | repository. 5 | 6 | `pkg/mdaffin` contains the meta-packages for my systems and do not strictly 7 | follow the Arch Linux packaging guidelines. Instead, I designed the packages 8 | for easy maintenance. I will sometimes change the contents of the meta-packages 9 | to suite my requirements, as such you should not use them directly. Instead use 10 | them as a base for creating your own meta-packages. 11 | 12 | The `installer` directory contains installers for my different system with 13 | `installer/install-arch` containing the general purpose installer. Use this as 14 | a base for creating your own. You can install them from a normal Arch Linux ISO 15 | with curl and bash such as the following (using git.io URL shortener to make it 16 | easier to type). 17 | 18 | **WARNING** This will wipe a drive and install Arch Linux on it. **DO NOT** run 19 | unless you have read through it first. 20 | 21 | ```bash 22 | curl -sL https://git.io/vAoV8 | bash 23 | ``` 24 | 25 | For more details see these blog posts: 26 | 27 | - **Part 1:** [Hosting an Arch Linux Repository in an Amazon S3 Bucket] 28 | - **Part 2:** [Managing Arch Linux with Meta Packages] 29 | - **Part 3:** [Creating a Custom Arch Linux Installer] 30 | 31 | [hosting an arch linux repository in an amazon s3 bucket]: https://disconnected.systems/blog/archlinux-repo-in-aws-bucket 32 | [managing arch linux with meta packages]: https://disconnected.systems/blog/archlinux-meta-packages 33 | [creating a custom arch linux installer]: https://disconnected.systems/blog/archlinux-installer 34 | 35 | ## Contributing 36 | 37 | I welcome fixes for bugs or better ways of doing something. But these packages 38 | and installers are for my personal use and as such I will not approve pull 39 | requests for features I do not need. Feel free to raise issues if you want help 40 | with your own packages, have an interesting idea, want some clarification or 41 | want to discuss something generally. 42 | 43 | ## Requirements 44 | 45 | - A bucket/space on [Amazon S3] or [Digital Ocean] 46 | - The packages `s3cmd` and `devtools` 47 | 48 | A token from Amazon S3 or Digital Ocean spaces in `~/.s3cfg` as 49 | 50 | ```ini 51 | [default] 52 | access_key = 53 | secret_key = 54 | ``` 55 | 56 | [amazon s3]: https://aws.amazon.com/s3/ 57 | [digital ocean]: https://m.do.co/c/8fba3fc95fef 58 | 59 | ## Build all packages 60 | 61 | Builds all local packages in `pkg/` and uploads them to the remote repository. 62 | 63 | ```bash 64 | ./bin/build 65 | ``` 66 | 67 | You can build one or more packages rather then all packages by specifying the 68 | path to each package. 69 | 70 | ```bash 71 | ./bin/build pkg/mdaffin-{base,devel} 72 | ``` 73 | 74 | ## Managing AUR Packages 75 | 76 | Use the `aursync` wrapper script to add/update packages from AUR. 77 | 78 | ```bash 79 | # build and install one or more packages 80 | ./bin/sync 81 | 82 | # update all aur packages 83 | ./bin/sync -u 84 | ``` 85 | 86 | ## Removing a Package 87 | 88 | To remove a package from the repository run the following. 89 | 90 | ```bash 91 | ./bin/remove 92 | ``` 93 | -------------------------------------------------------------------------------- /bin/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Wraps aursync command to mount an amazon s3 bucket which contains a repository 3 | set -uo pipefail 4 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 5 | 6 | REMOTE_PATH=s3://mdaffin-arch/repo/x86_64 7 | LOCAL_PATH=$HOME/.local/share/arch-repo 8 | REPO_NAME=mdaffin 9 | 10 | PACKAGES=${@:-pkg/*} 11 | CHROOT="$HOME/.local/share/arch-root" 12 | 13 | mkdir -p "$LOCAL_PATH" 14 | mkdir -p "$CHROOT" 15 | 16 | [[ -d "$CHROOT/root" ]] || mkarchroot -C /etc/pacman.conf "$CHROOT/root" \ 17 | bash bzip2 coreutils cryptsetup device-mapper dhcpcd diffutils e2fsprogs \ 18 | file filesystem findutils gawk gcc-libs gettext glibc grep gzip inetutils \ 19 | iproute2 iputils less licenses linux logrotate man-db man-pages mdadm \ 20 | pacman pciutils perl procps-ng psmisc s-nail sed shadow sysfsutils \ 21 | systemd-sysvcompat tar texinfo usbutils util-linux which base-devel 22 | 23 | for package in $PACKAGES; do ( 24 | cd "$package" || ( echo "No such directory: $package"; exit 1 ) 25 | rm -f ./*.pkg.tar.zst 26 | makechrootpkg -cur "$CHROOT" 27 | ) done 28 | 29 | s3cmd sync "$REMOTE_PATH/$REPO_NAME".{db,files}.tar.xz "$LOCAL_PATH/" 30 | ln -sf "$REPO_NAME.db.tar.xz" "$LOCAL_PATH/$REPO_NAME.db" 31 | ln -sf "$REPO_NAME.files.tar.xz" "$LOCAL_PATH/$REPO_NAME.files" 32 | 33 | 34 | repo-add "$LOCAL_PATH/$REPO_NAME.db.tar.xz" "${PACKAGES[@]}/"*.pkg.tar.zst 35 | s3cmd sync --follow-symlinks --acl-public \ 36 | "${PACKAGES[@]}/"*.pkg.tar.zst \ 37 | "$LOCAL_PATH/$REPO_NAME".{db,files}{,.tar.xz} \ 38 | "$REMOTE_PATH/" 39 | -------------------------------------------------------------------------------- /bin/remove: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # Wraps aursync command to mount an amazon s3 bucket which contains a repository 3 | set -uo pipefail 4 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 5 | 6 | package=${1:?"Missing package"} 7 | 8 | REMOTE_PATH=s3://mdaffin-arch/repo/x86_64 9 | LOCAL_PATH=$HOME/.local/share/arch-repo 10 | REPO_NAME=mdaffin 11 | 12 | mkdir -p "$LOCAL_PATH" 13 | 14 | ## Sync remote DB to local ## 15 | s3cmd sync "$REMOTE_PATH/$REPO_NAME".{db,files}.tar.xz "$LOCAL_PATH/" 16 | ln -sf "$REPO_NAME.db.tar.xz" "$LOCAL_PATH/$REPO_NAME.db" 17 | ln -sf "$REPO_NAME.files.tar.xz" "$LOCAL_PATH/$REPO_NAME.files" 18 | 19 | repo-remove "$LOCAL_PATH/$REPO_NAME.db.tar.xz" "$@" 20 | s3cmd sync --follow-symlinks --acl-public "$LOCAL_PATH/$REPO_NAME".{db,files}{,.tar.xz} "$REMOTE_PATH/" 21 | for package in "$@"; do 22 | s3cmd rm "$REMOTE_PATH/$package-*.pkg.tar.zst" 23 | done 24 | -------------------------------------------------------------------------------- /bin/sync: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Wraps aursync command to mount an amazon s3 bucket which contains a repository 3 | set -uo pipefail 4 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 5 | 6 | REMOTE_PATH=s3://mdaffin-arch/repo/x86_64 7 | LOCAL_PATH=$HOME/.local/share/arch-repo 8 | REPO_NAME=mdaffin 9 | CHROOT="$HOME/.local/share/arch-root" 10 | 11 | mkdir -p "$LOCAL_PATH" 12 | 13 | ## Sync remote DB to local ## 14 | aws s3 cp "$REMOTE_PATH/$REPO_NAME".db.tar.xz "$LOCAL_PATH/" 15 | aws s3 cp "$REMOTE_PATH/$REPO_NAME".files.tar.xz "$LOCAL_PATH/" 16 | ln -sf "$REPO_NAME.db.tar.xz" "$LOCAL_PATH/$REPO_NAME.db" 17 | ln -sf "$REPO_NAME.files.tar.xz" "$LOCAL_PATH/$REPO_NAME.files" 18 | 19 | ## Clean up older packages that may or may not have been deleted from the 20 | ## remote so that we do not reupload them 21 | rm -f "$LOCAL_PATH/"*.pkg.tar.zst 22 | 23 | aur sync --database "$REPO_NAME" --root "$LOCAL_PATH" --chroot --directory "$CHROOT" "$@" || true 24 | 25 | ## Sync local DB to remote ## 26 | aws s3 sync --follow-symlinks --acl=public-read \ 27 | "$LOCAL_PATH/" \ 28 | "$REMOTE_PATH/" 29 | -------------------------------------------------------------------------------- /ci/build-aur: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ueo pipefail 3 | # shellcheck disable=SC2154 4 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 5 | IFS=$'\n\t' 6 | 7 | PACKAGE=${1:?} 8 | VERSION=${2:?} 9 | shift 2 10 | 11 | aur_version=$(curl -SsfL "https://aur.archlinux.org/rpc/?v=5&type=info&arg[]=${PACKAGE}" | jq -r ".results[0].Version") 12 | if [[ "$VERSION" == "$aur_version" ]]; then 13 | echo "$PACKAGE up to date at $aur_version, nothing to do" 14 | exit 15 | fi 16 | 17 | if [ -n "${1:-}" ]; then 18 | gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys "${@}" 19 | fi 20 | 21 | cat </dev/null 22 | [multilib] 23 | Include = /etc/pacman.d/mirrorlist 24 | [mdaffin] 25 | SigLevel = Optional TrustAll 26 | Server = https://s3.eu-west-2.amazonaws.com/mdaffin-arch/repo/x86_64 27 | EOF 28 | 29 | mkdir -p pkg 30 | curl -SsfL -o "pkg/${PACKAGE}.tar.gz" "https://aur.archlinux.org/cgit/aur.git/snapshot/${PACKAGE}.tar.gz" 31 | tar -C pkg -xf "pkg/${PACKAGE}.tar.gz" 32 | cd "pkg/${PACKAGE}" 33 | sudo pacman --noconfirm --noprogressbar --needed -Syu 34 | makepkg --syncdeps --noconfirm --noprogressbar 35 | mv *.pkg.tar.* .. 36 | -------------------------------------------------------------------------------- /ci/build-local: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ueo pipefail 3 | # shellcheck disable=SC2154 4 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 5 | IFS=$'\n\t' 6 | 7 | PACKAGE=${1:?} 8 | shift 9 | 10 | if [ -n "${1:-}" ]; then 11 | gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys "${@}" 12 | fi 13 | 14 | pkg_dir="$PWD/pkg/" 15 | 16 | cat </dev/null 17 | [multilib] 18 | Include = /etc/pacman.d/mirrorlist 19 | [mdaffin] 20 | SigLevel = Optional TrustAll 21 | Server = https://s3.eu-west-2.amazonaws.com/mdaffin-arch/repo/x86_64 22 | EOF 23 | 24 | cd "${PACKAGE}" 25 | sudo pacman --noconfirm --noprogressbar --needed -Syu 26 | makepkg --syncdeps --noconfirm --noprogressbar 27 | mv *.pkg.tar.* "${pkg_dir}" 28 | -------------------------------------------------------------------------------- /ci/builder/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM archlinux 2 | 3 | RUN pacman -Syu --noconfirm --noprogressbar --needed \ 4 | base-devel \ 5 | aws-cli \ 6 | jq \ 7 | && pacman --noconfirm -Sc 8 | 9 | RUN useradd --create-home --user-group --shell /bin/bash builder 10 | RUN echo "builder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/builder 11 | USER builder:builder 12 | -------------------------------------------------------------------------------- /ci/generate-ci-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | generate_aur_stage() { 4 | cat </dev/null; then 13 | echo "No package files found in pkg, nothing to do" 14 | exit 15 | fi 16 | 17 | aws s3 cp "${REMOTE_PATH}/${REPO_NAME}.db.tar.xz" pkg/ || true 18 | aws s3 cp "${REMOTE_PATH}/${REPO_NAME}.files.tar.xz" pkg/ || true 19 | 20 | repo-add "pkg/${REPO_NAME}.db.tar.xz" pkg/*.pkg.tar.* 21 | rm -f pkg/*.old 22 | 23 | aws s3 cp \ 24 | --follow-symlinks \ 25 | --acl=public-read-write \ 26 | --recursive \ 27 | "pkg/" "$REMOTE_PATH/" 28 | -------------------------------------------------------------------------------- /installer/install-arch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # WARNING: this script will destroy data on the selected disk. 3 | # This script can be run by executing the following: 4 | # curl -sL https://git.io/vAoV8 | bash 5 | set -uo pipefail 6 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 7 | 8 | REPO_URL="https://s3.eu-west-2.amazonaws.com/mdaffin-arch/repo/x86_64" 9 | MIRRORLIST_URL="https://archlinux.org/mirrorlist/?country=GB&protocol=https&use_mirror_status=on" 10 | 11 | pacman -Sy --noconfirm pacman-contrib dialog 12 | 13 | echo "Updating mirror list" 14 | curl -s "$MIRRORLIST_URL" | \ 15 | sed -e 's/^#Server/Server/' -e '/^#/d' | \ 16 | rankmirrors -n 5 - > /etc/pacman.d/mirrorlist 17 | 18 | ### Get infomation from user ### 19 | hostname=$(dialog --stdout --inputbox "Enter hostname" 0 0) || exit 1 20 | clear 21 | : ${hostname:?"hostname cannot be empty"} 22 | 23 | user=$(dialog --stdout --inputbox "Enter admin username" 0 0) || exit 1 24 | clear 25 | : ${user:?"user cannot be empty"} 26 | 27 | password=$(dialog --stdout --passwordbox "Enter admin password" 0 0) || exit 1 28 | clear 29 | : ${password:?"password cannot be empty"} 30 | password2=$(dialog --stdout --passwordbox "Enter admin password again" 0 0) || exit 1 31 | clear 32 | [[ "$password" == "$password2" ]] || ( echo "Passwords did not match"; exit 1; ) 33 | 34 | devicelist=$(lsblk -dplnx size -o name,size | grep -Ev "boot|rpmb|loop" | tac) 35 | device=$(dialog --stdout --menu "Select installtion disk" 0 0 0 ${devicelist}) || exit 1 36 | clear 37 | 38 | ### Set up logging ### 39 | exec 1> >(tee "stdout.log") 40 | exec 2> >(tee "stderr.log") 41 | 42 | timedatectl set-ntp true 43 | 44 | ### Setup the disk and partitions ### 45 | swap_size=$(free --mebi | awk '/Mem:/ {print $2}') 46 | swap_end=$(( $swap_size + 129 + 1 ))MiB 47 | 48 | parted --script "${device}" -- mklabel gpt \ 49 | mkpart ESP fat32 1Mib 129MiB \ 50 | set 1 boot on \ 51 | mkpart primary linux-swap 129MiB ${swap_end} \ 52 | mkpart primary ext4 ${swap_end} 100% 53 | 54 | # Simple globbing was not enough as on one device I needed to match /dev/mmcblk0p1 55 | # but not /dev/mmcblk0boot1 while being able to match /dev/sda1 on other devices. 56 | part_boot="$(ls ${device}* | grep -E "^${device}p?1$")" 57 | part_swap="$(ls ${device}* | grep -E "^${device}p?2$")" 58 | part_root="$(ls ${device}* | grep -E "^${device}p?3$")" 59 | 60 | wipefs "${part_boot}" 61 | wipefs "${part_swap}" 62 | wipefs "${part_root}" 63 | 64 | mkfs.vfat -F32 "${part_boot}" 65 | mkswap "${part_swap}" 66 | mkfs.f2fs -f "${part_root}" 67 | 68 | swapon "${part_swap}" 69 | mount "${part_root}" /mnt 70 | mkdir /mnt/boot 71 | mount "${part_boot}" /mnt/boot 72 | 73 | ### Install and configure the basic system ### 74 | cat >>/etc/pacman.conf <> /mnt/etc/fstab 82 | echo "${hostname}" > /mnt/etc/hostname 83 | 84 | cat >>/mnt/etc/pacman.conf < /mnt/boot/loader/loader.conf 93 | default arch 94 | EOF 95 | 96 | cat < /mnt/boot/loader/entries/arch.conf 97 | title Arch Linux 98 | linux /vmlinuz-linux 99 | initrd /intel-ucode.img 100 | initrd /initramfs-linux.img 101 | options root=PARTUUID=$(blkid -s PARTUUID -o value "$part_root") rw 102 | EOF 103 | 104 | echo "LANG=en_GB.UTF-8" > /mnt/etc/locale.conf 105 | 106 | arch-chroot /mnt useradd -mU -s /usr/bin/zsh -G wheel,uucp,video,audio,storage,games,input "$user" 107 | arch-chroot /mnt chsh -s /usr/bin/zsh 108 | 109 | echo "$user:$password" | chpasswd --root /mnt 110 | echo "root:$password" | chpasswd --root /mnt 111 | -------------------------------------------------------------------------------- /installer/install-router: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # WARNING: this script will destroy data on the selected disk. 3 | # This script can be run by executing the following: 4 | # curl -sL https://git.io/fjF7V | bash 5 | set -uo pipefail 6 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 7 | 8 | REPO_URL="https://s3.eu-west-2.amazonaws.com/mdaffin-arch/repo/x86_64" 9 | MIRRORLIST_URL="https://archlinux.org/mirrorlist/?country=GB&protocol=https&use_mirror_status=on" 10 | 11 | pacman -Sy --noconfirm pacman-contrib 12 | 13 | echo "Updating mirror list" 14 | curl -s "$MIRRORLIST_URL" | \ 15 | sed -e 's/^#Server/Server/' -e '/^#/d' | \ 16 | rankmirrors -n 5 - > /etc/pacman.d/mirrorlist 17 | 18 | ### Get infomation from user ### 19 | hostname=$(dialog --stdout --inputbox "Enter hostname" 0 0) || exit 1 20 | clear 21 | : ${hostname:?"hostname cannot be empty"} 22 | 23 | user=$(dialog --stdout --inputbox "Enter admin username" 0 0) || exit 1 24 | clear 25 | : ${user:?"user cannot be empty"} 26 | 27 | password=$(dialog --stdout --passwordbox "Enter admin password" 0 0) || exit 1 28 | clear 29 | : ${password:?"password cannot be empty"} 30 | password2=$(dialog --stdout --passwordbox "Enter admin password again" 0 0) || exit 1 31 | clear 32 | [[ "$password" == "$password2" ]] || ( echo "Passwords did not match"; exit 1; ) 33 | 34 | devicelist=$(lsblk -dplnx size -o name,size | grep -Ev "boot|rpmb|loop" | tac) 35 | device=$(dialog --stdout --menu "Select installtion disk" 0 0 0 ${devicelist}) || exit 1 36 | clear 37 | 38 | interfacelist=$(ls -1d /sys/class/net/en* | sed 's/$/ ./') 39 | waninterface=$(dialog --stdout --menu "Select wan interface" 0 0 0 ${interfacelist}) || exit 1 40 | wanmac=$(cat ${waninterface}/address) 41 | clear 42 | 43 | interfacelist=$(ls -1d /sys/class/net/en* | grep -v "^${waninterface}$" | sed 's/$/ ./') 44 | laninterface=$(dialog --stdout --menu "Select lan interface" 0 0 0 ${interfacelist}) || exit 1 45 | lanmac=$(cat ${laninterface}/address) 46 | clear 47 | 48 | isp_user=$(dialog --stdout --inputbox "Enter IPS username" 0 0) || exit 1 49 | clear 50 | : ${isp_user:?"isp_user cannot be empty"} 51 | 52 | isp_password=$(dialog --stdout --inputbox "Enter IPS password" 0 0) || exit 1 53 | clear 54 | : ${isp_password:?"isp_password cannot be empty"} 55 | 56 | ### Set up logging ### 57 | exec 1> >(tee "stdout.log") 58 | exec 2> >(tee "stderr.log") 59 | 60 | timedatectl set-ntp true 61 | 62 | ### Setup the disk and partitions ### 63 | swap_size=$(free --mebi | awk '/Mem:/ {print $2}') 64 | swap_end=$(( $swap_size + 129 + 1 ))MiB 65 | 66 | parted --script "${device}" -- mklabel gpt \ 67 | mkpart ESP fat32 1Mib 129MiB \ 68 | set 1 boot on \ 69 | mkpart primary linux-swap 129MiB ${swap_end} \ 70 | mkpart primary ext4 ${swap_end} 100% 71 | 72 | # Simple globbing was not enough as on one device I needed to match /dev/mmcblk0p1 73 | # but not /dev/mmcblk0boot1 while being able to match /dev/sda1 on other devices. 74 | part_boot="$(ls ${device}* | grep -E "^${device}p?1$")" 75 | part_swap="$(ls ${device}* | grep -E "^${device}p?2$")" 76 | part_root="$(ls ${device}* | grep -E "^${device}p?3$")" 77 | 78 | wipefs "${part_boot}" 79 | wipefs "${part_swap}" 80 | wipefs "${part_root}" 81 | 82 | mkfs.vfat -F32 "${part_boot}" 83 | mkswap "${part_swap}" 84 | mkfs.f2fs -f "${part_root}" 85 | 86 | swapon "${part_swap}" 87 | mount "${part_root}" /mnt 88 | mkdir /mnt/boot 89 | mount "${part_boot}" /mnt/boot 90 | 91 | ### Install and configure the basic system ### 92 | cat >>/etc/pacman.conf <> /mnt/etc/fstab 100 | echo "${hostname}" > /mnt/etc/hostname 101 | 102 | cat >>/mnt/etc/pacman.conf < /mnt/boot/loader/loader.conf 111 | default arch 112 | EOF 113 | 114 | cat < /mnt/boot/loader/entries/arch.conf 115 | title Arch Linux 116 | linux /vmlinuz-linux 117 | initrd /initramfs-linux.img 118 | options root=PARTUUID=$(blkid -s PARTUUID -o value "$part_root") rw 119 | EOF 120 | 121 | cat < /mnt/etc/systemd/network/10-wan0.link 122 | [Match] 123 | MACAddress=${wanmac} 124 | 125 | [Link] 126 | Description=First wide area network interface 127 | Name=wan0 128 | EOF 129 | 130 | cat < /mnt/etc/systemd/network/10-lan0.link 131 | [Match] 132 | MACAddress=${lanmac} 133 | 134 | [Link] 135 | Description=First local area network interface 136 | Name=lan0 137 | EOF 138 | 139 | cat < /mnt/etc/ppp/peers/wan0 140 | plugin rp-pppoe.so 141 | wan0 142 | name "${isp_user}" 143 | #usepeerdns 144 | presist 145 | defaultroute 146 | hide-password 147 | noauth 148 | EOF 149 | 150 | cat < /mnt/etc/ppp/chap-secrets 151 | ${isp_user} * ${isp_password} 152 | EOF 153 | 154 | echo "LANG=en_GB.UTF-8" > /mnt/etc/locale.conf 155 | 156 | arch-chroot /mnt useradd -mU -s /usr/bin/zsh -G wheel,uucp,video,audio,storage,games,input "$user" 157 | arch-chroot /mnt chsh -s /usr/bin/zsh 158 | 159 | echo "$user:$password" | chpasswd --root /mnt 160 | echo "root:$password" | chpasswd --root /mnt 161 | -------------------------------------------------------------------------------- /pacman.conf: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/pacman.conf 3 | # 4 | # See the pacman.conf(5) manpage for option and repository directives 5 | 6 | # 7 | # GENERAL OPTIONS 8 | # 9 | [options] 10 | # The following paths are commented out with their default values listed. 11 | # If you wish to use different paths, uncomment and update the paths. 12 | #RootDir = / 13 | #DBPath = /var/lib/pacman/ 14 | #CacheDir = /var/cache/pacman/pkg/ 15 | #LogFile = /var/log/pacman.log 16 | #GPGDir = /etc/pacman.d/gnupg/ 17 | #HookDir = /etc/pacman.d/hooks/ 18 | HoldPkg = pacman glibc 19 | #XferCommand = /usr/bin/curl -C - -f %u > %o 20 | #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u 21 | #CleanMethod = KeepInstalled 22 | #UseDelta = 0.7 23 | Architecture = auto 24 | 25 | # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup 26 | #IgnorePkg = 27 | #IgnoreGroup = 28 | 29 | #NoUpgrade = 30 | #NoExtract = 31 | 32 | # Misc options 33 | #UseSyslog 34 | #Color 35 | #TotalDownload 36 | CheckSpace 37 | #VerbosePkgLists 38 | 39 | # By default, pacman accepts packages signed by keys that its local keyring 40 | # trusts (see pacman-key and its man page), as well as unsigned packages. 41 | SigLevel = Required DatabaseOptional 42 | LocalFileSigLevel = Optional 43 | #RemoteFileSigLevel = Required 44 | 45 | # NOTE: You must run `pacman-key --init` before first using pacman; the local 46 | # keyring can then be populated with the keys of all official Arch Linux 47 | # packagers with `pacman-key --populate archlinux`. 48 | 49 | # 50 | # REPOSITORIES 51 | # - can be defined here or included from another file 52 | # - pacman will search repositories in the order defined here 53 | # - local/custom mirrors can be added here or in separate files 54 | # - repositories listed first will take precedence when packages 55 | # have identical names, regardless of version number 56 | # - URLs will have $repo replaced by the name of the current repo 57 | # - URLs will have $arch replaced by the name of the architecture 58 | # 59 | # Repository entries are of the format: 60 | # [repo-name] 61 | # Server = ServerName 62 | # Include = IncludePath 63 | # 64 | # The header [repo-name] is crucial - it must be present and 65 | # uncommented to enable the repo. 66 | # 67 | 68 | # The testing repositories are disabled by default. To enable, uncomment the 69 | # repo name header and Include lines. You can add preferred servers immediately 70 | # after the header, and they will be used before the default mirrors. 71 | 72 | #[testing] 73 | #Include = /etc/pacman.d/mirrorlist 74 | 75 | [core] 76 | Include = /etc/pacman.d/mirrorlist 77 | 78 | [extra] 79 | Include = /etc/pacman.d/mirrorlist 80 | 81 | #[community-testing] 82 | #Include = /etc/pacman.d/mirrorlist 83 | 84 | [community] 85 | Include = /etc/pacman.d/mirrorlist 86 | 87 | # If you want to run 32 bit applications on your x86_64 system, 88 | # enable the multilib repositories as required here. 89 | 90 | #[multilib-testing] 91 | #Include = /etc/pacman.d/mirrorlist 92 | 93 | #[multilib] 94 | #Include = /etc/pacman.d/mirrorlist 95 | 96 | # An example of a custom package repository. See the pacman manpage for 97 | # tips on creating your own repositories. 98 | #[custom] 99 | #SigLevel = Optional TrustAll 100 | #Server = file:///home/custompkgs 101 | 102 | [mdaffin] 103 | SigLevel = Optional TrustAll 104 | Server = https://s3.eu-west-2.amazonaws.com/mdaffin-arch/repo/x86_64 105 | -------------------------------------------------------------------------------- /pkg/mdaffin/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Daffin 2 | pkgbase=mdaffin 3 | pkgname=(mdaffin-base mdaffin-desktop mdaffin-neovim mdaffin-laptop mdaffin-dell-xps-13) 4 | pkgver=50 5 | pkgrel=1 6 | pkgdesc="System config for mdaffin systems" 7 | arch=(any) 8 | url="https://github.com/mdaffin/arch-repo" 9 | license=(MIT) 10 | groups=(mdaffin) 11 | 12 | rootdir=$PWD 13 | 14 | package_mdaffin-base() { 15 | provides=(mdaffin-devel) 16 | conflicts=(mdaffin-devel) 17 | replaces=(mdaffin-devel) 18 | install=mdaffin-base.install 19 | 20 | # Base packages 21 | depends=(base linux linux-firmware man-db man-pages texinfo intel-ucode) 22 | 23 | # Base Devel 24 | depends+=( 25 | autoconf automake binutils bison fakeroot file findutils flex gawk gcc 26 | gettext grep groff gzip libtool m4 make pacman patch pkgconf sed sudo 27 | texinfo which 28 | ) 29 | 30 | # Extra general packages 31 | depends+=( 32 | ripgrep exa fd wget fzf unzip zip dialog pacman-contrib bat ncdu 33 | keybase efibootmgr pv zsh grml-zsh-config zsh-completions watchexec 34 | ) 35 | 36 | # Debugging tools 37 | depends+=( 38 | lsof bind-tools mtr socat htop iotop openbsd-netcat strace tcpdump whois 39 | iftop dstat 40 | ) 41 | 42 | # Filesystems 43 | depends+=(e2fsprogs exfat-utils dosfstools f2fs-tools) 44 | 45 | # Networking 46 | depends+=(nftables iw iwd avahi nss-mdns openssh) 47 | 48 | # General tools 49 | depends+=(git cmake jq musl ddrescue) 50 | 51 | # Arch Packaging 52 | depends+=(devtools aurutils aws-cli-v2-bin) 53 | 54 | # Docker 55 | depends+=(docker docker-compose dnsmasq rancher-k3d-bin kubectl k9s kind) 56 | 57 | # Automation tools 58 | depends+=(terraform) 59 | 60 | # Languages 61 | depends+=(rustup clang go) 62 | 63 | # Python tools 64 | depends+=(python-black python-pycodestyle python-pylint flake8) 65 | 66 | # Node tools 67 | depends+=(yarn npm nodejs prettier) 68 | 69 | # Text 70 | depends+=(vale) 71 | 72 | cp -a "$rootdir/files-base/"* "$pkgdir" 73 | chmod -R 0750 "$pkgdir/etc/sudoers.d" 74 | } 75 | 76 | package_mdaffin-neovim() { 77 | provides=(vim vi) 78 | conflicts=(vim vi) 79 | replaces=(vim vi) 80 | 81 | depends=(mdaffin-base neovim python-msgpack python-pynvim) 82 | depends+=( 83 | bash-language-server 84 | dockerfile-language-server-bin 85 | gopls 86 | nodejs-svelte-language-server 87 | python-language-server 88 | rust-analyzer 89 | terraform-ls 90 | typescript-language-server-bin 91 | vim-language-server 92 | vscode-css-languageserver-bin 93 | vscode-html-languageserver-bin 94 | vscode-json-languageserver-bin 95 | yaml-language-server 96 | ) 97 | 98 | export DESTDIR=$pkgdir 99 | "$rootdir/add-nvim-plugin" opt neovim/nvim-lspconfig 100 | "$rootdir/add-nvim-plugin" start liuchengxu/vim-which-key 101 | "$rootdir/add-nvim-plugin" start ap/vim-buftabline 102 | "$rootdir/add-nvim-plugin" start ekalinin/Dockerfile.vim 103 | "$rootdir/add-nvim-plugin" start sheerun/vim-polyglot 104 | "$rootdir/add-nvim-plugin" opt dracula/vim dracula 105 | "$rootdir/add-nvim-plugin" opt nvim-lua/lsp_extensions.nvim 106 | "$rootdir/add-nvim-plugin" opt nvim-lua/completion-nvim 107 | "$rootdir/add-nvim-plugin" opt nvim-lua/lsp-status.nvim 108 | "$rootdir/add-nvim-plugin" opt junegunn/fzf.vim 109 | "$rootdir/add-nvim-plugin" start udalov/kotlin-vim 110 | 111 | cp -a "$rootdir/files-neovim/"* "$pkgdir" 112 | } 113 | 114 | package_mdaffin-desktop() { 115 | install=mdaffin-desktop.install 116 | 117 | depends=(mdaffin-base) 118 | 119 | # I3 Desktop 120 | depends+=(i3-wm i3status i3blocks i3lock rofi brightnessctl) 121 | 122 | # Sway 123 | depends+=( 124 | sway swaylock swayidle xorg-server-xwayland wl-clipboard 125 | playerctl swayshot udiskie j4-dmenu-desktop bemenu mako qt5-wayland 126 | ) 127 | 128 | # Login manager 129 | depends+=(sddm rng-tools archlinux-themes-sddm) 130 | 131 | # Applications 132 | depends+=( 133 | alacritty firefox gopass discord slack-desktop signal-desktop nemo 134 | nemo-fileroller nemo-preview 135 | ) 136 | 137 | # Utility 138 | depends+=( 139 | redshift python-gobject bluez bluez-utils blueberry pipewire 140 | pipewire-alsa pipewire-pulse wireplumber helvum pavucontrol paprefs 141 | scrot arandr 142 | ) 143 | 144 | # Drivers and utilities 145 | depends+=( 146 | libinput-gestures xf86-input-libinput xf86-video-vesa vulkan-intel 147 | nvidia nvidia-utils 148 | ) 149 | 150 | # Xorg packages and utilities 151 | depends+=(xorg-xkill xorg-xev xorg-xhost xorg-xrandr xsel) 152 | 153 | # Fonts 154 | depends+=( 155 | noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ttf-monofur 156 | ttf-dejavu xorg-fonts-misc ttf-font-awesome 157 | ) 158 | 159 | optdepends=(krita okular chromium netdata mupdf-gl) 160 | 161 | cp -a "$rootdir/files-desktop/"* "$pkgdir" 162 | } 163 | 164 | package_mdaffin-gaming() { 165 | depends=( 166 | mdaffin-desktop steam nvidia nvidia-utils lib32-nvidia-utils lib32-libpulse 167 | ttf-liberation wqy-zenhei 168 | ) 169 | } 170 | 171 | package_mdaffin-laptop() { 172 | depends=('mdaffin-desktop' 'powertop') 173 | } 174 | 175 | package_mdaffin-dell-xps-13() { 176 | depends=('mdaffin-laptop') 177 | cp -a "$rootdir/files-dell-xps-13/"* "$pkgdir" 178 | } 179 | -------------------------------------------------------------------------------- /pkg/mdaffin/add-nvim-plugin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -uo pipefail 3 | # shellcheck disable=SC2154 4 | trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR 5 | IFS=$'\n\t' 6 | 7 | plugin_type=${1:?missing plugin type [start|opt]} 8 | plugin=${2:?missing plugin} 9 | 10 | plugin_author=${plugin%/*} 11 | plugin_name=${plugin#*/} 12 | plugin_rename=${3:-${plugin_name}} 13 | 14 | plugin_path="$DESTDIR/usr/share/nvim/runtime/pack/plugin/$plugin_type/" 15 | mkdir -p "$plugin_path" 16 | 17 | curl -fSsL https://github.com/${plugin}/archive/master.tar.gz | tar -xz -C "$plugin_path" 18 | mv "$plugin_path/$plugin_name-master" "$plugin_path/$plugin_rename" 19 | rm -rf "$plugin_path/$plugin_rename"/{*test*,*.md,.git} 20 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-base/etc/profile.d/mdaffin-base.sh: -------------------------------------------------------------------------------- 1 | export EDITOR='nvim' 2 | export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" 3 | export PATH=$HOME/.local/bin:$PATH 4 | 5 | alias ls=/usr/bin/exa 6 | 7 | # Node 8 | export PATH=$HOME/.local/share/npm/bin:$HOME/.yarn/bin:$PATH 9 | 10 | # Go 11 | export GOPATH=$HOME/projects/go 12 | export PATH=$GOPATH/bin:$PATH 13 | 14 | # Rust 15 | export PATH=$HOME/.cargo/bin:$PATH 16 | 17 | export FZF_DEFAULT_COMMAND='rg --files' 18 | export FZF_DEFAULT_OPTS='-m --height 50% --border' 19 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-base/etc/sudoers.d/mdaffin-base: -------------------------------------------------------------------------------- 1 | # Managed by mdaffin-base package 2 | # https://github.com/mdaffin/arch-repo/blob/master/pkg/base/sudoers.wheel 3 | 4 | %wheel ALL=(ALL) ALL 5 | Defaults passwd_timeout=0 6 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-base/etc/vconsole.conf: -------------------------------------------------------------------------------- 1 | # Managed by mdaffin-base package 2 | # https://github.com/mdaffin/arch-repo/blob/master/pkg/base/vconsole.conf 3 | 4 | KEYMAP=uk 5 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-base/usr/etc/npmrc: -------------------------------------------------------------------------------- 1 | prefix = "${HOME}/.local/share/npm" 2 | init-license = "MIT" 3 | init-version = "0.0.1" 4 | # https://blog.npmjs.org/post/141702881055/package-install-scripts-vulnerability 5 | ignore-scripts = true 6 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-base/usr/lib/systemd/system/multi-user.target.wants/systemd-timesyncd.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/systemd-timesyncd.service -------------------------------------------------------------------------------- /pkg/mdaffin/files-dell-xps-13/etc/X11/xinit/xinitrc.d/20-hidpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo 'Xft.dpi: 192' | xrdb -override 4 | export QT_AUTO_SCREEN_SCALE_FACTOR=1 5 | export GDK_SCALE=2 6 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-dell-xps-13/etc/X11/xorg.conf.d/90-hidpi-monitor.conf: -------------------------------------------------------------------------------- 1 | Section "Monitor" 2 | Identifier "" 3 | DisplaySize 423 238 4 | EndSection 5 | 6 | Section "Device" 7 | Identifier "Card0" 8 | Driver "intel" 9 | Option "Backlight" "intel_backlight" 10 | Option "DRI" "2" 11 | EndSection 12 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-dell-xps-13/etc/sway/config.d/mdaffin-dell-xps-13.conf: -------------------------------------------------------------------------------- 1 | ### Variables 2 | set $mod Mod4 3 | 4 | set $laptop eDP-1 5 | output $laptop scale 2 6 | output DP-1 pos 640 1800 7 | 8 | bindswitch --reload lid:on output $laptop disable 9 | bindswitch --reload lid:off output $laptop enable 10 | 11 | workspace 1 output eDP-1 12 | workspace 2 output eDP-1 13 | workspace 3 output eDP-1 14 | workspace 4 output eDP-1 15 | workspace 5 output eDP-1 16 | workspace 6 output eDP-1 17 | workspace 7 output eDP-1 18 | workspace 8 output eDP-1 19 | workspace 9 output eDP-1 20 | workspace 10 output eDP-1 21 | 22 | workspace e1 output DP-1 23 | workspace e2 output DP-1 24 | workspace e3 output DP-1 25 | workspace e4 output DP-1 26 | workspace e5 output DP-1 27 | workspace e6 output DP-1 28 | workspace e7 output DP-1 29 | workspace e8 output DP-1 30 | workspace e9 output DP-1 31 | workspace e10 output DP-1 32 | 33 | bindsym $mod+Ctrl+1 workspace e1 34 | bindsym $mod+Ctrl+2 workspace e2 35 | bindsym $mod+Ctrl+3 workspace e3 36 | bindsym $mod+Ctrl+4 workspace e4 37 | bindsym $mod+Ctrl+5 workspace e5 38 | bindsym $mod+Ctrl+6 workspace e6 39 | bindsym $mod+Ctrl+7 workspace e7 40 | bindsym $mod+Ctrl+8 workspace e8 41 | bindsym $mod+Ctrl+9 workspace e9 42 | bindsym $mod+Ctrl+0 workspace e10 43 | 44 | bindsym $mod+Ctrl+Shift+1 move container to workspace e1 45 | bindsym $mod+Ctrl+Shift+2 move container to workspace e2 46 | bindsym $mod+Ctrl+Shift+3 move container to workspace e3 47 | bindsym $mod+Ctrl+Shift+4 move container to workspace e4 48 | bindsym $mod+Ctrl+Shift+5 move container to workspace e5 49 | bindsym $mod+Ctrl+Shift+6 move container to workspace e6 50 | bindsym $mod+Ctrl+Shift+7 move container to workspace e7 51 | bindsym $mod+Ctrl+Shift+8 move container to workspace e8 52 | bindsym $mod+Ctrl+Shift+9 move container to workspace e9 53 | bindsym $mod+Ctrl+Shift+0 move container to workspace e10 54 | 55 | bindsym $mod+c workspace comms 56 | bindsym $mod+Shift+c move container to workspace comms 57 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/etc/rofi.conf: -------------------------------------------------------------------------------- 1 | configuration { 2 | theme: "glue_pro_blue"; 3 | } 4 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/etc/skel/.config/alacritty/alacritty.yml: -------------------------------------------------------------------------------- 1 | /usr/share/alacritty/alacritty.yml -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/etc/sway/config.d/mdaffin.conf: -------------------------------------------------------------------------------- 1 | ### Variables 2 | set $mod Mod4 3 | 4 | set $term alacritty 5 | set $browser firefox -P default --browser 6 | set $menu j4-dmenu-desktop --dmenu='bemenu -i --nb "#3f3f3f" --nf "#dcdccc" --fn "pango:DejaVu Sans Mono 12"' --term='alacritty' 7 | 8 | ### Output configuration 9 | input type:touchpad { 10 | tap disabled 11 | natural_scroll enabled 12 | dwt enabled 13 | click_method clickfinger 14 | } 15 | 16 | ### Input configuration 17 | input * { 18 | xkb_layout "gb" 19 | xkb_options caps:escape 20 | } 21 | 22 | ### Idle configuration 23 | exec swayidle -w \ 24 | timeout 600 'swaylock -f -c 000000' \ 25 | before-sleep 'swaylock -f -c 000000' 26 | 27 | # Configure border style 28 | default_border pixel 2 29 | default_floating_border pixel 2 30 | hide_edge_borders both 31 | titlebar_border_thickness 0 32 | titlebar_padding 2 1 33 | 34 | # Auto start applications 35 | exec --no-startup-id /usr/bin/libinput-gestures-setup start 36 | exec --no-startup-id firefox -P default 37 | exec --no-startup-id mako 38 | exec --no-startup-id udiskie 39 | 40 | # Font for window titles. 41 | font pango:DejaVu Sans Mono 8 42 | 43 | # use Mouse+$mod to drag floating windows to their wanted position 44 | floating_modifier $mod 45 | # floating_modifier $mod normal 46 | 47 | ### Key bindings 48 | # Common Applications 49 | bindsym $mod+Return exec $term 50 | bindsym $mod+Shift+Return exec $browser 51 | bindsym $mod+d exec $menu 52 | 53 | # Kill focused window 54 | bindsym $mod+Shift+q kill 55 | 56 | # Media Keys 57 | bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% 58 | bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% 59 | bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle 60 | bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle 61 | bindsym XF86MonBrightnessDown exec brightnessctl set 5%- 62 | bindsym XF86MonBrightnessUp exec brightnessctl set +5% 63 | bindsym XF86AudioPlay exec playerctl play-pause 64 | bindsym XF86AudioNext exec playerctl next 65 | bindsym XF86AudioPrev exec playerctl previous 66 | 67 | # lock the screen 68 | bindsym $mod+l exec swaylock -d -c 000000 69 | 70 | ### Moving around 71 | focus_wrapping no 72 | 73 | # Move your focus around 74 | bindsym $mod+Left focus left 75 | bindsym $mod+Down focus down 76 | bindsym $mod+Up focus up 77 | bindsym $mod+Right focus right 78 | 79 | # Move the focused window with the same, but add Shift 80 | bindsym $mod+Shift+Left move left 81 | bindsym $mod+Shift+Down move down 82 | bindsym $mod+Shift+Up move up 83 | bindsym $mod+Shift+Right move right 84 | 85 | ### Workspaces 86 | # Switch to workspace 87 | bindsym $mod+1 workspace 1 88 | bindsym $mod+2 workspace 2 89 | bindsym $mod+3 workspace 3 90 | bindsym $mod+4 workspace 4 91 | bindsym $mod+5 workspace 5 92 | bindsym $mod+6 workspace 6 93 | bindsym $mod+7 workspace 7 94 | bindsym $mod+8 workspace 8 95 | bindsym $mod+9 workspace 9 96 | bindsym $mod+0 workspace 10 97 | 98 | # Move focused container to workspace 99 | bindsym $mod+Shift+1 move container to workspace 1 100 | bindsym $mod+Shift+2 move container to workspace 2 101 | bindsym $mod+Shift+3 move container to workspace 3 102 | bindsym $mod+Shift+4 move container to workspace 4 103 | bindsym $mod+Shift+5 move container to workspace 5 104 | bindsym $mod+Shift+6 move container to workspace 6 105 | bindsym $mod+Shift+7 move container to workspace 7 106 | bindsym $mod+Shift+8 move container to workspace 8 107 | bindsym $mod+Shift+9 move container to workspace 9 108 | bindsym $mod+Shift+0 move container to workspace 10 109 | 110 | bindsym $mod+Ctrl+Right workspace next 111 | bindsym $mod+Ctrl+Left workspace prev 112 | 113 | bindsym $mod+Ctrl+Shift+Right move workspace to output right 114 | bindsym $mod+Ctrl+Shift+Left move workspace to output left 115 | 116 | ### Container managment 117 | bindsym $mod+h splith 118 | bindsym $mod+v splitv 119 | bindsym $mod+f fullscreen toggle 120 | bindsym $mod+s layout stacking 121 | bindsym $mod+w layout tabbed 122 | bindsym $mod+e layout toggle split 123 | bindsym $mod+Shift+space floating toggle 124 | bindsym $mod+space focus mode_toggle 125 | bindsym $mod+Tab focus parent 126 | bindsym $mod+Shift+Tab focus child 127 | 128 | ### Scratchpad 129 | bindsym $mod+Shift+minus move scratchpad 130 | bindsym $mod+minus scratchpad show 131 | 132 | ### Resizing containers: 133 | bindsym $mod+Mod1+Left resize shrink width 5 px or 5 ppt 134 | bindsym $mod+Mod1+Down resize grow height 5 px or 5 ppt 135 | bindsym $mod+Mod1+Up resize shrink height 5 px or 5 ppt 136 | bindsym $mod+Mod1+Right resize grow width 5 px or 5 ppt 137 | 138 | bindsym $mod+Mod1+Shift+Left resize shrink width 1 px or 1 ppt 139 | bindsym $mod+Mod1+Shift+Down resize grow height 1 px or 1 ppt 140 | bindsym $mod+Mod1+Shift+Up resize shrink height 1 px or 1 ppt 141 | bindsym $mod+Mod1+Shift+Right resize grow width 1 px or 1 ppt 142 | 143 | mode "resize" { 144 | bindsym Left resize shrink width 5 px or 5 ppt 145 | bindsym Down resize grow height 5 px or 5 ppt 146 | bindsym Up resize shrink height 5 px or 5 ppt 147 | bindsym Right resize grow width 5 px or 5 ppt 148 | 149 | bindsym Shift+Left resize shrink width 1 px or 1 ppt 150 | bindsym Shift+Down resize grow height 1 px or 1 ppt 151 | bindsym Shift+Up resize shrink height 1 px or 1 ppt 152 | bindsym Shift+Right resize grow width 1 px or 1 ppt 153 | 154 | # back to normal: Enter or Escape 155 | bindsym Return mode "default" 156 | bindsym Escape mode "default" 157 | } 158 | 159 | bindsym $mod+r mode "resize" 160 | 161 | set $mode_system System: (l) lock, (e) logout, (s) suspend, (r) reboot, (S) shutdown, (R) UEFI, (c) reload 162 | mode "$mode_system" { 163 | bindsym l exec $lock, mode "default" 164 | bindsym e exit 165 | bindsym s exec --no-startup-id systemctl suspend, mode "default" 166 | bindsym r exec --no-startup-id systemctl reboot, mode "default" 167 | bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default" 168 | bindsym Shift+r exec --no-startup-id systemctl reboot --firmware-setup, mode "default" 169 | bindsym c reload 170 | 171 | # return to default mode 172 | bindsym Return mode "default" 173 | bindsym Escape mode "default" 174 | } 175 | bindsym $mod+Shift+e mode "$mode_system" 176 | 177 | exec waybar --config /etc/xdg/waybar/mdaffin-config --style /etc/xdg/waybar/mdaffin-style.css 178 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/etc/xdg/waybar/mdaffin-config: -------------------------------------------------------------------------------- 1 | { 2 | "layer": "bottom", 3 | "modules-left": ["sway/workspaces", "sway/mode"], 4 | "modules-center": ["sway/window"], 5 | "modules-right": [ 6 | "cpu", 7 | "memory", 8 | "battery", 9 | "backlight", 10 | "pulseaudio", 11 | "network", 12 | "idle_inhibitor", 13 | "tray", 14 | "clock" 15 | ], 16 | "sway/workspaces": { 17 | "format": "{name}", 18 | "disable-scroll": true, 19 | "all-outputs": false 20 | }, 21 | "sway/mode": { 22 | "format": "{}", 23 | "max-length": 20 24 | }, 25 | "sway/window": { 26 | "max-length": 80, 27 | "tooltip": false 28 | }, 29 | "tray": { 30 | "spacing": 10, 31 | "icon-size": 12 32 | }, 33 | "clock": { 34 | "format": " {:%a %d %b %H:%M}", 35 | "tooltip": false 36 | }, 37 | "cpu": { 38 | "format": " {usage}%" 39 | }, 40 | "memory": { 41 | "format": " {}%" 42 | }, 43 | "battery": { 44 | "format": "{icon} {capacity}%", 45 | "format-alt": "{icon} {time}", 46 | "format-alt-click": "click-right", 47 | "format-charging": " {capacity}%", 48 | "format-icons": ["", "", "", "", ""], 49 | "interval": 30, 50 | "states": { 51 | "warning": 15, 52 | "critical": 5 53 | }, 54 | "tooltip": false 55 | }, 56 | "network": { 57 | "format-wifi": " {essid} ({signalStrength}%)", 58 | "format-ethernet": "  {ifname}: {ipaddr}/{cidr} ", 59 | "format-disconnected": "⚠ Disconnected ", 60 | "on-click-right": "alacritty -e iwctl", 61 | "tooltip": false 62 | }, 63 | "pulseaudio": { 64 | "format": " {icon} {volume}%", 65 | "format-bluetooth": "{icon} {volume}%", 66 | "format-muted": "", 67 | "format-icons": { 68 | "headphones": "", 69 | "handsfree": "", 70 | "headset": "", 71 | "phone": "", 72 | "portable": "", 73 | "car": "", 74 | "default": ["", "", ""] 75 | }, 76 | "scroll-step": 1, 77 | "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", 78 | "on-click-right": "pavucontrol", 79 | "tooltip": false 80 | }, 81 | "backlight": { 82 | "format": "{icon} {percent}%", 83 | "format-alt-click": "click-right", 84 | "format-icons": "", 85 | "on-scroll-down": "brightnessctl set 1%-", 86 | "on-scroll-up": "brightnessctl set +1%" 87 | }, 88 | "idle_inhibitor": { 89 | "format": "{icon}", 90 | "format-icons": { 91 | "activated": "", 92 | "deactivated": "" 93 | }, 94 | "tooltip": false 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/etc/xdg/waybar/mdaffin-style.css: -------------------------------------------------------------------------------- 1 | * { 2 | border: none; 3 | border-radius: 0; 4 | font-family: Sans; 5 | font-size: 10px; 6 | box-shadow: none; 7 | text-shadow: none; 8 | min-height: 0; 9 | transition-duration: 0s; 10 | } 11 | 12 | window { 13 | color: rgba(217, 216, 216, 1); 14 | background: rgba(35, 31, 32, 1); 15 | } 16 | 17 | #workspaces { 18 | margin: 0; 19 | } 20 | 21 | #workspaces button { 22 | padding: 0 5px; 23 | color: rgba(217, 216, 216, 0.4); 24 | } 25 | 26 | #workspaces button.visible { 27 | color: rgba(217, 216, 216, 1); 28 | } 29 | 30 | #workspaces button.focused { 31 | border-top: 3px solid rgba(217, 216, 216, 1); 32 | border-bottom: 3px solid rgba(217, 216, 216, 0); 33 | } 34 | 35 | #workspaces button.urgent { 36 | color: rgba(238, 46, 36, 1); 37 | } 38 | 39 | #tray, 40 | #clock, 41 | #mode, 42 | #battery, 43 | #cpu, 44 | #memory, 45 | #network, 46 | #pulseaudio, 47 | #idle_inhibitor, 48 | #backlight { 49 | margin: 0px 8px 0px 8px; 50 | } 51 | 52 | #clock { 53 | margin: 0px 4px 0px 8px; 54 | } 55 | 56 | #battery.warning { 57 | color: rgba(255, 210, 4, 1); 58 | } 59 | 60 | #battery.critical { 61 | color: rgba(238, 46, 36, 1); 62 | } 63 | 64 | #battery.charging { 65 | color: rgba(217, 216, 216, 1); 66 | } 67 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/sddm/sddm.conf.d/z-mdaffin.conf: -------------------------------------------------------------------------------- 1 | [Theme] 2 | # Current theme name 3 | Current=archlinux-soft-grey 4 | 5 | [Wayland] 6 | # Enable Qt's automatic high-DPI scaling 7 | EnableHiDPI=true 8 | 9 | [X11] 10 | # Enable Qt's automatic high-DPI scaling 11 | EnableHiDPI=true 12 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/systemd/network/90-mdaffin-base-enp.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=enp* 3 | 4 | [Network] 5 | DHCP=ipv4 6 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/systemd/network/90-mdaffin-base-wlp.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=wlp* 3 | 4 | [Network] 5 | DHCP=ipv4 6 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/systemd/system/multi-user.target.wants/avahi-daemon.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/avahi-daemon.service -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/systemd/system/multi-user.target.wants/rngd.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/rngd.service -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/systemd/system/multi-user.target.wants/sddm.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/sddm.service -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/systemd/system/multi-user.target.wants/systemd-networkd.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/systemd-networkd.service -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/lib/systemd/system/multi-user.target.wants/systemd-resolved.service: -------------------------------------------------------------------------------- 1 | /usr/lib/systemd/system/systemd-resolved.service -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/share/X11/xinit/xinitrc.d/30-mdaffin-desktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export MOZ_USE_XINPUT2=1 4 | 5 | xrdb -override <=' 12 | save_to_clipboard: false 13 | 14 | key_bindings: 15 | - { key: Return, mods: Control|Shift, action: SpawnNewInstance } 16 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/share/mdaffin/etc/i3/config: -------------------------------------------------------------------------------- 1 | # i3 config file (v4) 2 | # 3 | # Please see https://i3wm.org/docs/userguide.html for a complete reference! 4 | # 5 | # This config file uses keycodes (bindsym) and was written for the QWERTY 6 | # layout. 7 | # 8 | # To get a config file with the same key positions, but for your current 9 | # layout, use the i3-config-wizard 10 | # 11 | 12 | set $mod Mod4 13 | 14 | # Configure border style 15 | new_window pixel 2 16 | new_float pixel 2 17 | hide_edge_borders none 18 | 19 | # setup monitors if available 20 | exec --no-startup-id $HOME/.screenlayout/default.sh 21 | 22 | # support touchpad gestures 23 | exec --no-startup-id /usr/bin/libinput-gestures-setup start 24 | 25 | # set the background colour 26 | exec --no-startup-id xsetroot -solid "#222222" 27 | 28 | # bluetooth applet 29 | exec --no-startup-id blueberry-tray 30 | 31 | # General applications 32 | exec --no-startup-id redshift-gtk 33 | #exec --no-startup-id steam 34 | #exec --no-startup-id firefox -P default 35 | 36 | # Font for window titles. Will also be used by the bar unless a different font 37 | # is used in the bar {} block below. 38 | #font pango:DejaVu Sans Mono 8 39 | font xft:Monofur Regular 11 40 | 41 | # use Mouse+$mod to drag floating windows to their wanted position 42 | floating_modifier $mod 43 | 44 | # start a terminal 45 | bindsym $mod+Return exec i3-sensible-terminal 46 | 47 | # start a new browser 48 | bindsym $mod+Shift+Return exec firefox -P default --browser 49 | 50 | # kill focused window 51 | bindsym $mod+Shift+q kill 52 | 53 | # Pulse Audio controls 54 | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% 55 | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% 56 | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle 57 | 58 | # Player controls 59 | bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause 60 | bindsym XF86AudioPrev exec --no-startup-id playerctl previous 61 | bindsym XF86AudioNext exec --no-startup-id playerctl next 62 | 63 | # Sreen brightness controls 64 | bindsym XF86MonBrightnessUp exec xbacklight -inc 10 65 | bindsym XF86MonBrightnessDown exec xbacklight -dec 10 66 | 67 | # start program launcher 68 | bindsym $mod+d exec --no-startup-id rofi -show run 69 | 70 | # lock the screen 71 | bindsym $mod+l exec --no-startup-id i3lock -c 222222 72 | 73 | # xkill 74 | bindsym $mod+Ctrl+x --release exec --no-startup-id xkill 75 | 76 | # change focus 77 | bindsym $mod+Left focus left 78 | bindsym $mod+Down focus down 79 | bindsym $mod+Up focus up 80 | bindsym $mod+Right focus right 81 | 82 | # move focused window 83 | bindsym $mod+Shift+Left move left 84 | bindsym $mod+Shift+Down move down 85 | bindsym $mod+Shift+Up move up 86 | bindsym $mod+Shift+Right move right 87 | 88 | # split in horizontal orientation 89 | bindsym $mod+h split h 90 | 91 | # split in vertical orientation 92 | bindsym $mod+v split v 93 | 94 | # enter fullscreen mode for the focused container 95 | bindsym $mod+f fullscreen toggle 96 | 97 | # change container layout (stacked, tabbed, toggle split) 98 | bindsym $mod+s layout stacking 99 | bindsym $mod+w layout tabbed 100 | bindsym $mod+e layout toggle split 101 | 102 | # toggle tiling / floating 103 | bindsym $mod+Shift+space floating toggle 104 | 105 | # change focus between tiling / floating windows 106 | bindsym $mod+space focus mode_toggle 107 | 108 | # focus the parent container 109 | bindsym $mod+Tab focus parent 110 | 111 | # focus the child container 112 | bindsym $mod+Shift+Tab focus child 113 | 114 | # move the currently focused window to the scratchpad 115 | bindsym $mod+Shift+minus move scratchpad 116 | 117 | # Show the next scratchpad window or hide the focused scratchpad window. 118 | # If there are multiple scratchpad windows, this command cycles through them. 119 | bindsym $mod+minus scratchpad show 120 | 121 | #navigate workspaces next / previous 122 | bindsym $mod+Ctrl+Right workspace next 123 | bindsym $mod+Ctrl+Left workspace prev 124 | 125 | # move workspace to different screens 126 | bindsym $mod+Ctrl+Shift+Left move workspace to output left 127 | bindsym $mod+Ctrl+Shift+Right move workspace to output right 128 | 129 | # switch to workspace 130 | bindsym $mod+1 workspace 1 131 | bindsym $mod+2 workspace 2 132 | bindsym $mod+3 workspace 3 133 | bindsym $mod+4 workspace 4 134 | bindsym $mod+5 workspace 5 135 | bindsym $mod+6 workspace 6 136 | bindsym $mod+7 workspace 7 137 | bindsym $mod+8 workspace 8 138 | bindsym $mod+9 workspace 9 139 | bindsym $mod+0 workspace 10 140 | 141 | # move focused container to workspace 142 | bindsym $mod+Shift+1 move container to workspace 1 143 | bindsym $mod+Shift+2 move container to workspace 2 144 | bindsym $mod+Shift+3 move container to workspace 3 145 | bindsym $mod+Shift+4 move container to workspace 4 146 | bindsym $mod+Shift+5 move container to workspace 5 147 | bindsym $mod+Shift+6 move container to workspace 6 148 | bindsym $mod+Shift+7 move container to workspace 7 149 | bindsym $mod+Shift+8 move container to workspace 8 150 | bindsym $mod+Shift+9 move container to workspace 9 151 | bindsym $mod+Shift+0 move container to workspace 10 152 | 153 | # reload the configuration file 154 | bindsym $mod+Shift+c reload 155 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 156 | bindsym $mod+Shift+r restart 157 | # exit i3 (logs you out of your X session) 158 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" 159 | 160 | bindsym $mod+Mod1+Left resize shrink width 5 px or 5 ppt 161 | bindsym $mod+Mod1+Down resize grow height 5 px or 5 ppt 162 | bindsym $mod+Mod1+Up resize shrink height 5 px or 5 ppt 163 | bindsym $mod+Mod1+Right resize grow width 5 px or 5 ppt 164 | 165 | bindsym $mod+Mod1+Shift+Left resize shrink width 1 px or 1 ppt 166 | bindsym $mod+Mod1+Shift+Down resize grow height 1 px or 1 ppt 167 | bindsym $mod+Mod1+Shift+Up resize shrink height 1 px or 1 ppt 168 | bindsym $mod+Mod1+Shift+Right resize grow width 1 px or 1 ppt 169 | 170 | # resize window (you can also use the mouse for that) 171 | mode "resize" { 172 | bindsym Left resize shrink width 5 px or 5 ppt 173 | bindsym Down resize grow height 5 px or 5 ppt 174 | bindsym Up resize shrink height 5 px or 5 ppt 175 | bindsym Right resize grow width 5 px or 5 ppt 176 | 177 | bindsym Shift+Left resize shrink width 1 px or 1 ppt 178 | bindsym Shift+Down resize grow height 1 px or 1 ppt 179 | bindsym Shift+Up resize shrink height 1 px or 1 ppt 180 | bindsym Shift+Right resize grow width 1 px or 1 ppt 181 | 182 | # back to normal: Enter or Escape 183 | bindsym Return mode "default" 184 | bindsym Escape mode "default" 185 | } 186 | 187 | bindsym $mod+r mode "resize" 188 | 189 | # Start i3bar to display a workspace bar (plus the system information i3status 190 | # finds out, if available) 191 | bar { 192 | status_command i3status 193 | } 194 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/share/mdaffin/etc/libinput-gestures.conf: -------------------------------------------------------------------------------- 1 | gesture: swipe up 3 i3-msg "fullscreen toggle" 2 | gesture: swipe down 3 xdotool key F5 3 | gesture: swipe right 3 xdotool key alt+Right 4 | gesture: swipe left 3 xdotool key alt+Left 5 | 6 | gesture: swipe up 4 i3-msg "resize grow height 10 px or 10 ppt" 7 | gesture: swipe down 4 i3-msg "resize shrink height 10 px or 10 ppt" 8 | gesture: swipe right 4 i3-msg "resize grow width 10 px or 10 ppt" 9 | gesture: swipe left 4 i3-msg "resize shrink width 10 px or 10 ppt" 10 | 11 | gesture: swipe right_up 3 i3-msg "workspace next" 12 | gesture: swipe left_up 3 i3-msg "workspace prev" 13 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-desktop/usr/share/wayland-sessions/mdaffin-sway.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=MDaffin Sway 3 | Comment=An i3-compatible Wayland compositor 4 | Exec=env QT_QPA_PLATFORM=wayland-egl CLUTTER_BACKEND=wayland MOZ_ENABLE_WAYLAND=1 MOZ_USE_XINPUT2=1 sway 5 | Type=Application 6 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-neovim/usr/bin/vi: -------------------------------------------------------------------------------- 1 | /usr/bin/nvim -------------------------------------------------------------------------------- /pkg/mdaffin/files-neovim/usr/bin/vim: -------------------------------------------------------------------------------- 1 | /usr/bin/nvim -------------------------------------------------------------------------------- /pkg/mdaffin/files-neovim/usr/share/nvim/runtime/pack/plugin/start/base/lua/lsp.lua: -------------------------------------------------------------------------------- 1 | local nvim_lsp = require('lspconfig') 2 | local completion = require('completion') 3 | local lsp_status = require('lsp-status') 4 | 5 | lsp_status.register_progress() 6 | 7 | local on_attach = function(client, bufnr) 8 | local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end 9 | local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end 10 | 11 | completion.on_attach(client, bufnr) 12 | lsp_status.on_attach(client, bufnr) 13 | 14 | buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') 15 | 16 | -- Mappings. 17 | local opts = { noremap=true, silent=true } 18 | buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) 19 | buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) 20 | buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) 21 | buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) 22 | buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) 23 | buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) 24 | buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) 25 | buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) 26 | buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) 27 | buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) 28 | buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) 29 | buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) 30 | buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) 31 | buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) 32 | buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) 33 | buf_set_keymap('n', 'a', 'lua vim.lsp.buf.code_action()', opts) 34 | 35 | -- Set some keybinds conditional on server capabilities 36 | if client.resolved_capabilities.document_formatting then 37 | buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) 38 | vim.api.nvim_command('autocmd BufWritePre * lua vim.lsp.buf.formatting_sync(nil, 500)') 39 | elseif client.resolved_capabilities.document_range_formatting then 40 | buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) 41 | vim.api.nvim_command('autocmd BufWritePre * lua vim.lsp.buf.formatting_sync(nil, 500)') 42 | end 43 | 44 | -- Set autocommands conditional on server_capabilities 45 | if client.resolved_capabilities.document_highlight then 46 | vim.api.nvim_exec([[ 47 | hi LspReferenceRead cterm=bold gui=bold 48 | hi LspReferenceText cterm=bold gui=bold 49 | hi LspReferenceWrite cterm=bold gui=bold 50 | augroup lsp_document_highlight 51 | autocmd! 52 | autocmd CursorHold lua vim.lsp.buf.document_highlight() 53 | autocmd CursorMoved lua vim.lsp.buf.clear_references() 54 | augroup END 55 | ]], false) 56 | end 57 | vim.api.nvim_command('autocmd CursorHold,CursorHoldI,CursorMoved *.rs :lua require\'lsp_extensions\'.inlay_hints{ prefix = " » ", highlight = "Comment", enabled = {"TypeHint", "ChainingHint", "ParameterHint"} }') 58 | end 59 | 60 | -- Use a loop to conveniently both setup defined servers 61 | -- and map buffer local keybindings when the language server attaches 62 | local servers = { "bashls", "cssls", "dockerls", "gopls", "html", "tsserver", "pyls", "terraformls", "vimls", "yamlls", "sumneko_lua" } 63 | for _, lsp in ipairs(servers) do 64 | nvim_lsp[lsp].setup { 65 | on_attach = on_attach, 66 | capabilities = lsp_status.capabilities, 67 | } 68 | end 69 | 70 | require'lspconfig'.jsonls.setup({ 71 | on_attach = on_attach, 72 | capabilities = lsp_status.capabilities, 73 | settings = { 74 | cmd = { "json-languageserver", "--stdio" } 75 | }, 76 | }) 77 | 78 | require'lspconfig'.svelte.setup({ 79 | on_attach = on_attach, 80 | capabilities = lsp_status.capabilities, 81 | }) 82 | 83 | require'lspconfig'.rust_analyzer.setup({ 84 | on_attach = on_attach, 85 | capabilities = lsp_status.capabilities, 86 | settings = { 87 | ["rust-analyzer"] = { 88 | --checkOnSave = { enable = false }, 89 | --procMacro = { enable = true }, 90 | diagnostics = { 91 | enable = true, 92 | disabled = {"unresolved-proc-macro"}, 93 | enableExperimental = true, 94 | }, 95 | } 96 | } 97 | }) 98 | 99 | vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( 100 | vim.lsp.diagnostic.on_publish_diagnostics, { 101 | virtual_text = true, 102 | signs = true, 103 | update_in_insert = true, 104 | } 105 | ) 106 | -------------------------------------------------------------------------------- /pkg/mdaffin/files-neovim/usr/share/nvim/runtime/pack/plugin/start/base/plugin/workspace.vim: -------------------------------------------------------------------------------- 1 | packadd dracula 2 | if (has("termguicolors")) 3 | set termguicolors 4 | endif 5 | syntax enable 6 | colorscheme dracula 7 | 8 | packadd lsp-status.nvim 9 | function! LspStatus() abort 10 | if luaeval('#vim.lsp.buf_get_clients() > 0') 11 | return luaeval("require('lsp-status').status()") 12 | endif 13 | return '' 14 | endfunction 15 | 16 | set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P 17 | set statusline+=\ %{LspStatus()}` 18 | 19 | packadd completion-nvim 20 | let g:completion_confirm_key = "\" 21 | set completeopt=menuone,noinsert,noselect 22 | set shortmess+=c 23 | let g:completion_enable_snippet = 'UltiSnips' 24 | 25 | packadd lsp_extensions.nvim 26 | packadd nvim-lspconfig 27 | lua require("lsp") 28 | 29 | packadd fzf.vim 30 | 31 | filetype plugin indent on 32 | set tabstop=4 33 | set shiftwidth=4 34 | set expandtab 35 | 36 | set wildmode=longest:full,full 37 | set wildignorecase 38 | set virtualedit=block 39 | set list 40 | set listchars=tab:▸\ ,extends:❯,precedes:❮,trail:·,nbsp:· 41 | set colorcolumn=+1 42 | set number 43 | set nocursorcolumn 44 | set lazyredraw 45 | set splitbelow 46 | set splitright 47 | autocmd FileType help wincmd L 48 | 49 | set hidden 50 | set mouse=a 51 | 52 | nnoremap :Files 53 | nnoremap :Rg 54 | vnoremap "+y 55 | inoremap "+pa 56 | 57 | " Use and to navigate through popup menu 58 | inoremap pumvisible() ? "\" : "\" 59 | inoremap pumvisible() ? "\" : "\" 60 | 61 | " use as trigger keys 62 | imap (completion_smart_tab) 63 | imap (completion_smart_s_tab) 64 | 65 | set updatetime=500 66 | " Show diagnostic popup on cursor hold 67 | autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics() 68 | 69 | " Goto previous/next diagnostic warning/error 70 | nnoremap g[ lua vim.lsp.diagnostic.goto_prev() 71 | nnoremap g] lua vim.lsp.diagnostic.goto_next() 72 | set signcolumn=yes 73 | -------------------------------------------------------------------------------- /pkg/mdaffin/mdaffin-base.install: -------------------------------------------------------------------------------- 1 | post_install() { 2 | post_upgrade 3 | } 4 | 5 | post_upgrade() { 6 | ln -sf /usr/share/zoneinfo/Europe/London "/etc/localtime" 7 | echo "LANG=en_GB.UTF-8" > /etc/locale.conf 8 | sed 's/#en_GB/en_GB/' -i /etc/locale.gen 9 | sed 's/#en_US/en_US/' -i /etc/locale.gen 10 | locale-gen 11 | } 12 | -------------------------------------------------------------------------------- /pkg/mdaffin/mdaffin-desktop.install: -------------------------------------------------------------------------------- 1 | post_install() { 2 | post_upgrade 3 | } 4 | 5 | post_upgrade() { 6 | ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf 7 | cp /usr/share/mdaffin/etc/i3/config /etc/i3/config 8 | cp /usr/share/mdaffin/etc/libinput-gestures.conf /etc/libinput-gestures.conf 9 | echo "include /etc/sway/config.d/*" > /etc/sway/config 10 | } 11 | --------------------------------------------------------------------------------