Skip to content

Commit

Permalink
guix-workstation: Move mounts to Kubernetes Pod definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
wigust committed Oct 25, 2024
1 parent 94a4d33 commit 18c43e0
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 49 deletions.
82 changes: 82 additions & 0 deletions apps/base/workstation/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,28 @@ spec:
restartPolicy: Never
automountServiceAccountToken: false
terminationGracePeriodSeconds: 600
initContainers:
- name: volume-mount-hack
image: busybox
command:
- sh
- -c
- |
set -o nounset -o errexit -o pipefail
chown 1000:998 /home/oleg
mkdir /home/oleg/.config
chown 1000:998 /home/oleg/.config
mkdir -p /home/oleg/.local/share
chown 1000:998 /home/oleg/.local/share
mkdir -p /home/oleg/.cache
chown 1000:998 /home/oleg/.local/share
volumeMounts:
- mountPath: /home/oleg
name: container-home-oleg
containers:
- image: harbor.home.wugi.info/library/guix-image-workstation:latest
name: guix
Expand Down Expand Up @@ -100,6 +122,27 @@ spec:
name: tmp
- mountPath: /mnt/guix/var/run/shepherd/socket
name: var-run-shepherd-socket
- mountPath: /home/oleg
name: container-home-oleg
- mountPath: /home/oleg/.config/google-chrome
name: google-chrome
- name: home-oleg-dot-cache-ihs
mountPath: /home/oleg/.cache/ihs
- name: home-oleg-dot-config-google-chrome
mountPath: /home/oleg/.config/google-chrome
- name: home-oleg-dot-config-obs-studio
mountPath: /home/oleg/.config/obs-studio
- name: home-oleg-dot-local-share-remmina
mountPath: /home/oleg/.local/share/remmina
- name: home-oleg-dot-local-share-TelegramDesktop
mountPath: /home/oleg/.local/share/TelegramDesktop
- name: home-oleg-dot-mozilla
mountPath: /home/oleg/.mozilla
- name: home-oleg-dot-password-store
mountPath: /home/oleg/.password-store
- name: nix
mountPath: /nix
readOnly: true
lifecycle:
preStop:
exec:
Expand Down Expand Up @@ -232,3 +275,42 @@ spec:
hostPath:
path: /var/run/shepherd/socket
type: Socket
- emptyDir:
sizeLimit: 4G
name: container-home-oleg
- name: google-chrome
hostPath:
path: /home/oleg/.config/google-chrome
type: Directory
- name: home-oleg-dot-cache-ihs
hostPath:
path: /home/oleg/.cache/ihs
type: Directory
- name: home-oleg-dot-config-google-chrome
hostPath:
path: /home/oleg/.config/google-chrome
type: Directory
- name: home-oleg-dot-config-obs-studio
hostPath:
path: /home/oleg/.config/obs-studio
type: Directory
- name: home-oleg-dot-local-share-remmina
hostPath:
path: /home/oleg/.local/share/remmina
type: Directory
- name: home-oleg-dot-local-share-TelegramDesktop
hostPath:
path: /home/oleg/.local/share/TelegramDesktop
type: Directory
- name: home-oleg-dot-mozilla
hostPath:
path: /home/oleg/.mozilla
type: Directory
- name: home-oleg-dot-password-store
hostPath:
path: /home/oleg/.password-store
type: Directory
- name: nix
hostPath:
path: /nix
type: Directory
5 changes: 1 addition & 4 deletions dotfiles/guixsd/guix-image-workstation.scm
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ allow-preset-passphrase"))))
#$(file-append firefox "/bin/firefox") "--profile" (string-append home "/.mozilla/firefox/twitch"))))))))
(simple-service 'bin-manual-scripts
home-files-service-type
(list `("bin/manual-scripts-root-01-fs.sh"
,(local-file (string-append %project-directory "/dotfiles/run/guix-workstation/01-fs.sh")
#:recursive? #t))
`("bin/manual-scripts-root-02-net.sh"
(list `("bin/manual-scripts-root-02-net.sh"
,(local-file (string-append %project-directory "/dotfiles/run/guix-workstation/03-net.sh")
#:recursive? #t))
`("bin/manual-scripts-root-03-firefox-twitch-namespace.sh"
Expand Down
41 changes: 0 additions & 41 deletions dotfiles/run/guix-workstation/01-fs.sh

This file was deleted.

4 changes: 0 additions & 4 deletions dotfiles/run/pc0/13-guix-workstation-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ container_id="$(guix_workstation_id)"
/home/oleg/.local/share/chezmoi/dotfiles/run/pc0/09-firefox-twitch-namespace.sh

nerdctl -n k8s.io exec "$container_id" /run/current-system/profile/bin/bash -lc '
if ! mountpoint -q /home/oleg/.config/google-chrome
then
/home/oleg/bin/manual-scripts-root-01-fs.sh
fi
export PATH=/home/oleg/.guix-home/profile/bin:$PATH
if /home/oleg/bin/manual-scripts-root-02-net.sh
then
Expand Down

0 comments on commit 18c43e0

Please sign in to comment.