├── .gitignore ├── recipes ├── base │ ├── network.yaml │ ├── Dockerfile │ └── script ├── development │ ├── products │ │ ├── README.md │ │ ├── libimobiledevice │ │ ├── pv │ │ ├── dicom │ │ ├── gitlab │ │ ├── abra │ │ └── qt │ ├── Dockerfile │ └── script ├── base-common │ ├── Dockerfile │ └── script └── desktop │ ├── pop.pref │ ├── Dockerfile │ ├── script │ └── blacklist-packages ├── .gitattributes ├── .travis.yml ├── test ├── README.md ├── ci └── scripts └── bootstrap-drive.sh /.gitignore: -------------------------------------------------------------------------------- 1 | scripts/debs.tar.gz 2 | recipes/desktop/communitheme/ 3 | .priv -------------------------------------------------------------------------------- /recipes/base/network.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | version: 2 3 | renderer: NetworkManager -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | recipes/desktop/communitheme-bionic-snap.sqsh filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /recipes/development/products/README.md: -------------------------------------------------------------------------------- 1 | These scripts are the packages needed to dev in various products. -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | services: 3 | - docker 4 | script: 5 | - ./ci & 6 | - while [ -e /proc/$! ]; do echo -n "." && sleep 60; done 7 | -------------------------------------------------------------------------------- /recipes/base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM godarch/ubuntu:focal 2 | 3 | ADD script /scripts/script 4 | ADD network.yaml /scripts/network.yaml 5 | 6 | RUN cd /scripts && ./script && rm -r /scripts -------------------------------------------------------------------------------- /recipes/development/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM pauldotknopf/darch-ubuntu-desktop 2 | 3 | ADD script /scripts/script 4 | ADD products /scripts/products 5 | 6 | RUN cd /scripts && ./script && rm -r /scripts -------------------------------------------------------------------------------- /recipes/development/products/libimobiledevice: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apt-get install -y libssl-dev \ 4 | libusb-1.0.0-dev \ 5 | python2.7-dev \ 6 | libxml2-dev \ 7 | libtool \ 8 | libfuse-dev -------------------------------------------------------------------------------- /recipes/base-common/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM pauldotknopf/darch-ubuntu-base 2 | 3 | ARG ROOT_PASSWD=password 4 | ARG USER_PASSWD=password 5 | 6 | ADD script /scripts/script 7 | 8 | RUN cd /scripts && ./script && rm -r /scripts -------------------------------------------------------------------------------- /recipes/development/products/pv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apt-get install -y \ 4 | protobuf-compiler-grpc \ 5 | libprotobuf-dev \ 6 | libgrpc++-dev \ 7 | libdcmtk-dev \ 8 | systemd \ 9 | libsystemd-dev -------------------------------------------------------------------------------- /recipes/desktop/pop.pref: -------------------------------------------------------------------------------- 1 | Package: * 2 | Pin: release o=LP-PPA-system76-pop 3 | Pin-Priority: -1 4 | 5 | Package: pop-fonts pop-gnome-shell-theme pop-gtk-theme pop-icon-theme pop-theme 6 | Pin: release o=LP-PPA-system76-pop 7 | Pin-Priority: 500 -------------------------------------------------------------------------------- /recipes/desktop/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM pauldotknopf/darch-ubuntu-base-common 2 | 3 | ADD script /scripts/script 4 | ADD blacklist-packages /scripts/blacklist-packages 5 | ADD pop.pref /scripts/pop.pref 6 | 7 | RUN cd /scripts && ./script && rm -r /scripts -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ./build 5 | 6 | TAG=`date +"%Y-%m-%d-%H%M%S"` 7 | 8 | docker tag pauldotknopf/darch-ubuntu-development pauldotknopf/darch-ubuntu-development:testing-$TAG 9 | docker push pauldotknopf/darch-ubuntu-development:testing-$TAG -------------------------------------------------------------------------------- /recipes/development/products/dicom: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apt-get install -y debhelper \ 4 | pkg-config \ 5 | cmake \ 6 | protobuf-compiler-grpc \ 7 | libprotobuf-dev \ 8 | libgrpc++-dev \ 9 | libdcmtk-dev \ 10 | systemd \ 11 | libsystemd-dev -------------------------------------------------------------------------------- /recipes/development/products/gitlab: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apt-get install -y ed \ 4 | libsqlite3-dev \ 5 | libpq-dev \ 6 | libkrb5-dev \ 7 | libre2-dev \ 8 | libicu-dev \ 9 | cmake \ 10 | postgresql \ 11 | postgresql-contrib \ 12 | libpq-dev \ 13 | redis-server -------------------------------------------------------------------------------- /recipes/development/products/abra: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apt-get install -y mesa-common-dev \ 4 | libgstreamer1.0-dev \ 5 | libgstreamer-plugins-base1.0-dev \ 6 | libgstreamer-plugins-base1.0-dev \ 7 | libgstrtspserver-1.0-dev \ 8 | libpulse-dev \ 9 | ffmpeg \ 10 | libturbojpeg0-dev \ 11 | printer-driver-cups-pdf 12 | 13 | mkdir /data && sudo chmod +777 /data -------------------------------------------------------------------------------- /recipes/development/products/qt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | apt-get install -y libfontconfig1-dev \ 4 | libfreetype6-dev \ 5 | libx11-dev \ 6 | libxext-dev \ 7 | libxfixes-dev \ 8 | libxi-dev \ 9 | libxrender-dev \ 10 | libxcb1-dev \ 11 | libx11-xcb-dev \ 12 | libxcb-glx0-dev \ 13 | libxcb-keysyms1-dev \ 14 | libxcb-image0-dev \ 15 | libxcb-shm0-dev \ 16 | libxcb-icccm4-dev \ 17 | libxcb-sync0-dev \ 18 | libxcb-xfixes0-dev \ 19 | libxcb-shape0-dev \ 20 | libxcb-randr0-dev \ 21 | libxcb-render-util0-dev \ 22 | libgstreamer1.0-dev \ 23 | libgstreamer-plugins-base1.0-dev \ 24 | libgstreamer-plugins-base1.0-dev \ 25 | libxkbcommon-dev \ 26 | libxcb-xinput-dev \ 27 | libhunspell-dev -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Darch recipes 2 | 3 | My personal [Darch](https://github.com/godarch/darch) recipes. 4 | 5 | ## Want to use them? 6 | 7 | You can boot my images. Each one has a guest account baked in that has no password. **WARNING**: Booting these essentially gives me full power over your entire computer. You can trust me though :) 8 | 9 | Here are the instructions. 10 | 11 | ### 1. Install Darch 12 | 13 | Instructions [here](https://godarch.com/installation/) 14 | 15 | ### 2. Stage image 16 | 17 | ```bash 18 | # You can checkout my image I use for development. 19 | export IMAGE="development" 20 | # Also, you can try "i3" or "plasma". 21 | sudo darch images pull pauldotknopf/darch-ubuntu-$IMAGE 22 | sudo darch stage pauldotknopf/darch-ubuntu-$IMAGE 23 | ``` 24 | 25 | ### 3. Reboot and select the grub menu entry 26 | -------------------------------------------------------------------------------- /ci: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | . ./.priv 5 | 6 | ./build 7 | 8 | TAG=`date +"%Y-%m-%d-%H%M%S"` 9 | 10 | docker tag pauldotknopf/darch-ubuntu-base pauldotknopf/darch-ubuntu-base:$TAG 11 | docker tag pauldotknopf/darch-ubuntu-base-common pauldotknopf/darch-ubuntu-base-common:$TAG 12 | docker tag pauldotknopf/darch-ubuntu-desktop pauldotknopf/darch-ubuntu-desktop:$TAG 13 | docker tag pauldotknopf/darch-ubuntu-development pauldotknopf/darch-ubuntu-development:$TAG 14 | 15 | #docker login -u $DOCKER_LOGIN_USERNAME -p $DOCKER_LOGIN_PASSWORD 16 | 17 | docker push pauldotknopf/darch-ubuntu-base 18 | docker push pauldotknopf/darch-ubuntu-base-common 19 | docker push pauldotknopf/darch-ubuntu-desktop 20 | docker push pauldotknopf/darch-ubuntu-development 21 | 22 | docker push pauldotknopf/darch-ubuntu-base:$TAG 23 | docker push pauldotknopf/darch-ubuntu-base-common:$TAG 24 | docker push pauldotknopf/darch-ubuntu-desktop:$TAG 25 | docker push pauldotknopf/darch-ubuntu-development:$TAG 26 | -------------------------------------------------------------------------------- /recipes/desktop/script: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | export DEBIAN_FRONTEND=noninteractive 4 | 5 | while IFS='' read -r line || [[ -n "$line" ]]; do 6 | preference_file="/etc/apt/preferences.d/$line.pref" 7 | echo -e "Package: $line\nPin: release *\nPin-Priority: -1" > $preference_file 8 | done < "./blacklist-packages" 9 | 10 | tasksel install ubuntu-desktop 11 | 12 | # The gdm service tries to use Wayland for some reason... so disable it. 13 | sed -i '/WaylandEnable/s/^#//g' /etc/gdm3/custom.conf 14 | 15 | # Install fusuma so that we can use gestures to switch apps. 16 | apt-get install -y ruby libinput-tools xdotool 17 | gem install fusuma 18 | 19 | apt-get install -y gnome-calculator 20 | 21 | # Video codecs 22 | sudo apt-get install -y gstreamer1.0-{vaapi,libav} gstreamer1.0-plugins-{bad,good,ugly} 23 | 24 | # Use pop repo for the theme 25 | cp pop.pref /etc/apt/preferences.d/ 26 | apt-add-repository -y ppa:system76/pop 27 | apt-get install -y pop-theme gnome-shell-extensions 28 | 29 | # I use this for VPN access 30 | apt-get install -y network-manager-openconnect network-manager-openconnect-gnome -------------------------------------------------------------------------------- /recipes/desktop/blacklist-packages: -------------------------------------------------------------------------------- 1 | libreoffice-calc 2 | libreoffice-gnome 3 | libreoffice-impress 4 | libreoffice-ogltrans 5 | libreoffice-pdfimport 6 | libreoffice-style-breeze 7 | libreoffice-writer 8 | firefox 9 | aisleriot 10 | app-install-data-partner 11 | apport-gtk 12 | bluez 13 | bluez-cups 14 | brltty 15 | cheese 16 | deja-dup 17 | evince 18 | example-content 19 | firefox 20 | gnome-accessibility-themes 21 | gnome-bluetooth 22 | gnome-calendar 23 | gnome-disk-utility 24 | gnome-font-viewer 25 | gnome-getting-started-docs 26 | gnome-initial-setup 27 | gnome-mahjongg 28 | gnome-mines 29 | gnome-power-manager 30 | gnome-software-plugin-snap 31 | gnome-sudoku 32 | gnome-todo 33 | kerneloops 34 | libwmf0.2-7-gtk 35 | memtest86+ 36 | nautilus-sendto 37 | nautilus-share 38 | network-manager-config-connectivity-ubuntu 39 | network-manager-openvpn-gnome 40 | network-manager-pptp-gnome 41 | pulseaudio-module-bluetooth 42 | shotwell 43 | simple-scan 44 | snapd 45 | thunderbird 46 | thunderbird-gnome-support 47 | ubuntu-report 48 | ubuntu-software 49 | ubuntu-web-launchers 50 | usb-creator-gtk 51 | vino 52 | whoopsie 53 | xul-ext-ubufox -------------------------------------------------------------------------------- /recipes/development/script: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | export DEBIAN_FRONTEND=noninteractive 4 | 5 | apt-get install -y build-essential \ 6 | git \ 7 | aptitude \ 8 | pbuilder \ 9 | pv \ 10 | cmake \ 11 | python 12 | 13 | # Install golang from upstream 14 | curl -Ls https://go.dev/dl/go1.16.13.linux-amd64.tar.gz | sudo tar -C /usr/local -xzf - 15 | sudo ln -s /usr/local/go/bin/go /usr/bin/go 16 | 17 | # ./products/qt 18 | # ./products/libimobiledevice 19 | # ./products/abra 20 | # ./products/pv 21 | # ./products/dicom 22 | 23 | # Install nodejs 24 | curl -Ls https://nodejs.org/dist/v16.14.0/node-v16.14.0-linux-x64.tar.xz | unxz | tar --strip-components=1 -xpf - -C /usr 25 | 26 | # Setup libsecret for use with git 27 | apt-get install -y libsecret-1-0 libsecret-1-dev libglib2.0-dev 28 | make --directory=/usr/share/doc/git/contrib/credential/libsecret 29 | 30 | # Install GitKraken 31 | wget --quiet https://release.gitkraken.com/linux/gitkraken-amd64.deb -O /tmp/gitkraken.deb 32 | gdebi -n /tmp/gitkraken.deb 33 | rm /tmp/gitkraken.deb 34 | 35 | # Install Docker 36 | mkdir -p /etc/docker 37 | touch /etc/docker/daemon.json 38 | echo "{\"experimental\": true, \"graph\": \"/var/lib/darch/docker\"}" | tee -a /etc/docker/daemon.json 39 | apt-get install -y docker-ce 40 | systemctl enable docker 41 | usermod -aG docker pknopf 42 | apt-get install -y docker-compose golang-docker-credential-helpers 43 | 44 | # Install .NET Core 45 | wget --quiet https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O /tmp/dotnet.deb 46 | gdebi -n /tmp/dotnet.deb 47 | rm /tmp/dotnet.deb 48 | apt-get update 49 | apt-get -y install dotnet-sdk-5.0 50 | 51 | # Install ttyd 52 | curl -Ls https://github.com/tsl0922/ttyd/releases/download/1.6.0/ttyd_linux.x86_64 > /usr/bin/ttyd 53 | chmod +x /usr/bin/ttyd 54 | 55 | # Install ngrok 56 | wget --quiet https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip -O /tmp/ngrok.zip 57 | unzip -d /usr/bin /tmp/ngrok.zip 58 | rm /tmp/ngrok.zip 59 | 60 | # Install ffsend 61 | curl -Ls https://github.com/timvisee/ffsend/releases/download/v0.2.74/ffsend-v0.2.74-linux-x64-static > /usr/bin/ffsend 62 | chmod +x /usr/bin/ffsend 63 | 64 | # Install VMWare 65 | wget --quiet https://download3.vmware.com/software/player/file/VMware-Player-Full-16.2.1-18811642.x86_64.bundle -O /tmp/vmware.bundle 66 | chmod +x /tmp/vmware.bundle 67 | echo -ne '\n\n\n' | /tmp/vmware.bundle --console --eulas-agreed 68 | rm /tmp/vmware.bundle 69 | 70 | # cmake 71 | wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null 72 | echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null 73 | apt-get update && apt-get install -y cmake -------------------------------------------------------------------------------- /recipes/base/script: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | export DEBIAN_FRONTEND=noninteractive 4 | 5 | # We never want to cache any packages. 6 | echo -e 'Dir::Cache "";\nDir::Cache::archives "";' | tee /etc/apt/apt.conf.d/00_disable-cache-directories 7 | 8 | # Add the official Ubuntu repositories. 9 | echo "deb http://us.archive.ubuntu.com/ubuntu/ focal multiverse universe main restricted" >> /etc/apt/sources.list 10 | echo "deb http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse universe main restricted" >> /etc/apt/sources.list 11 | echo "deb http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list 12 | echo "deb http://security.ubuntu.com/ubuntu focal-security restricted main universe multiverse" >> /etc/apt/sources.list 13 | 14 | # Add the docker repo 15 | echo "deb https://download.docker.com/linux/ubuntu focal stable" >> /etc/apt/sources.list 16 | curl -Ls https://download.docker.com/linux/ubuntu/gpg | apt-key add - 17 | 18 | apt-get update 19 | # The "linux-image-generic" gets held back for some reason. 20 | # The "--with-new-pkgs" forces the package to be upgraded. 21 | apt-get --with-new-pkgs upgrade -y 22 | 23 | # Install Darch. 24 | apt-get install -y darch 25 | systemctl enable containerd 26 | # I store containerd on /var/lib/darch/containerd, because /var/lib/darch 27 | # is an external partition. This way, images are persisted across boots. 28 | echo "root = \"/var/lib/darch/containerd\"" >> /etc/containerd/config.toml 29 | # Darch installs grub-common, which installs "grub-initrd-fallback.service". 30 | # This fails on boot. Let's just disable it. 31 | systemctl disable grub-initrd-fallback 32 | 33 | # Enable default DHCP networking. 34 | apt-get install -y network-manager 35 | mkdir -p /etc/netplan 36 | cp network.yaml /etc/netplan 37 | 38 | # Setup the locales. 39 | locale-gen --purge en_US.UTF-8 40 | echo -e 'LANG="en_US.UTF-8"\nLANGUAGE="en_US:en"\n' > /etc/default/locale 41 | 42 | # Set the timezone to EST 43 | rm /etc/localtime 44 | ln -s ../usr/share/zoneinfo/America/New_York /etc/localtime 45 | 46 | # We need this in a few places. 47 | apt-get install -y tasksel gdebi-core 48 | 49 | # Enable ssh access 50 | apt-get install -y openssh-server 51 | 52 | # Add nvidia drivers (for my XPS 5970) 53 | add-apt-repository -y ppa:graphics-drivers/ppa 54 | apt-get install -y nvidia-driver-418 nvidia-modprobe 55 | 56 | # When running in Travis, the nvidia package will create an initrd for 57 | # the kernel version of the build host. I'm not sure why this is, but 58 | # it affects extracting the image for boot (later on), so delete it. 59 | # Remove all vmlinux/initrd from the boot. 60 | # There may be many versions. 61 | rm -r /boot/* 62 | # Now reinstall the files to /boot. 63 | apt-cache depends linux-image-generic | sed -n 2p | tr -s ' ' | cut -d ' ' -f 3 | xargs apt-get --reinstall install -y 64 | 65 | # Use the intel driver on boot by default. The nvidia driver has issues with system resuming. 66 | # The prime-select command fails if "/etc/default/grub" doesn't exist. 67 | touch /etc/default/grub 68 | prime-select intel 69 | 70 | # Increase the size of the linux console text. 71 | sed -i 's/FONTSIZE=.*/FONTSIZE="16x32"/g' /etc/default/console-setup -------------------------------------------------------------------------------- /recipes/base-common/script: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | export DEBIAN_FRONTEND=noninteractive 4 | 5 | apt-get install -y zsh \ 6 | fonts-hack \ 7 | fonts-powerline \ 8 | direnv \ 9 | nano \ 10 | aptitude \ 11 | apt-file \ 12 | htop \ 13 | tree \ 14 | xclip \ 15 | rsync \ 16 | jq \ 17 | git-lfs \ 18 | gnome-keyring \ 19 | command-not-found \ 20 | tmux \ 21 | sqlite3 `#For zsh-histdb` \ 22 | thefuck \ 23 | unzip \ 24 | meson \ 25 | mosh \ 26 | tmate \ 27 | dconf-editor 28 | 29 | # Set the root password 30 | if [ -n "$ROOT_PASSWD" ]; then 31 | echo "Using root password provided by environment variable..." 32 | echo -en "$ROOT_PASSWD\n$ROOT_PASSWD" | passwd 33 | else 34 | echo "Using default root password..." 35 | echo -en "password\npassword" | passwd 36 | fi 37 | 38 | # Add our users 39 | useradd -m -G users,input,sudo -s /bin/zsh pknopf 40 | chfn -f "Paul Knopf" pknopf 41 | groupadd guests 42 | useradd -m -G users,guests -s /bin/bash guest 43 | chfn -f "Guest" guest 44 | 45 | # Enable passwordless sudo for pknopf 46 | echo "pknopf ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/pknopf 47 | 48 | # Set the user password 49 | if [ -n "$USER_PASSWD" ]; then 50 | echo "Using user password provided by environment variable..." 51 | echo -en "$USER_PASSWD\n$USER_PASSWD" | passwd pknopf 52 | else 53 | echo "Using default user password..." 54 | echo -en "password\npassword" | passwd pknopf 55 | fi 56 | 57 | # Set the guest password 58 | echo -en "guest\nguest" | passwd guest 59 | 60 | # Add VS Code 61 | curl -Ls https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | apt-key add - 62 | echo "deb https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list 63 | apt-get update 64 | apt-get install -y code 65 | 66 | # Add Chrome 67 | curl -Ls https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - 68 | echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list 69 | apt-get update 70 | apt-get install -y google-chrome-stable 71 | 72 | # Add TeamViewer 73 | curl -Ls https://download.teamviewer.com/download/linux/signature/TeamViewer2017.asc | apt-key add - 74 | echo "deb http://linux.teamviewer.com/deb stable main" > /etc/apt/sources.list.d/teamviewer-tmp.list 75 | apt-get update 76 | apt-get install -y teamviewer 77 | # We remove the repo now because the teamviewer package reinstalls it 78 | rm /etc/apt/sources.list.d/teamviewer-tmp.list 79 | 80 | # Install ripgrep 81 | wget --quiet https://github.com/BurntSushi/ripgrep/releases/download/11.0.1/ripgrep_11.0.1_amd64.deb -O /tmp/ripgrep.deb 82 | gdebi -n /tmp/ripgrep.deb 83 | rm /tmp/ripgrep.deb 84 | 85 | # Increase inotify limit 86 | echo "fs.inotify.max_user_watches = 524288" >> /etc/sysctl.conf 87 | echo "fs.inotify.max_user_instances = 524288" >> /etc/sysctl.conf 88 | 89 | # Lower swappiness 90 | echo "vm.swappiness = 10" >> /etc/sysctl.conf 91 | 92 | # Install gotop 93 | wget --quiet https://github.com/cjbassi/gotop/releases/download/3.0.0/gotop_3.0.0_linux_amd64.deb -O /tmp/gotop.deb 94 | gdebi -n /tmp/gotop.deb 95 | rm /tmp/gotop.deb 96 | 97 | # Install bat, alt to cat 98 | wget --quiet https://github.com/sharkdp/bat/releases/download/v0.10.0/bat_0.10.0_amd64.deb -O /tmp/bat.deb 99 | gdebi -n /tmp/bat.deb 100 | rm /tmp/bat.deb 101 | 102 | # Install fselect 103 | wget --quiet https://github.com/jhspetersson/fselect/releases/download/0.6.5/fselect-x86_64-linux-musl.gz -O /tmp/fselect.zip 104 | unzip -p /tmp/fselect.zip | gunzip > /usr/bin/fselect 105 | chmod +x /usr/bin/fselect 106 | rm /tmp/fselect.zip 107 | 108 | # Install caddyserver 109 | mkdir /tmp/caddy 110 | curl -Ls https://github.com/caddyserver/caddy/releases/download/v2.0.0-beta6/caddy2_beta6_linux_amd64 > /usr/bin/caddy 111 | chmod +x /usr/bin/caddy 112 | 113 | # Install broot 114 | curl -Ls https://dystroy.org/broot/download/x86_64-linux/broot > /usr/bin/broot 115 | chmod +x /usr/bin/broot -------------------------------------------------------------------------------- /scripts/bootstrap-drive.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | DEVICE="$1" 5 | 6 | if [ "$DEVICE" == "" ]; then 7 | echo "You must provide a device." 8 | exit 1 9 | fi 10 | 11 | function test-command() { 12 | command -v $1 >/dev/null 2>&1 || { echo >&2 "The command \"$1\" is required. Try \"apt-get install $2\"."; exit 1; } 13 | } 14 | 15 | test-command debootstrap debootstrap 16 | test-command arch-chroot arch-install-scripts 17 | test-command genfstab arch-install-scripts 18 | test-command parted parted 19 | 20 | # Download the debs to be used to install debian 21 | if [ ! -e "debs.tar.gz" ]; then 22 | debootstrap --verbose \ 23 | --make-tarball=debs.tar.gz \ 24 | --include=linux-image-generic,grub-efi \ 25 | bionic rootfs http://archive.ubuntu.com/ubuntu/ 26 | fi 27 | 28 | # Create our hard disk 29 | parted -s ${DEVICE} \ 30 | mklabel gpt \ 31 | mkpart primary 0% 500MiB `# 1. EFI` \ 32 | mkpart primary 500MiB 100% `# LVM` \ 33 | set 1 esp on 34 | sync 35 | sleep 2 36 | 37 | # Create LVM volumes 38 | pvcreate ${DEVICE}p2 39 | vgcreate vg00 ${DEVICE}p2 40 | lvcreate -L 8GiB vg00 -n root 41 | lvcreate -L 8GiB vg00 -n swap 42 | lvcreate -L 100MiB vg00 -n darchconfig 43 | lvcreate -L 200GiB vg00 -n darchlib 44 | lvcreate -l 100%FREE vg00 -n home 45 | vgchange -ay 46 | 47 | # Format the partitions 48 | mkfs.fat -F32 ${DEVICE}p1 49 | mkfs.ext4 /dev/mapper/vg00-root 50 | mkswap /dev/mapper/vg00-swap 51 | mkfs.ext4 /dev/mapper/vg00-darchconfig 52 | mkfs.ext4 /dev/mapper/vg00-darchlib 53 | mkfs.ext4 /dev/mapper/vg00-home 54 | 55 | # Mount the new partitions 56 | rm -rf rootfs && mkdir rootfs 57 | mount /dev/mapper/vg00-root rootfs 58 | mkdir -p rootfs/boot/efi 59 | mount ${DEVICE}p1 rootfs/boot/efi 60 | mkdir -p rootfs/etc/darch 61 | mount /dev/mapper/vg00-darchconfig rootfs/etc/darch 62 | mkdir -p rootfs/var/lib/darch 63 | mount /dev/mapper/vg00-darchlib rootfs/var/lib/darch 64 | 65 | # Generate the rootfs 66 | debootstrap --verbose \ 67 | --unpack-tarball=$(pwd)/debs.tar.gz \ 68 | --include=linux-image-generic,grub-efi \ 69 | bionic rootfs http://archive.ubuntu.com/ubuntu/ 70 | 71 | # Generate fstab (removing comments and whitespace) 72 | genfstab -U -p rootfs | sed -e 's/#.*$//' -e '/^$/d' > rootfs/etc/fstab 73 | # TODO: Add swap to fstab 74 | # $(lsblk -rno UUID ${DEVICE}2) 75 | # UUID=8cf93f5d-5ffe-4739-b62a-b055d334d8f3 none swap defaults,pri=-2 0 0 76 | 77 | # Set the computer name 78 | echo "PAULS-UBUNTU" > rootfs/etc/hostname 79 | 80 | # Update all the packages 81 | arch-chroot rootfs apt-get update 82 | 83 | # Install some random tools 84 | arch-chroot rootfs apt-get -y install network-manager \ 85 | openssh-server \ 86 | lvm2 87 | 88 | # Install GRUB 89 | arch-chroot rootfs grub-install ${DEVICE} --target=x86_64-efi --efi-directory=/boot/efi 90 | arch-chroot rootfs grub-mkconfig -o /boot/grub/grub.cfg 91 | 92 | # Create the default users 93 | arch-chroot rootfs apt-get -y install sudo 94 | echo "Enter the password for root:" 95 | arch-chroot rootfs passwd 96 | arch-chroot rootfs useradd -m -G users,sudo -s /usr/bin/bash pknopf 97 | echo "Enter password for pknopf:" 98 | arch-chroot rootfs passwd pknopf 99 | 100 | # Install Darch 101 | arch-chroot rootfs apt-get -y install curl gnupg software-properties-common 102 | arch-chroot rootfs /bin/bash -c "curl -L https://raw.githubusercontent.com/godarch/debian-repo/master/key.pub | apt-key add -" 103 | arch-chroot rootfs add-apt-repository 'deb https://raw.githubusercontent.com/godarch/debian-repo/master/darch testing main' 104 | arch-chroot rootfs apt-get update 105 | arch-chroot rootfs apt-get -y install darch 106 | arch-chroot rootfs mkdir -p /etc/containerd 107 | echo "root = \"/var/lib/darch/containerd\"" > rootfs/etc/containerd/config.toml 108 | arch-chroot rootfs systemctl enable containerd 109 | 110 | # Setup the fstab hooks for Darch 111 | cat rootfs/etc/fstab | tail -n +2 > rootfs/etc/darch/hooks/default_fstab 112 | echo "*=default_fstab" > rootfs/etc/darch/hooks/fstab.config 113 | 114 | # Run grub-mkconfig again to ensure it loads the Darch grub config file 115 | arch-chroot rootfs grub-mkconfig -o /boot/grub/grub.cfg 116 | 117 | # Clean up 118 | umount rootfs/boot/efi 119 | umount rootfs/etc/darch 120 | umount rootfs/var/lib/darch 121 | umount rootfs 122 | --------------------------------------------------------------------------------