From 616d40d98c1b7545493e47ae5bf9d895d2d586e2 Mon Sep 17 00:00:00 2001 From: Cookiez Date: Thu, 27 Nov 2025 09:43:27 +0100 Subject: [PATCH] - Commented out portainer.nix in configuration.nix for future use. - Created portainer.nix for container management configuration. - Added 120hz.sh and 60hz.sh scripts for display refresh rate switching. - Enhanced plasma/home.nix with power management settings. --- modules/configuration.nix | 1 + modules/packages.nix | 1 + modules/portainer.nix | 32 +++++++++++++++ other/120hz.sh | 2 + other/60hz.sh | 2 + plasma/home.nix | 85 ++++++++++++++++++++++++++++++--------- 6 files changed, 105 insertions(+), 18 deletions(-) create mode 100644 modules/portainer.nix create mode 100755 other/120hz.sh create mode 100755 other/60hz.sh diff --git a/modules/configuration.nix b/modules/configuration.nix index 591588e..a605c3a 100644 --- a/modules/configuration.nix +++ b/modules/configuration.nix @@ -31,6 +31,7 @@ ./zsh.nix ./neovim.nix ./packages.nix + #./portainer.nix ]; # Bootloader. diff --git a/modules/packages.nix b/modules/packages.nix index 039de4c..e20afff 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -54,6 +54,7 @@ sqlite #Desktop Applications + drawio jetbrains.datagrip ryubing vlc diff --git a/modules/portainer.nix b/modules/portainer.nix new file mode 100644 index 0000000..c73aa6f --- /dev/null +++ b/modules/portainer.nix @@ -0,0 +1,32 @@ +{ + containers.portainer = { + autoStart = true; + privateNetwork = true; + + config = { pkgs, ... }: { + services.docker.enable = true; + + systemd.services.portainer = { + description = "Portainer Container Manager"; + after = [ "docker.service" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = '' + ${pkgs.docker}/bin/docker run \ + -d \ + --name portainer \ + -p 9000:9000 \ + -p 9443:9443 \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v portainer_data:/data \ + portainer/portainer-ce:latest + ''; + ExecStop = "${pkgs.docker}/bin/docker stop portainer"; + Restart = "unless-stopped"; + }; + }; + + networking.firewall.allowedTCPPorts = [ 9000 9443 ]; + }; + }; +} diff --git a/other/120hz.sh b/other/120hz.sh new file mode 100755 index 0000000..54a9757 --- /dev/null +++ b/other/120hz.sh @@ -0,0 +1,2 @@ +#!/bin/sh +kscreen-doctor output.1.mode.1 diff --git a/other/60hz.sh b/other/60hz.sh new file mode 100755 index 0000000..cec9f30 --- /dev/null +++ b/other/60hz.sh @@ -0,0 +1,2 @@ +#!/bin/sh +kscreen-doctor output.1.mode.2 diff --git a/plasma/home.nix b/plasma/home.nix index 3d9e058..32a1b65 100644 --- a/plasma/home.nix +++ b/plasma/home.nix @@ -52,6 +52,72 @@ } ]; + powerdevil = { + # On AC power (plugged in): Minimal power saving + AC = { + powerProfile = "performance"; + #turnOffDisplay.idleTimeout = 900; # 15 min idle + autoSuspend = { + action = "nothing"; + }; + dimDisplay.enable = false; + turnOffDisplay.idleTimeout = "never"; + }; + + # Normal battery: Balanced saving + battery = { + powerProfile = "balanced"; + #turnOffDisplay.idleTimeout = 300; # 5 min + autoSuspend = { + action = "nothing"; + }; + whenLaptopLidClosed = "sleep"; + dimDisplay.enable = false; + turnOffDisplay.idleTimeout = "never"; + }; + + # Low battery (e.g., <10%): Critical actions + lowBattery = { + powerProfile = "powerSaving"; + autoSuspend = { + action = "sleep"; + idleTimeout = 300; # 5 min idle + }; + whenLaptopLidClosed = "shutDown"; + dimDisplay = { + idleTimeout = 60; + }; + displayBrightness = 30; #Go to 30% display Brightness + turnOffDisplay.idleTimeout = 120; + }; + + # Thresholds for "lowBattery" state + batteryLevels = { + lowLevel = 10; + criticalLevel = 5; + criticalAction = "sleep"; + }; + }; + + workspace = { + theme = "WhiteSur-dark"; + colorScheme = "BreezeDark"; + cursor = { + theme = "Breeze_Light"; + size = 24; + }; + wallpaper = /home/${username}/NixOS/other/wallpaper2.png; + soundTheme = "freedesktop"; + iconTheme = "Breeze-LaCapitaine-apps"; + splashScreen = { + theme = "a2n.kuro"; + }; + windowDecorations = { + library = "org.kde.kwin.aurorae"; + theme = "__aurorae__svg__Nordic"; + }; + }; + shortcuts = { # ActivityManager.switch-to-activity-0f8d8349-5b1b-4b77-bfa5-22829bfaf459 = [ ]; # ActivityManager.switch-to-activity-7dbb43d7-7e06-4b20-907c-a1dbf4afe6c7 = [ ]; @@ -301,24 +367,7 @@ # wacomtablet."Toggle touch tool" = "Meta+Ctrl+T"; yakuake.toggle-window-state = "Meta+F12"; }; - workspace = { - theme = "WhiteSur-dark"; - colorScheme = "BreezeDark"; - cursor = { - theme = "Breeze_Light"; - size = 24; - }; - wallpaper = /home/${username}/NixOS/other/wallpaper2.png; - soundTheme = "freedesktop"; - iconTheme = "Breeze-LaCapitaine-apps"; - splashScreen = { - theme = "a2n.kuro"; - }; - windowDecorations = { - library = "org.kde.kwin.aurorae"; - theme = "__aurorae__svg__Nordic"; - }; - }; + configFile = { # baloofilerc.General.dbVersion = 2; # baloofilerc.General."exclude filters" = "*~,*.part,*.o,*.la,*.lo,*.loT,*.moc,moc_*.cpp,qrc_*.cpp,ui_*.h,cmake_install.cmake,CMakeCache.txt,CTestTestfile.cmake,libtool,config.status,confdefs.h,autom4te,conftest,confstat,Makefile.am,*.gcode,.ninja_deps,.ninja_log,build.ninja,*.csproj,*.m4,*.rej,*.gmo,*.pc,*.omf,*.aux,*.tmp,*.po,*.vm*,*.nvram,*.rcore,*.swp,*.swap,lzo,litmain.sh,*.orig,.histfile.*,.xsession-errors*,*.map,*.so,*.a,*.db,*.qrc,*.ini,*.init,*.img,*.vdi,*.vbox*,vbox.log,*.qcow2,*.vmdk,*.vhd,*.vhdx,*.sql,*.sql.gz,*.ytdl,*.tfstate*,*.class,*.pyc,*.pyo,*.elc,*.qmlc,*.jsc,*.fastq,*.fq,*.gb,*.fasta,*.fna,*.gbff,*.faa,po,CVS,.svn,.git,_darcs,.bzr,.hg,CMakeFiles,CMakeTmp,CMakeTmpQmake,.moc,.obj,.pch,.uic,.npm,.yarn,.yarn-cache,__pycache__,node_modules,node_packages,nbproject,.terraform,.venv,venv,core-dumps,lost+found";