update + dashdot container + config

This commit is contained in:
nomadics9 2024-10-24 15:26:47 +03:00
parent 87d702f4c3
commit 0131e993d8
15 changed files with 193 additions and 152 deletions

View file

@ -10,11 +10,11 @@
]
},
"locked": {
"lastModified": 1722825873,
"narHash": "sha256-bFNXkD+s9NuidZePiJAjjFUnsMOwXb7hEZ4JEDdSALw=",
"lastModified": 1729444465,
"narHash": "sha256-+lCi3cQlFNGAGKaVeUNhTeR40zvMy9JX4hp1JA0dLwE=",
"owner": "hercules-ci",
"repo": "arion",
"rev": "90bc85532767c785245f5c1e29ebfecb941cf8c9",
"rev": "94d092fffd5cfd4f09b8988aca1b857a9d37c4d6",
"type": "github"
},
"original": {
@ -28,11 +28,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1729099656,
"narHash": "sha256-VftVIg7UXTy1bq+tzi1aVYOWl7PQ35IpjW88yMYjjpc=",
"lastModified": 1729588208,
"narHash": "sha256-PNONdMd+sG7JWzNIDerX7oVZXL8FTVlSAZ1BmUo2HjE=",
"owner": "nix-community",
"repo": "disko",
"rev": "d7d57edb72e54891fa67a6f058a46b2bb405663b",
"rev": "4be2aadf13b67ffbb993deb73adff77c46b728fc",
"type": "github"
},
"original": {
@ -44,11 +44,11 @@
"dotfiles": {
"flake": false,
"locked": {
"lastModified": 1729009831,
"narHash": "sha256-fSN4HZWxIH8n6UPoDDwn4CVA/lw7gQzBmLA2CM0Bx70=",
"lastModified": 1729772180,
"narHash": "sha256-vDLn6/3DxyWFUKdrijmsaW4cuJhjRWCkSA8QlLzW1No=",
"ref": "refs/heads/main",
"rev": "262d5fae27ddb7129a845dc0bb90e93c02407805",
"revCount": 30,
"rev": "8240f7d218f9a93aca818e770da838bc9f628a98",
"revCount": 31,
"type": "git",
"url": "https://github.com/nomadics9/dotfiles.git"
},
@ -144,11 +144,11 @@
]
},
"locked": {
"lastModified": 1729165983,
"narHash": "sha256-gtcodl79t5ZbbX4TSx4RNyggasEvLdVnc/IM+RyxqJw=",
"lastModified": 1729551526,
"narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "78a7a070bbcc3b37cc36080c2a3514207d427b3b",
"rev": "5ec753a1fc4454df9285d8b3ec0809234defb975",
"type": "github"
},
"original": {
@ -191,11 +191,11 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1728156290,
"narHash": "sha256-uogSvuAp+1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss=",
"lastModified": 1729357638,
"narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "17ae88b569bb15590549ff478bab6494dde4a907",
"rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22",
"type": "github"
},
"original": {
@ -207,11 +207,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1728888510,
"narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=",
"lastModified": 1729413321,
"narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c",
"rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
"type": "github"
},
"original": {
@ -240,11 +240,11 @@
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1728345710,
"narHash": "sha256-lpunY1+bf90ts+sA2/FgxVNIegPDKCpEoWwOPu4ITTQ=",
"lastModified": 1729587807,
"narHash": "sha256-YOc4033a/j1TbdLfkaSOSX2SrvlmuM+enIFoveNTCz4=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "06535d0e3d0201e6a8080dd32dbfde339b94f01b",
"rev": "26642e8f193f547e72d38cd4c0c4e45b49236d27",
"type": "github"
},
"original": {

View file

@ -41,7 +41,7 @@
];
forAllSystems = nixpkgs.lib.genAttrs systems;
user = "nomad";
hostname = "vps";
hostname = "unkown";
in
{
packages =

View file

@ -27,13 +27,14 @@ in
"syncthing"
"sleep 3; qsyncthingtray"
"kdeconnect-indicator"
"kdeconnectd"
#"kdeconnectd"
"dbus-update-actvation-environment --systemd --all WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP DBUS_SESSION_BUS_ADDRESS"
];
env = [
"XCURSOR_SIZE,24"
"NIXOS_OZONE_WL,1"
"GTK_THEME,Nightfox-Dark"
];
@ -41,15 +42,17 @@ in
kb_layout = "us,ara";
kb_options = "grp:alt_shift_toggle";
kb_variant = "qwerty_digits";
kb_model = "";
kb_rules = "";
#kb_model = "pc105";
#kb_rules = "evdev";
follow_mouse = 1;
touchpad = {
natural_scroll = true;
disable_while_typing = 1;
tap-to-click = 1;
};
sensitivity = 0;
sensitivity = 0.1;
};
general = {
@ -103,6 +106,10 @@ in
workspace_swipe_min_speed_to_force = 5;
};
misc = {
vfr = true;
};
windowrule = [
"float, file_progress"
"float, confirm"
@ -112,7 +119,7 @@ in
"float, error"
"float, splash"
"float, confirmreset"
"float, title:Open File"
"float, title:Open File" # decrease screen brightness
"float, title:branchdialog"
"float, Lxappearance"
"float, Wofi"
@ -234,14 +241,11 @@ in
"$mainMod, right, resizeactive, 40 0"
"$mainMod, up, resizeactive, 0 -40"
"$mainMod, down, resizeactive, 0 40"
#"XF86AudioMute , exec, $HOME/.config/hypr/scripts/volume mute"
# "XF86AudioLowerVolume, exec, \"$HOME/.config/hypr/scripts/volume down\""
# "XF86AudioRaiseVolume, exec, sh -c \"$HOME/.config/hypr/scripts/volume up\""
# "XF86AudioMicMute, exec, \"pactl set-source-mute @DEFAULT_SOURCE@ toggle\""
#
# "XF86MonBrightnessUp, exec, \"$HOME/hypr/scripts/brightness up\"" # increase screen brightness
# "XF86MonBrightnessDown, exec, \"$HOME/.config/hypr/scripts/brightness down\"" # decrease screen brightness
", XF86AudioMute, exec, $HOME/.config/hypr/scripts/volume mute"
", XF86AudioLowerVolume, exec, $HOME/.config/hypr/scripts/volume down"
", XF86AudioRaiseVolume, exec, $HOME/.config/hypr/scripts/volume up"
", XF86MonBrightnessUp, exec, $HOME/.config/hypr/scripts/brightness up"
", XF86MonBrightnessDown, exec, $HOME/.config/hypr/scripts/brightness down"
];

