@@ -211,6 +211,8 @@ spec:
mountPath: /home/oleg/.config/google-chrome
- name: root-bash-history
mountPath: /root/.bash_history
+ - name: home-oleg-config-wayvnc
+ mountPath: /home/oleg/.config/wayvnc
- image: harbor.home.wugi.info/library/archlinux-systemd:latest
name: archlinux
env:
@@ -377,3 +379,7 @@ spec:
hostPath:
path: /home/oleg/.config/SocialStream
type: Directory
+ hostPath:
+ path: /home/oleg/.config/wayvnc
+ type: Directory
@@ -9,6 +9,6 @@ images:
- name: harbor.home.wugi.info/library/guix-image-workstation
newTag: "6677e699"
- name: harbor.home.wugi.info/library/nixos-systemd
- newTag: 2072d060
+ newTag: 096ce36c
- name: harbor.home.wugi.info/library/archlinux-systemd
newTag: 7a1dcb6c
@@ -268,11 +268,11 @@
},
"locked": {
"dir": "dotfiles/nix",
- "lastModified": 1730144252,
- "narHash": "sha256-SW+sXYYx8zFAQKtyt4QHzcNl/94DTtojLjNLty9YasU=",
+ "lastModified": 1730969505,
+ "narHash": "sha256-SA93MeHv9mAKUjepn4Dx+1wmnbqNmwwJ+nwfbUCN2Ag=",
"ref": "refs/heads/master",
- "rev": "432b65e10e93c4b57b2c24ba1cdbfb01e0825238",
- "revCount": 11928,
+ "rev": "0e5a3a91a88372093182a60c711889fa92f2a025",
+ "revCount": 11963,
"type": "git",
"url": "file:///home/oleg/.local/share/chezmoi?dir=dotfiles/nix"
@@ -20,6 +20,8 @@
chatterino2
tmux
+
+ wayvnc
];
home.file = {
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+set -o nounset -o errexit -o pipefail -o xtrace
+NAMESPACE="$(/home/oleg/.local/share/chezmoi/dotfiles/run/pc0/11-nerdctl-namespace.sh)"
+ip link add macvlan3 link eth0 type macvlan mode bridge
+ip link set macvlan3 netns "$NAMESPACE"
+ip netns exec "$NAMESPACE" ip link set macvlan3 up
+ip netns exec "$NAMESPACE" ip addr add 192.168.0.195/24 dev macvlan3
+ip netns exec "$NAMESPACE" ping -c 3 192.168.0.145
@@ -0,0 +1,19 @@
+set -o nounset -o errexit -o pipefail
+PATH="/home/oleg/.guix-profile/bin:/gnu/store/3q2x34wg1fff833wwzxnagnv7vbfxb0w-jc-1.25.2/bin:$PATH"
+export PATH
+container_id="$(nerdctl -n k8s.io ps --format=json | jq --raw-output '. | select (.Image | startswith("harbor.home.wugi.info/library/nixos-systemd")) | .ID')"
+process_id="$(nerdctl -n k8s.io top "$container_id" | jc --ps | jq --raw-output '.[0].pid')"
+ip_address="$(nsenter -t "$process_id" -n ip -json a | jq --raw-output '.[] | select(.ifname == "eth0") | .addr_info[] | select(.family == "inet") | .local')"
+mapfile -t network_namespaces < <(ip -json -all netns | jq --raw-output '.[].name')
+for network_namespace in "${network_namespaces[@]}"
+do
+ if [[ $ip_address == $(ip netns exec "$network_namespace" ip -json a | jq --raw-output '.[] | select(.ifname == "eth0") | .addr_info[] | select(.family == "inet") | .local') ]]
+ then
+ echo "$network_namespace"
+ exit 0
+ fi
+done