aboutsummaryrefslogtreecommitdiff
path: root/workstation
diff options
context:
space:
mode:
Diffstat (limited to 'workstation')
-rw-r--r--workstation/README.md3
m---------workstation/arch-container-builder0
-rwxr-xr-xworkstation/build_workstation35
-rwxr-xr-xworkstation/setup.py67
4 files changed, 105 insertions, 0 deletions
diff --git a/workstation/README.md b/workstation/README.md
new file mode 100644
index 00000000..c47bb533
--- /dev/null
+++ b/workstation/README.md
@@ -0,0 +1,3 @@
+```
+$ python3 <(curl https://github.com/alexpdp7/alexpdp7/raw/master/workstation/setup.py -L)
+```
diff --git a/workstation/arch-container-builder b/workstation/arch-container-builder
new file mode 160000
+Subproject 644b9991864010fe53a56e5e59ff31ad39f0f45
diff --git a/workstation/build_workstation b/workstation/build_workstation
new file mode 100755
index 00000000..eee907c0
--- /dev/null
+++ b/workstation/build_workstation
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -ue
+
+(
+ cd arch-container-builder/
+ ./builder.py \
+ --package ansible \
+ --package kubectl \
+ --package emacs-nox \
+ --package puppet \
+ --package sshpass \
+ --package git \
+ --package rust \
+ --package ipython \
+ --package maven \
+ --package python-pip \
+ --package python-pipx \
+ --package python-poetry \
+ --package python-jmespath \
+ --package python-kubernetes \
+ --package python-botocore \
+ --package python-boto3 \
+ --package certbot \
+ --package bitwarden-cli \
+ --package xclip \
+ --package screen \
+ --package man-db \
+ --package isync \
+ --aur-package mu \
+ --aur-package talosctl \
+ --trusted-key-id FE042E3D4085A811 \
+ workstation
+ # for talos, public key "Andrey Smirnov <andrey.smirnov@siderolabs.com>" FE042E3D4085A811
+)
diff --git a/workstation/setup.py b/workstation/setup.py
new file mode 100755
index 00000000..ee824491
--- /dev/null
+++ b/workstation/setup.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+import pathlib
+import shutil
+import subprocess
+import textwrap
+
+
+def _(t):
+ return textwrap.dedent(t).lstrip()
+
+
+print("Installing some packages...")
+subprocess.run(["sudo", "dnf", "install", "-y", "rclone", "fuse", "git", "podman-docker", "wget"], check=True)
+
+home = pathlib.Path.home()
+
+if not (home / ".config" / "rclone" / "rclone.conf").exists():
+ print(_("""
+ Visit https://nextcloud.pdp7.net/nextcloud/index.php/settings/user/security , create an app password
+ """))
+
+ subprocess.run(["rclone", "config", "create", "nextcloud", "webdav", "url=https://nextcloud.pdp7.net/nextcloud/remote.php/dav/files/alex/", "vendor=nextcloud", "user=alex", "--all"], check=True)
+
+
+(home / "Nextcloud").mkdir(exist_ok=True)
+
+
+nextcloud_service_path = home / ".config" / "systemd" / "user" / "nextcloud.service"
+nextcloud_service_path.parent.mkdir(parents=True, exist_ok=True)
+
+
+with open(nextcloud_service_path, "w", encoding="utf8") as f:
+ f.write(_("""
+ [Unit]
+
+ [Service]
+ ExecStart=/usr/bin/rclone mount --vfs-cache-mode=full --dir-perms 700 --file-perms 600 nextcloud: /home/alex/Nextcloud/
+
+ [Install]
+ WantedBy=default.target
+ """))
+
+subprocess.run(["systemctl", "--user", "enable", "--now", "nextcloud"], check=True)
+
+if not (home / ".ssh").exists():
+ subprocess.run(["ln", "-s", "Nextcloud/_ssh", ".ssh"], check=True)
+
+
+dotfiles_dir = home / "Nextcloud" / "dotfiles"
+
+for dotfile in dotfiles_dir.glob("*"):
+ relative_dotfile = dotfile.relative_to(dotfiles_dir)
+ replaced_dotfile = pathlib.Path.home() / ("." + relative_dotfile.parts[0][1:])
+ if not replaced_dotfile.exists():
+ subprocess.run(["ln", "-s", dotfile, replaced_dotfile], check=True)
+
+
+(home / ".local" / "bin").mkdir(exist_ok=True, parents=True)
+
+(home / "git").mkdir(exist_ok=True, parents=True)
+
+distrobox_dir = home / "git" / "distrobox"
+
+if not distrobox_dir.exists():
+ subprocess.run(["git", "clone", "https://github.com/89luca89/distrobox.git", distrobox_dir], check=True)
+
+subprocess.run([distrobox_dir / "install"], check=True)