View file

@ -17,7 +17,7 @@ in
mainBar = {
height = 20;
layer = "top";
modules-left = [ "custom/launcher" "cpu" "memory" "custom/weather" "hyprland/workspaces" ];
modules-left = [ "custom/launcher" "custom/wg" "cpu" "memory" "custom/weather" "hyprland/workspaces" ];
modules-center = [ "mpris" ];
modules-right = [ "network" "pulseaudio" "backlight" "battery" "clock" "tray" "hyprland/language" "custom/wallpaper" "idle_inhibitor" "custom/refresh-rate" ];
@ -98,6 +98,13 @@ in
format-icons = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ];
};
"custom/wg" = {
exec = "~/.config/hypr/scripts/wg-status.sh";
interval = 5;
format = "{}";
on-click = "~/.config/hypr/scripts/wg-toggle.sh";
};
"bluetooth" = {
format = "{icon}";
format-alt = "bluetooth: {status}";
@ -230,6 +237,7 @@ in
#custom-launcher,
#custom-spotify,
#custom-weather,
#custom-wg,
#custom-weather.severe,
#custom-weather.sunnyDay,
#custom-weather.clearNight,

View file

@ -10,14 +10,16 @@ in
options.features.themes.qt.enable = mkEnableOption "qt theme";
config = mkIf cfg.enable {
qt.enable = true;
qt.platformTheme.name = "adwaita";
qt.style = {
name = "adwaita-dark";
qt = {
enable = true;
platformTheme.name = "adwaita";
style = {
name = "Adwaita-dark";
};
};
home.packages = with pkgs; [
home.packages = with pkgs;
[
adwaita-qt6
];
};

View file

@ -30,16 +30,23 @@
wayland.windowManager.hyprland = {
settings = {
device = [
{
name = "keyboard";
kb_layout = "us,ara";
}
{
name = "mouse";
sensitivity = -0.5;
}
];
# device = [
# {
# name = "33a6c9b0";
# kb_layout = "us,ara";
# kb_variant = "qwerty_digits";
# kb_options = "grp:alt_shift_toggle";
# }
# {
# name = "338ebb50"; # xiaomi-wmi-keys
# kb_layout = "us";
# kb_options = ""; # Custom options if needed
# }
# {
# name = "38db2b20";
# sensitivity = 0.5;
# }
# ];
monitor = [
"eDP-1,2560x1600@60,0x0,1.25"
"DP-2,1920x1080@60,auto,1"

View file

@ -115,15 +115,15 @@
NIXOS_OZONE_WL = "1";
MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_DRM_DEVICE = "/dev/dri/card0:/dev/dri/card1";
WLR_DRM_DEVICES = "/dev/dri/card0:/dev/dri/card1";
#_JAVA_AWT_WM_NONREPARENTING = "1";
#MOZ_DRM_DEVICE = "/dev/dri/card0:/dev/dri/card1";
#WLR_DRM_DEVICES = "/dev/dri/card0:/dev/dri/card1";
#WLR_NO_HARDWARE_CURSORS = "1"; # if no cursor,uncomment this line
#GBM_BACKEND = "nvidia-drm";
CLUTTER_BACKEND = "wayland";
#CLUTTER_BACKEND = "wayland";
LIBVA_DRIVER_NAME = "iHD";
WLR_RENDERER = "vulkan";
VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json";
#WLR_RENDERER = "vulkan";
#VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json";
#__GLX_VENDOR_LIBRARY_NAME = "nvidia";
#__NV_PRIME_RENDER_OFFLOAD = "1";
XDG_CURRENT_DESKTOP = "Hyprland";

View file

@ -58,8 +58,6 @@
NEXTCLOUD_DB = "${config.sops.placeholder.NEXTCLOUD_DB}"
'';
users.users = { };
programs.zsh.enable = true;
home-manager.users.${user} =
import ../../../home/${user}/${config.networking.hostName}.nix;

View file

@ -0,0 +1,42 @@
{ config, lib, pkgs, user, ... }:
with lib;
let
dashdotService = {
project.name = "dashdot";
services = {
dashdot = {
service = {
image = "mauricenino/dashdot:latest";
restart = "unless-stopped";
privileged = true;
ports = [
"19999:3001"
];
volumes = [
"/:/mnt/host:ro"
];
environment = {
DASHDOT_PAGE_TITLE = "Nomadics VPS";
DASHDOT_ALWAYS_SHOW_PERCENTAGES = "true";
};
};
};
};
};
in
{
options.vps.dashdot.enable = mkEnableOption "Enable dashdot dashboard for VPS";
config = mkIf config.vps.dashdot.enable {
virtualisation.arion = {
backend = "docker";
projects.dashdot = {
serviceName = "dashdot";
settings = dashdotService;
};
};
};
}

View file

@ -5,6 +5,7 @@
./pairdrop.nix
./syncthing.nix
./vpn.nix
./dashdot.nix
];
}

View file

@ -15,12 +15,13 @@ let
service.command = [
"/data"
"-a"
"???:???@/:rw"
''???:???#fs@/:rw'' # till i figure out how to pass the damn env
"-A"
"-a"
"@/p"
];
service.env_file = [ "${config.sops.templates."my-env.env".path}" ];
};
};
};

View file

@ -54,6 +54,11 @@
autoSuspend = true;
};
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
#Network
#Define your hostname
networking.hostName = "${hostname}";
@ -121,11 +126,6 @@
zsh
];
programs.hyprland = {
enable = true;
xwayland.enable = true;
};
#Firewall
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];

