From b6f93f60e4c42abbfb020aefcebaf446e873ef2e Mon Sep 17 00:00:00 2001 From: arnaucube Date: Sat, 8 Nov 2025 17:04:36 +0100 Subject: [PATCH] various updates on nixos,sway,scripts&dockercompose --- install-new-server.sh | 11 ++-- nixos/common-configuration.nix | 63 +++++++++++++++--- server-dockers/docker-compose.yml | 104 +++++++++++++++--------------- sway/config | 30 +++++++-- sway/status.sh | 19 ++++-- 5 files changed, 154 insertions(+), 73 deletions(-) diff --git a/install-new-server.sh b/install-new-server.sh index b4a3148..ae8b62d 100644 --- a/install-new-server.sh +++ b/install-new-server.sh @@ -74,13 +74,14 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # needed for later rust packages installations apt install build-essential -y +apt install pkg-config libssl-dev -y # btop -wget https://github.com/aristocratos/btop/releases/download/v1.3.0/btop-x86_64-linux-musl.tbz -tar -xjf btop-x86_64-linux-musl.tbz -cd btop -bash install.sh -cd .. +# wget https://github.com/aristocratos/btop/releases/download/v1.3.0/btop-x86_64-linux-musl.tbz +# tar -xjf btop-x86_64-linux-musl.tbz +# cd btop +# bash install.sh +# cd .. # # assuming that Rust is installed # echo "installing delta (gitdiff tool)" diff --git a/nixos/common-configuration.nix b/nixos/common-configuration.nix index a391be5..3430d98 100644 --- a/nixos/common-configuration.nix +++ b/nixos/common-configuration.nix @@ -18,7 +18,7 @@ LC_NUMERIC = "es_ES.UTF-8"; LC_PAPER = "es_ES.UTF-8"; LC_TELEPHONE = "es_ES.UTF-8"; - LC_TIME = "es_ES.UTF-8"; + LC_TIME = "en_US.UTF-8"; }; # services.displayManager = { @@ -45,7 +45,8 @@ }; # --- sway wm config: services.xserver.displayManager.gdm.enable=true; - services.xserver.displayManager.gdm.wayland=false; + #services.displayManager.sessionPackages = [ pkgs.sway ]; + #services.xserver.displayManager.gdm.wayland=false; #services.xserver.displayManager.plasma5.enable=true; # Enable the gnome-keyring secrets vault. # Will be exposed through DBus to programs willing to store secrets. @@ -86,6 +87,10 @@ pulseaudio usbutils time + #impala # nmtui alternative + fastfetch + rpm + pdfgrep # to find strings across pdfs in directories # code editors vim @@ -123,6 +128,9 @@ gimp calibre tauon + libsForQt5.kdenlive + libreoffice-qt6 + ffmpeg # browsers firefox @@ -142,11 +150,21 @@ ; }) gnumake - #gcc + gcc clang clang-tools + openssl openssl.dev + glib # GLib base library + #gio # GIO library + gdk-pixbuf # GDK Pixbuf library + gtk3 # GTK3 including GDK, relevant for gdk-sys + atk # Accessibility Toolkit + cairo # 2D graphics library + pango # Text layout and rendering + pkg-config # Needed for pkg-config to find .pc files + cmake stdenv rustup @@ -163,6 +181,7 @@ qmk meshtastic esptool # meshtastic related unicodeit + setuptools ])) pipx nodejs @@ -178,9 +197,20 @@ ]; environment.variables = { - LIBCLANG_PATH = "${pkgs.llvmPackages_17.libclang.lib}/lib"; + OPENSSL_DEV = "${pkgs.openssl.dev}"; + OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib"; + OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include"; PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; - OPENSSL_DIR = "${pkgs.openssl.dev}"; + + OPENSSL_NO_VENDOR="1"; + OPENSSL_STATIC="0"; + + # for screen sharing in sway + XDG_CURRENT_DESKTOP = "sway"; + XDG_SESSION_TYPE="wayland"; + + WAYLAND_DISPLAY="wayland-1"; + XDG_RUNTIME_DIR="/run/user/$(id -u)"; }; fonts.packages = with pkgs; [ @@ -207,18 +237,33 @@ xdg.mime.defaultApplications = { "application/pdf" = "zathura"; }; + xdg.portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; + }; # gvfs needed for Thunar to detect external disks services.gvfs.enable = true; + hardware.graphics.enable = true; + # bluetooth related hardware.bluetooth.enable = true; services.blueman.enable = true; #hardware.pulseaudio.enable = true; - services.pulseaudio.enable = true; - services.pipewire.enable=false; - services.pipewire.pulse.enable=false; + #services.pulseaudio.enable = true; + #services.pipewire.pulse.enable=false; + #services.pipewire.enable=false; + services.pipewire = { + enable = true; # Enable PipeWire service + alsa.enable = true; # Enable ALSA support (audio hardware) + alsa.support32Bit = true; # Support 32-bit apps on 64-bit systems + pulse.enable = true; # Enable PipeWire PulseAudio replacement + wireplumber.enable = true; # Enable WirePlumber session manager (recommended) + jack.enable = true; # Enable JACK support if needed + }; # udev rules (for Vial) services.udev.extraRules = '' @@ -231,4 +276,6 @@ via vial ]; + + nix.settings.extra-experimental-features = [ "nix-command" "flakes" ]; } diff --git a/server-dockers/docker-compose.yml b/server-dockers/docker-compose.yml index 06b7fdf..667ee54 100644 --- a/server-dockers/docker-compose.yml +++ b/server-dockers/docker-compose.yml @@ -66,18 +66,18 @@ services: - SYMFONY__ENV__DOMAIN_NAME=http://192.168.1.155:8098 restart: unless-stopped - # slskd: - # image: slskd/slskd - # container_name: slskd - # ports: - # - "8099:5030" - # - "50300:50300" - # volumes: - # - /mnt/usb/configurations/slkskd:/app - # - /mnt/usb/audio/slskd-downloads:/downloads - # environment: - # - SLSKD_REMOTE_CONFIGURATION=true - # restart: unless-stopped + slskd: + image: slskd/slskd + container_name: slskd + ports: + - "8099:5030" + - "50300:50300" + volumes: + - /mnt/usb/configurations/slskd:/app + - /mnt/usb/audio/slskd-downloads:/downloads # isolate it in a subdir, since slskd removes arbitrary files on that dir + environment: + - SLSKD_REMOTE_CONFIGURATION=true + restart: unless-stopped metube: image: ghcr.io/alexta69/metube @@ -117,48 +117,48 @@ services: restart: unless-stopped # metrics related: - prometheus: - image: prom/prometheus:latest - container_name: prometheus - ports: - - "9090:9090" - volumes: - - ./prometheus.yml:/etc/prometheus/prometheus.yml - - prometheus_data:/prometheus - networks: - - monitoring - restart: unless-stopped - - node-exporter: - image: prom/node-exporter:latest - container_name: node-exporter - ports: - - "9100:9100" - networks: - - monitoring - restart: unless-stopped - - grafana: - image: grafana/grafana:latest - container_name: grafana - ports: - - "3000:3000" - environment: - - GF_SECURITY_ADMIN_PASSWORD=admin - volumes: - - grafana_data:/var/lib/grafana - networks: - - monitoring - depends_on: - - prometheus - restart: unless-stopped + # prometheus: + # image: prom/prometheus:latest + # container_name: prometheus + # ports: + # - "9090:9090" + # volumes: + # - ./prometheus.yml:/etc/prometheus/prometheus.yml + # - prometheus_data:/prometheus + # networks: + # - monitoring + # restart: unless-stopped + # + # node-exporter: + # image: prom/node-exporter:latest + # container_name: node-exporter + # ports: + # - "9100:9100" + # networks: + # - monitoring + # restart: unless-stopped + # + # grafana: + # image: grafana/grafana:latest + # container_name: grafana + # ports: + # - "3000:3000" + # environment: + # - GF_SECURITY_ADMIN_PASSWORD=admin + # volumes: + # - grafana_data:/var/lib/grafana + # networks: + # - monitoring + # depends_on: + # - prometheus + # restart: unless-stopped networks: monitoring: driver: bridge -volumes: - prometheus_data: - driver: local - grafana_data: - driver: local +#volumes: +# prometheus_data: +# driver: local +# grafana_data: +# driver: local diff --git a/sway/config b/sway/config index f231093..0deb4ef 100644 --- a/sway/config +++ b/sway/config @@ -1,6 +1,4 @@ -# Default config for sway -# -# Copy this to ~/.config/sway/config and edit it to your liking. +# Sway config file, placed at ~/.config/sway/config # # Read `man 5 sway` for a complete reference. @@ -29,9 +27,18 @@ output * bg ~/Sync-tablet/wallpapers/geometry02_croped1920x1080.png fill # output HDMI-A-1 resolution 1920x1080 position 1920,0 # # You can get the names of your outputs by running: swaymsg -t get_outputs + +# home setup: output HDMI-A-1 resolution 3840x2160 position 1920 0 output eDP-1 resolution 1920x1200 position 0 0 +# portable external monitor setup: +# output DP-1 resolution 3840x2160 position 1920 0 +# output eDP-1 resolution 1920x1200 position 0 0 +# output DP-1 { +# transform 270 +# } + ### Idle configuration # # Example configuration: @@ -242,7 +249,22 @@ bindsym $mod+Control+Shift+b exec sed -i 's/\"Bold\"#tag_for_shortcut/\"Regular\ # move current workspace to another display bindsym $mod+Control+k move workspace to output HDMI-A-1 -# bindsym $mod+Control+k move workspace to output DP-1 bindsym $mod+Control+j move workspace to output eDP-1 +# bindsym $mod+Control+j move workspace to output DP-1 +# bindsym $mod+Control+k move workspace to output eDP-1 +# bindsym $mod+Control+k move workspace to output DP-1 + +# remap capslock to control +input * { + xkb_options ctrl:nocaps +} + +# for screen sharing +exec systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP +exec dbus-update-activation-environment WAYLAND_DISPLAY +# systemctl --user daemon-reexec +# systemctl --user restart pipewire +# systemctl --user restart xdg-desktop-portal +# systemctl --user restart xdg-desktop-portal-wlr include /etc/sway/config.d/* diff --git a/sway/status.sh b/sway/status.sh index 4d37ef0..569e33e 100755 --- a/sway/status.sh +++ b/sway/status.sh @@ -5,8 +5,8 @@ uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5) -# date and time format: Tue 2025-08-19 22:37 -date_formatted=$(date "+%a %F %H:%M") +temp_raw=$(cat /sys/class/thermal/thermal_zone0/temp) +temp=$(($temp_raw / 1000)) volume=$(pactl get-sink-volume @DEFAULT_SINK@ | awk '{print $5}') muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') @@ -19,5 +19,16 @@ muted=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') battery_status=$(cat /sys/class/power_supply/BAT0/status) # "Full", "Discharging", or "Charging" battery_capacity=$(cat /sys/class/power_supply/BAT0/capacity) # % -# πŸ’Ž πŸ’» πŸ’‘ πŸ”Œ ⚑ πŸ“ \| 🐧 -echo $uptime_formatted ↑ $volume $muted πŸ”Š $battery_status $battery_capacity% πŸ”‹ $date_formatted +# date and time format: Tue 2025-08-19 22:37 +datetime=$(date "+%a %F %H:%M:%S") + +interface=$(ip route get 8.8.8.8 | awk -F'dev ' 'NR==1{split($2,a," ");print a[1]}') +ip=$(ip addr show dev $interface | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1) + +avail_space=$(df -h / | awk 'NR==2 {print $4}') + + + + +# πŸ’Ž πŸ’» πŸ’‘ πŸ”Œ ⚑ πŸ“ \| 🐧 πŸ”Š πŸ”‹ +echo $avail_space \| $tempΒ°C \| $uptime_formatted \| vol: $volume $muted \| $battery_status $battery_capacity% \| $interface $ip \| $datetime