various updates on nixos,sway,scripts&dockercompose

This commit is contained in:
2025-11-08 17:04:36 +01:00
parent 7e8e812814
commit b6f93f60e4
5 changed files with 154 additions and 73 deletions

View File

@@ -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)"

View File

@@ -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" ];
}

View File

@@ -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

View File

@@ -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/*

View File

@@ -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