From 1e3edc7afaa09724aa846ba0a68f1a59d2897062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=BChl?= Date: Thu, 30 Oct 2025 10:41:32 +0100 Subject: [PATCH] Use wallpaper library --- README.md | 10 +++--- flake.lock | 12 +++---- .../christopher@cobalt/config/dev.nix | 2 +- .../christopher@cobalt/config/hausgold.nix | 2 +- .../christopher@cobalt/config/wayland.nix | 5 ++- .../christopher@cobalt/default.nix | 1 + .../christopher@cobalt/misc/everything.nix | 31 +++---------------- .../scripts/select-wallpapers/default.nix | 18 +++++++++++ systems/x86_64-linux/beryllium/default.nix | 10 +++++- systems/x86_64-linux/cobalt/default.nix | 10 ++++-- 10 files changed, 57 insertions(+), 44 deletions(-) create mode 100644 packages/scripts/select-wallpapers/default.nix diff --git a/README.md b/README.md index 3535ee9..1a7441f 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,15 @@ available) or run `nix develop .#name` in the flake root directory. ## How to deploy a new host -Boot into a install medium. Since this repository is public, we don't need to mess -with any SSH keys yet. Clone the repository and enter it. +Boot into an [install medium](https://nixos.org/download/). Since this repository is +public, we don't need to mess with any SSH keys yet. Clone the repository and enter it. ``` git clone https://github.com/padarom/elements.git cd elements ``` -Then install just, which is the only explicit requirement for this deployment which -you must install manually. All other dependencies are installed via the dev shell. +Then install `just`, which is the only explicit requirement for this deployment which +you must install manually. All other dependencies are automatically installed in the dev shell. After installing just, enter the deployment shell. ``` @@ -34,7 +34,7 @@ After installing just, enter the deployment shell. ``` Now, a basic host configuration (with a disko module) is required. This can either -be prepared on another host and comitted, or created now, in the install media. +be prepared on another host and comitted, or created now, in the install medium. Depending on how many hosts I will still onboard, I might end up creating helper functionality in the dev shell specifically for this use case. diff --git a/flake.lock b/flake.lock index c52c6e9..6cad189 100644 --- a/flake.lock +++ b/flake.lock @@ -391,11 +391,11 @@ ] }, "locked": { - "lastModified": 1754263839, - "narHash": "sha256-ck7lILfCNuunsLvExPI4Pw9OOCJksxXwozum24W8b+8=", + "lastModified": 1760500983, + "narHash": "sha256-zfY4F4CpeUjTGgecIJZ+M7vFpwLc0Gm9epM/iMQd4w8=", "owner": "nix-community", "repo": "home-manager", - "rev": "1d7abbd5454db97e0af51416f4960b3fb64a4773", + "rev": "c53e65ec92f38d30e3c14f8d628ab55d462947aa", "type": "github" }, "original": { @@ -874,11 +874,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1755186698, - "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", + "lastModified": 1760524057, + "narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", + "rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5", "type": "github" }, "original": { diff --git a/homes/x86_64-linux/christopher@cobalt/config/dev.nix b/homes/x86_64-linux/christopher@cobalt/config/dev.nix index a5d18a9..a100be2 100644 --- a/homes/x86_64-linux/christopher@cobalt/config/dev.nix +++ b/homes/x86_64-linux/christopher@cobalt/config/dev.nix @@ -1,7 +1,7 @@ {pkgs, ...}: { home.packages = with pkgs; [ zx # Tool for writing better scripts - trurl # Parsing and manipulating URLs via CLI + # trurl # Parsing and manipulating URLs via CLI dig # DNS onefetch # Git information tool tokei # Like cloc diff --git a/homes/x86_64-linux/christopher@cobalt/config/hausgold.nix b/homes/x86_64-linux/christopher@cobalt/config/hausgold.nix index ee77dcf..4fb3825 100644 --- a/homes/x86_64-linux/christopher@cobalt/config/hausgold.nix +++ b/homes/x86_64-linux/christopher@cobalt/config/hausgold.nix @@ -7,7 +7,7 @@ # docker has to be installed globally because we have to enable virtualization inputs.docker-compose-1.legacyPackages."x86_64-linux".docker-compose - ruby_3_2 + ruby_3_4 # Dev environment specifics libxcrypt # maklerportal-frontend-test-suite diff --git a/homes/x86_64-linux/christopher@cobalt/config/wayland.nix b/homes/x86_64-linux/christopher@cobalt/config/wayland.nix index 86bbc11..b5f5426 100644 --- a/homes/x86_64-linux/christopher@cobalt/config/wayland.nix +++ b/homes/x86_64-linux/christopher@cobalt/config/wayland.nix @@ -51,7 +51,7 @@ in { exec-once = swaync & # Notification center exec-once = udiskie # Automatic mounting of USBs # exec-once = eval $(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh) & - exec-once = ${pkgs._elements.generate-wallpaper}/bin/generate-wallpaper + exec-once = sleep 1; ${pkgs._elements.select-wallpapers}/bin/select-wallpapers exec-once = eww daemon exec-once = eww open spraggins exec-once = sleep 10; eww open spraggins # Open again after a while because the wallpaper will display on top once that is done @@ -185,12 +185,15 @@ in { windowrule = center 1, class:(.*zeal.*) windowrule = size 50% 80%, class:(.*zeal.*) windowrule = minsize 1400 500, class:(.*zeal.*) + windowrule = opacity 0.9, class:(.*zeal.*) windowrule = float, class:(.*speedcrunch.*) windowrule = center 1, class:(.*speedcrunch.*) windowrule = size 30% 60%, class:(.*speedcrunch.*) + windowrule = opacity 0.9, class:(.*speedcrunch.*) windowrule = float, title:DevTools + windowrule = opacity 0.9, class:(.*kitty.*) windowrule=nofocus,class:^jetbrains-(?!toolbox),floating:1,title:^win\d+$ diff --git a/homes/x86_64-linux/christopher@cobalt/default.nix b/homes/x86_64-linux/christopher@cobalt/default.nix index 18c5659..e4e60c9 100644 --- a/homes/x86_64-linux/christopher@cobalt/default.nix +++ b/homes/x86_64-linux/christopher@cobalt/default.nix @@ -42,6 +42,7 @@ tofi-hg open-url generate-wallpaper + select-wallpapers ]; }; diff --git a/homes/x86_64-linux/christopher@cobalt/misc/everything.nix b/homes/x86_64-linux/christopher@cobalt/misc/everything.nix index 6617bea..0a8752d 100644 --- a/homes/x86_64-linux/christopher@cobalt/misc/everything.nix +++ b/homes/x86_64-linux/christopher@cobalt/misc/everything.nix @@ -1,53 +1,32 @@ {pkgs, ...}: { - # TODO: Move these into individual modules rather than a catch-all home.packages = with pkgs; [ gnupg unzip dua # Interactively view disk space usage - tldr # Quick man-page replacement - hyperfine # Terminal benchmarks numbat # Scientific calculations - hexyl # Hex viewer - pastel # Color analyzer yubikey-manager croc # File transfer - zotero # Collect research sources solaar # Logitech mouse driver - btop # Better resource monitor - bottom # System resource monitor - copyparty # GUI - vcv-rack # Audio synthesizer/eurorack simulator - ardour # General DAW - reaper # Narrating DAW + vesktop # Discord client vlc # Video player - todoist-electron # Todo application - logseq # Knowledge Base - obsidian # Same as above + obsidian # Note taking calibre # eBook Manager - vesktop # Discord Messenger - obs-studio # OBS Studio - wasistlos # WhatsApp client - signal-desktop # Messaging - zulip # Self-hosted slack alternative - libreoffice # Productivity Suite (like Microsoft Office) onlyoffice-bin # libreoffice alternative - cider # Apple Music player filezilla # FTP Client - zathura # Document viewer orca-slicer # Bambu Lab Slicer + Control - weylus # Use iPad Pro as graphics tablet krita # Drawing software mochi # SRS flashcards - # spacedrive # File explorer (Alpha, not usable yet) thunderbird # Email client speedcrunch # GUI calculator app - davinci-resolve # Video editing naps2 # Scanning + vcv-rack # Eurorack simulator + davinci-resolve # Video editor feh # Image viewer xarchiver # Archive viewer/extractor + zathura # Document viewer evince # Document viewer ]; } diff --git a/packages/scripts/select-wallpapers/default.nix b/packages/scripts/select-wallpapers/default.nix new file mode 100644 index 0000000..ccef966 --- /dev/null +++ b/packages/scripts/select-wallpapers/default.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: +pkgs.writeTextFile rec { + name = "select-wallpapers"; + destination = "/bin/${name}"; + executable = true; + + text = '' + #!/usr/bin/env nu + + let wallpaper_dir = "/home/christopher/Wallpapers" + + let landscape = (ls $"($wallpaper_dir)/Landscape" | shuffle | get name | first) + let portrait = (ls $"($wallpaper_dir)/Portrait" | shuffle | get name | first) + + hyprctl hyprpaper reload $"DP-3,($landscape)" + hyprctl hyprpaper reload $"DP-1,($portrait)" + ''; +} diff --git a/systems/x86_64-linux/beryllium/default.nix b/systems/x86_64-linux/beryllium/default.nix index b3d3aaa..da3d383 100644 --- a/systems/x86_64-linux/beryllium/default.nix +++ b/systems/x86_64-linux/beryllium/default.nix @@ -35,7 +35,15 @@ key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkUPOw28Cu2LMuzfmvjT/L2ToNHcADwGyGvSpJ4wH2T"; }; - apcupsd.enable = true; + apcupsd = { + enable = true; + configText = '' + UPSTYPE usb + NISIP 0.0.0.0 + BATTERYLEVEL 50 + MINUTES 5 + ''; + }; }; # Enable privileged ports for rootless pods diff --git a/systems/x86_64-linux/cobalt/default.nix b/systems/x86_64-linux/cobalt/default.nix index 4eef1b8..98486a5 100644 --- a/systems/x86_64-linux/cobalt/default.nix +++ b/systems/x86_64-linux/cobalt/default.nix @@ -94,6 +94,8 @@ with lib._elements; { openssh.enable = true; openssh.settings.PasswordAuthentication = false; + hardware.openrgb.enable = true; + # Bluetooth manager blueman.enable = true; udev.packages = [pkgs.platformio-core.udev]; @@ -131,9 +133,7 @@ with lib._elements; { ]; }; - logind.extraConfig = '' - RuntimeDirectorySize=6G - ''; + logind.settings.Login.RuntimeDirectorySize = "6G"; # Smartcard support, necessary for Yubikey logins pcscd.enable = true; @@ -196,6 +196,7 @@ with lib._elements; { libnotify gtk3 + openrgb-with-all-plugins lact # GPU tuning libimobiledevice ifuse @@ -242,6 +243,9 @@ with lib._elements; { extraBackends = [pkgs.brscan4]; }; + # 3DConnexion support + spacenavd.enable = true; + # Input emulation from userspace (see weylus). uinput.enable = true;