1
0
Fork 0
mirror of https://github.com/kou029w/dotfiles.git synced 2025-01-18 08:05:01 +00:00

create desktop addon

This commit is contained in:
Nebel 2022-06-14 00:34:22 +09:00
parent 960c151ef9
commit c79b002155
19 changed files with 93 additions and 36 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
* .*

View file

@ -3,3 +3,15 @@
```sh ```sh
./install ./install
``` ```
## Installing Packages
```sh
sudo ./install
```
or
```sh
sudo ./install desktop
```

View file

@ -0,0 +1,2 @@
repo_add_once="false"
repo_reenable_on_distupgrade="false"

View file

@ -0,0 +1,2 @@
repo_add_once="false"
repo_reenable_on_distupgrade="false"

7
desktop/install Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
cd -- "$(dirname -- "$0")"
. ../mod.bash
(($(id -u) == 0)) \
&& [[ -f /etc/debian_version ]] \
&& install_apt_packages

9
desktop/packages.bash Normal file
View file

@ -0,0 +1,9 @@
packages=(
birdtray
code
deja-dup
easytag
google-chrome-stable
mozc-utils-gui
slack-desktop
)

View file

@ -1 +0,0 @@
# docker-ce.list

38
install
View file

@ -1,39 +1,9 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
cd -- "$(dirname -- "$0")" cd -- "$(dirname -- "$0")"
. mod.bash
function install_dotfiles() {
local home
local dotfile
home=$(eval echo ~"${SUDO_USER:-}")
for dotfile in .*; do
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
dotfile=$(realpath "$dotfile")
(
cd -- "$home"
ln -svf "$dotfile" .
)
done
}
function install_apt_packages() {
local packages
local package
packages=()
for package in etc/apt/sources.list.d/*.list; do
package=${package##*/}
package=${package%.list}
packages+=("$package")
done
rsync -rv etc/apt/keyrings/ /usr/share/keyrings/
rsync -rv etc/apt/sources.list.d/ /etc/apt/sources.list.d/
apt update
apt install -y "${packages[@]}"
}
install_dotfiles
(($(id -u) == 0)) \ (($(id -u) == 0)) \
&& [[ -d /etc/apt/sources.list.d ]] \ && [[ -f /etc/debian_version ]] \
&& install_apt_packages && install_apt_packages
install_dotfiles
install_addons "$@"

37
mod.bash Normal file
View file

@ -0,0 +1,37 @@
function install_apt_packages() {
local packages
local apt_sources_dir
. packages.bash
eval "$(apt-config shell apt_sources_dir 'Dir::Etc::sourceparts/d')"
rsync -rv etc/apt/keyrings/ /usr/share/keyrings/
rsync -rv etc/apt/sources.list.d/ "$apt_sources_dir"
[[ -d etc/default ]] \
&& rsync -rv etc/default/ /etc/default/
apt update
apt install -y "${packages[@]}"
}
function install_dotfiles() {
local home
local dotfile
home=$(eval "echo ~${SUDO_USER:-}")
for dotfile in .*; do
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
dotfile=$(realpath "$dotfile")
(
cd -- "$home"
ln -svf "$dotfile" .
)
done
}
function install_addons() {
local addon
for addon in "$@"; do
(
cd -- "$addon"
./install
)
done
}

19
packages.bash Normal file
View file

@ -0,0 +1,19 @@
packages=(
cloudflared
docker-ce
docker-compose-plugin
nodejs
tailscale
build-essential
curl
fdupes
ffmpeg
imagemagick
knot-dnsutils
qemu-user-static
screen
smartmontools
)
[[ "$(df --output=fstype . | sed 1d)" == "btrfs" ]] \
&& packages+=(snapper)