View file

@ -9,7 +9,7 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" ];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "i915" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];

View file

@ -26,9 +26,9 @@ in
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
# intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
# libvdpau-va-gl
# vaapiVdpau
# mesa.drivers
libvdpau-va-gl
vaapiVdpau
mesa.drivers
];
};

View file

@ -23,6 +23,7 @@
pairdrop.enable = true;
syncthing.enable = true;
vpn.enable = true;
dashdot.enable = true;
};
sops = {
@ -38,34 +39,38 @@
# Configure log format using mkForce to make sure it takes effect
logFormat = lib.mkForce ''
level INFO
output file /var/log/caddy/access.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
format caddy
'';
# Reverse proxy configuration for each domain
extraConfig = ''
(logging) {
log {
output file /var/log/caddy/{args[0]}.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
}
}
fs.nmd.mov {
reverse_proxy localhost:5000
log
import logging fs
}
vpn.nmd.mov {
reverse_proxy localhost:51821
log
import logging vpn
}
s.nmd.mov {
reverse_proxy localhost:8384
log
import logging s
}
drop.nmd.mov {
reverse_proxy localhost:3000
log
import logging drop
}
dot.nmd.mov {
@ -76,13 +81,20 @@
}
}
dash.nmd.mov {
reverse_proxy localhost:8080
}
nmd.mov {
root * /var/www/goaccess
file_server
reverse_proxy /ws localhost:7890
reverse_proxy /ws_fs localhost:7890
reverse_proxy /ws_drop localhost:7891
reverse_proxy /ws_vpn localhost:7892
reverse_proxy /ws_sync localhost:7893
basic_auth /* {
nomad $2a$12$toBh5sfXyxigtHGNY4t8tO7YYQp6i3aZk/O0qd19lgk0LRz5eqDVi
@ -91,36 +103,6 @@
}
'';
};
services.netdata = {
enable = true;
package = pkgs.netdata.override {
withCloudUi = true;
};
extraPluginPaths = [ "/etc/netdata/custom-plugins.d" ];
configDir = {
# Add the custom plugin script to the Netdata configuration directory
"plugins.d/caddy_visitors.sh" = pkgs.writeText "caddy_visitors.sh" ''
#!/bin/env/sh
# Path to the Caddy JSON access log file
log_file="/var/log/caddy/access.log"
# Extract unique visitor IPs from JSON log file
unique_visitors=$(jq -r "select(.request.remote_ip != null) | .request.remote_ip" "$log_file" | sort | uniq | wc -l)
# Define the chart
echo CHART caddy_visitors.unique_ips "Unique Visitors from Caddy Logs" "IPs" "Caddy Logs" caddy_visitors line $((netdata_update_every * 10)) 1
echo DIMENSION unique_visitors "" absolute 1 1
# Output the result in a format that Netdata understands
echo BEGIN caddy_visitors.unique_ips
echo SET unique_visitors = $unique_visitors
echo END
'';
};
};
networking.useDHCP = lib.mkForce false;
services.cloud-init = {
@ -185,10 +167,6 @@
22
80
443
5000
4400
3000
8384
22000
51821
];