From 81c0da4b6c6c2789e5d7ce47f8c2c6947afb211e Mon Sep 17 00:00:00 2001 From: DerGrumpf Date: Sat, 3 May 2025 13:19:50 +0200 Subject: [PATCH] Changed: Programms --- flake.nix | 6 ++ home/hyprland/hyprland.nix | 99 ++++++++++++++----------- home/hyprland/rofi/default.nix | 4 + home/hyprland/waybar/configs/weather.py | 4 +- home/hyprland/waybar/double-monitor.nix | 3 +- hosts/m920q/default.nix | 11 ++- modules/canon_eos_550d.nix | 25 +++++++ modules/python.nix | 13 ---- modules/start-webcam.nix | 4 + modules/system.nix | 4 +- modules/{geary.nix => thunderbird.nix} | 0 users/phil/home.nix | 2 +- 12 files changed, 104 insertions(+), 71 deletions(-) create mode 100644 modules/canon_eos_550d.nix delete mode 100644 modules/python.nix create mode 100644 modules/start-webcam.nix rename modules/{geary.nix => thunderbird.nix} (100%) diff --git a/flake.nix b/flake.nix index db22878..5957b51 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,12 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; hyprland.url = "github:hyprwm/Hyprland"; + + /*nixvim = { + url = "github:nix-community/nixvim/nixos-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + };*/ + catppuccin.url = "github:catppuccin/nix"; home-manager.url = "github:nix-community/home-manager/release-24.11"; diff --git a/home/hyprland/hyprland.nix b/home/hyprland/hyprland.nix index cdf2f33..f9f27cf 100644 --- a/home/hyprland/hyprland.nix +++ b/home/hyprland/hyprland.nix @@ -7,7 +7,7 @@ let theme = "-theme $HOME/.config/rofi/catppuccin-default.rasi"; menu = "rofi -show drun ${theme}"; filebrowser = "rofi -show filebrowser ${theme}"; - power = "~/.config/rofi/powermenu/type-6/powermenu.sh"; + power = "rofi -show p -modi p:rofi-power-menu"; in { home.packages = with pkgs; [ @@ -105,48 +105,48 @@ in allow_tearing = false; }; - decoration = { - rounding = 12; + decoration = { + rounding = 12; - shadow = { - enabled = true; - range = 16; - render_power = 4; - ignore_window = true; - color = "$green"; - color_inactive = "$red"; - }; + shadow = { + enabled = true; + range = 16; + render_power = 4; + ignore_window = true; + color = "$green"; + color_inactive = "$red"; + }; - blur = { - enabled = true; - size = 1; - passes = 3; - new_optimizations = 1; - noise = 0.04; - }; - }; + blur = { + enabled = true; + size = 1; + passes = 3; + new_optimizations = 1; + noise = 0.04; + }; + }; - animations = { - enabled = "yes"; - bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; - animation = [ - "windows, 1, 7, myBezier" - "windowsOut, 1, 7, default, popin 80%" - "border, 1, 10, default" - "borderangle, 1, 8, default" - "fade, 1, 7, default" - "workspaces, 1, 6, default" - ]; - }; + animations = { + enabled = "yes"; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + animation = [ + "windows, 1, 7, myBezier" + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + ]; + }; - layerrule = [ - "blur,gtk-layer-shell" - "ignorezero,gtk-layer-shell" - "blur,notifications" - "ignorezero,notifications" - "blur,rofi" - "ignorezero,rofi" - ]; + layerrule = [ + "blur,gtk-layer-shell" + "ignorezero,gtk-layer-shell" + "blur,notifications" + "ignorezero,notifications" + "blur,rofi" + "ignorezero,rofi" + ]; dwindle = { @@ -174,6 +174,15 @@ in windowrulev2 = "suppressevent maximize, class:.*"; + windowrule = [ + "opacity 0.0 override, class:^(xwaylandvideobridge)$" + "noanim, class:^(xwaylandvideobridge)$" + "noinitialfocus, class:^(xwaylandvideobridge)$" + "maxsize 1 1, class:^(xwaylandvideobridge)$" + "noblur, class:^(xwaylandvideobridge)$" + "nofocus, class:^(xwaylandvideobridge)$" + ]; + exec-once = [ "waybar &" "hyprpaper &" @@ -189,12 +198,12 @@ in "${super}, V, togglefloating, " "${super}, R, exec, ${menu}" "${super}, S, exec, ${power}" - "${super}, F, exec, ${filebrowser}" + "${super}, F, exec, ${filebrowser}" "${super}, P, pseudo, " # dwindle "${super}, J, togglesplit, "# dwindle - "${super}, O, exec, obsidian" - "${super}, I, exec, firefox" - "${super}, G, exec, thunderbird" + "${super}, O, exec, obsidian" + "${super}, I, exec, firefox" + "${super}, G, exec, thunderbird" # Move focus with mainMod + arrow keys "${super}, left, movefocus, l" @@ -236,8 +245,8 @@ in # Screenshot ''${super}, Z, exec, grim -g "$(slurp)" $HOME/Pictures/Screenshots/$(date +'%s_grim.png')'' - ''${super}, U, exec, grim $HOME/Pictures/Screenshots/$(date +'%s_grim.png')'' - ]; + ''${super}, U, exec, grim $HOME/Pictures/Screenshots/$(date +'%s_grim.png')'' + ]; bindl = [ #", XF86AudioMute, exec, amixer set Master toggle diff --git a/home/hyprland/rofi/default.nix b/home/hyprland/rofi/default.nix index d9c7382..874f590 100644 --- a/home/hyprland/rofi/default.nix +++ b/home/hyprland/rofi/default.nix @@ -3,6 +3,10 @@ config, ... }: { + home.packages = with pkgs; [ + rofi-power-menu + ]; + programs.rofi = { enable = true; cycle = false; diff --git a/home/hyprland/waybar/configs/weather.py b/home/hyprland/waybar/configs/weather.py index eecffff..4657f3d 100755 --- a/home/hyprland/waybar/configs/weather.py +++ b/home/hyprland/waybar/configs/weather.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!nix-shell python3 -p "python3.withPackages (ps: with ps; [requests])" import datetime import json @@ -6,8 +6,6 @@ import requests import statistics import sys - - # TODO # - snowfall data # - weather warnings diff --git a/home/hyprland/waybar/double-monitor.nix b/home/hyprland/waybar/double-monitor.nix index fb76e17..23ac537 100644 --- a/home/hyprland/waybar/double-monitor.nix +++ b/home/hyprland/waybar/double-monitor.nix @@ -127,7 +127,6 @@ ]; modules-center = [ - "custom/weather" ]; modules-right = [ @@ -143,7 +142,7 @@ }; "custom/weather" = { - exec = "python3 ~/.config/waybar/weather.py waybar"; + exec = "~/.config/waybar/weather.py waybar"; restart-interval = 900; return-type = "json"; }; diff --git a/hosts/m920q/default.nix b/hosts/m920q/default.nix index b0b6325..0389a75 100644 --- a/hosts/m920q/default.nix +++ b/hosts/m920q/default.nix @@ -5,8 +5,7 @@ { config, pkgs, lib, ... }: { - imports = - [ + imports = [ ../../modules/system.nix ../../modules/nix-settings.nix ../../modules/vpn.nix @@ -20,10 +19,10 @@ ../../modules/regreet/regreet.nix ../../modules/plymouth.nix ../../modules/file_managers/spacefm.nix - ../../modules/python.nix - ../../modules/appimage.nix - ../../modules/qemu.nix - ../../modules/geary.nix + ../../modules/appimage.nix + ../../modules/qemu.nix + ../../modules/thunderbird.nix + ../../modules/canon_eos_550d.nix # Include the results of the hardware scan. ./hardware-configuration.nix ]; diff --git a/modules/canon_eos_550d.nix b/modules/canon_eos_550d.nix new file mode 100644 index 0000000..a304c73 --- /dev/null +++ b/modules/canon_eos_550d.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: +{ + + services.udev.extraRules = '' + ACTION=="add", \ + SUBSYSTEM=="usb", \ + ATTR{idVendor}=="04a9", \ + ATTR{idProduct}=="31ea", \ + ''; +# RUN+="systemctl restart webcam" + + systemd.services.webcam = { + enable = true; + script = '' + ${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie | + ${pkgs.ffmpeg}/bin/ffmpeg \ + -i - \ + -vcodec rawvideo \ + -pix_fmt yuv420p \ + -f v4l2 \ + /dev/video0 + ''; + #wantedBy = [ "multi-user.target" ]; + }; +} diff --git a/modules/python.nix b/modules/python.nix deleted file mode 100644 index 0255ba5..0000000 --- a/modules/python.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ...}: -{ - - environment.systemPackages = with pkgs; [ - (python3.withPackages (python-pkgs: with python-pkgs; [ - pandas - requests - numpy - scipy - ])) - ]; - -} diff --git a/modules/start-webcam.nix b/modules/start-webcam.nix new file mode 100644 index 0000000..1be8333 --- /dev/null +++ b/modules/start-webcam.nix @@ -0,0 +1,4 @@ +with import { }; +writeShellScriptBin = "start-webcam" '' + systemctl restart webcam +''; diff --git a/modules/system.nix b/modules/system.nix index af3e55c..86950e6 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -32,7 +32,9 @@ pciutils # lspci usbutils # lsusb lshw - + nvme-cli + smartmontools + # Graphics libGL glxinfo diff --git a/modules/geary.nix b/modules/thunderbird.nix similarity index 100% rename from modules/geary.nix rename to modules/thunderbird.nix diff --git a/users/phil/home.nix b/users/phil/home.nix index 7bce8ff..96e7a88 100644 --- a/users/phil/home.nix +++ b/users/phil/home.nix @@ -20,7 +20,6 @@ ../../home/programs/media/obs.nix ../../home/programs/media/spotify/spotify.nix - ../../home/programs/productivity/notesnook.nix ../../home/programs/productivity/blender.nix ../../home/programs/productivity/slicer.nix ../../home/programs/productivity/okular.nix @@ -31,6 +30,7 @@ ../../home/programs/social/zapzap.nix ../../home/programs/web/firefox.nix + ../../home/programs/web/chromium.nix # Games ../../home/programs/games/itch.nix