mirror of
https://github.com/eRgo35/nix-config.git
synced 2026-02-04 17:06:13 +01:00
Compare commits
33 Commits
70e2a7f007
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b18c146ca | |||
| 7028adda9f | |||
| 716eaa17d4 | |||
| c6e3be2b21 | |||
| b41556e49e | |||
| d3de11cb35 | |||
| 99daf9c58a | |||
| e82bd4f4dc | |||
| c093d8ee00 | |||
| ca979091dc | |||
| bbb753d81d | |||
| 228f91da74 | |||
| a23e1dbe3c | |||
| 4b125c5802 | |||
| 3a8fa615f9 | |||
| 8a5f705a96 | |||
| a6a5876a23 | |||
| a1241fd833 | |||
| b1da20e832 | |||
| 9fa2da65f3 | |||
| 3aa43f8a07 | |||
| edc6aecb09 | |||
| 38c84946c5 | |||
| 11d3b28513 | |||
| e375c19c7d | |||
| e2886da8d6 | |||
| 1d68abb4c5 | |||
| 6189e52e4d | |||
| c57a67a6d0 | |||
| b7d8c84b4b | |||
| 3b2cbc6e04 | |||
| 7c030a594b | |||
| 6be617f26a |
652
flake.lock
generated
652
flake.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,8 @@
|
||||
description = "Mike's Flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-24.11";
|
||||
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
|
||||
nur.url = "github:nix-community/NUR";
|
||||
nix-alien.url = "github:thiagokokada/nix-alien";
|
||||
|
||||
@@ -58,5 +58,8 @@
|
||||
gp = "git pull";
|
||||
gs = "git status";
|
||||
gd = "git diff";
|
||||
|
||||
vim = "nvim";
|
||||
vi = "nvim";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -68,10 +68,48 @@ setxkbmap pl &
|
||||
# xset s on &
|
||||
# xset -dpms &
|
||||
# xset s 900 &
|
||||
xset +dpms &
|
||||
xset dpms 1200 1800 2100 &
|
||||
xset s on &
|
||||
xset s 900 &
|
||||
# Host-specific rules
|
||||
if [ "$(hostname)" = "zion" ]; then
|
||||
# Zion rules (Desktop)
|
||||
# Enable DPMS and set longer timeouts for desktop
|
||||
# xset +dpms
|
||||
# xset dpms 1200 2400 3600 # Standby: 20 min, Suspend: 40 min, Off: 60 min
|
||||
|
||||
# Enable screen blanking and set timeout to 20 minutes
|
||||
# xset s on
|
||||
xset s off
|
||||
xset s noblank
|
||||
xset -dpms
|
||||
# xset s 1200
|
||||
|
||||
xidlehook \
|
||||
--socket /tmp/xidlehook.sock \
|
||||
--not-when-fullscreen \
|
||||
--not-when-audio \
|
||||
--timer 600 "xset dpms force standby" "" \
|
||||
--timer 1800 "xset dpms force suspend" "" \
|
||||
--timer 3600 "xset dpms force off" "" &
|
||||
|
||||
elif [ "$(hostname)" = "thor" ]; then
|
||||
# Thor rules (Laptop)
|
||||
# Enable DPMS and set shorter timeouts for laptop
|
||||
# xset +dpms
|
||||
# xset dpms 300 600 900 # Standby: 5 min, Suspend: 10 min, Off: 15 min
|
||||
|
||||
# Enable screen blanking and set timeout to 10 minutes
|
||||
# xset s on
|
||||
# xset s 600
|
||||
|
||||
# Laptop-specific xidlehook rules
|
||||
xidlehook \
|
||||
--socket /tmp/xidlehook.sock
|
||||
--not-when-fullscreen \
|
||||
--not-when-audio \
|
||||
--timer 450 "brightnessctl -s set 5%" "brightnessctl -s set 100%" \
|
||||
--timer 600 "loginctl lock-session" "" \
|
||||
--timer 750 "xset dpms force standby" "" \
|
||||
--timer 900 "systemctl suspend" "" &
|
||||
fi
|
||||
|
||||
# auths
|
||||
# /usr/lib/mate-polkit/polkit-mate-authentication-agent-1 &
|
||||
|
||||
@@ -22,8 +22,10 @@ HIGHLIGHT_HIGH=#524f67
|
||||
|
||||
# Function to get CPU usage
|
||||
get_cpu_usage() {
|
||||
cpu_usage=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {printf "%.0f%%\n", usage}')
|
||||
echo "^c$FOAM^CPU: $cpu_usage"
|
||||
cpu_usage=$(awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print int(($2+$4-u1) * 100 / (t-t1)); }' \
|
||||
<(grep 'cpu ' /proc/stat) <(sleep 1; grep 'cpu ' /proc/stat))
|
||||
|
||||
echo "^c$FOAM^CPU: $cpu_usage%"
|
||||
}
|
||||
|
||||
# Function to get memory usage
|
||||
@@ -66,16 +68,65 @@ get_volume() {
|
||||
echo "^c$PINE^VOL: $volume MIC: $mic_level"
|
||||
}
|
||||
|
||||
# Function to get brightness percentage
|
||||
get_brightness() {
|
||||
# Get the current brightness level (adjust path if needed)
|
||||
brightness=$(cat /sys/class/backlight/intel_backlight/brightness)
|
||||
max_brightness=$(cat /sys/class/backlight/intel_backlight/max_brightness)
|
||||
|
||||
# Calculate brightness percentage
|
||||
brightness_percent=$(awk "BEGIN {printf \"%.0f%%\", ($brightness / $max_brightness) * 100}")
|
||||
|
||||
# Output the result with color
|
||||
echo "^c$ROSE^BRT: $brightness_percent"
|
||||
}
|
||||
|
||||
# Function to get weighted average battery level
|
||||
get_battery_level() {
|
||||
# Get battery levels (adjust paths if needed)
|
||||
battery0_level=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
battery1_level=$(cat /sys/class/power_supply/BAT1/capacity)
|
||||
|
||||
battery0_energy_full=$(cat /sys/class/power_supply/BAT0/energy_full)
|
||||
battery1_energy_full=$(cat /sys/class/power_supply/BAT1/energy_full)
|
||||
|
||||
# Calculate weights based on energy capacity
|
||||
weight0=$(awk "BEGIN {printf \"%.2f\", $battery0_energy_full / ($battery0_energy_full + $battery1_energy_full)}")
|
||||
weight1=$(awk "BEGIN {printf \"%.2f\", $battery1_energy_full / ($battery0_energy_full + $battery1_energy_full)}")
|
||||
|
||||
# Calculate weighted average
|
||||
weighted_avg=$(awk "BEGIN {printf \"%.0f%%\", ($battery0_level * $weight0 + $battery1_level * $weight1)}")
|
||||
|
||||
# Output the result with color
|
||||
echo "^c$LOVE^BAT: $weighted_avg"
|
||||
}
|
||||
|
||||
# Function to get date and time in American 12-hour format
|
||||
get_datetime() {
|
||||
datetime=$(date +"%a %d %b %I:%M %p")
|
||||
echo "^c$GOLD^$datetime"
|
||||
}
|
||||
|
||||
# Function to detect if the system is a laptop
|
||||
is_laptop() {
|
||||
# Check if battery and brightness files exist
|
||||
if [ -d /sys/class/power_supply/BAT0 ] && [ -d /sys/class/backlight/intel_backlight ]; then
|
||||
return 0 # Laptop
|
||||
else
|
||||
return 1 # PC
|
||||
fi
|
||||
}
|
||||
|
||||
# Main loop to update xsetroot
|
||||
while true; do
|
||||
# Combine all status components
|
||||
status="$(get_volume) ^c$TEXT^| $(get_cpu_usage) ^c$TEXT^| $(get_memory_usage) ^c$TEXT^| $(get_datetime)"
|
||||
if is_laptop; then
|
||||
# Include battery and brightness for laptops
|
||||
status="$(get_volume) ^c$TEXT^| $(get_cpu_usage) ^c$TEXT^| $(get_memory_usage) ^c$TEXT^| $(get_brightness) ^c$TEXT^| $(get_battery_level) ^c$TEXT^| $(get_datetime)"
|
||||
else
|
||||
# Exclude battery and brightness for PCs
|
||||
status="$(get_volume) ^c$TEXT^| $(get_cpu_usage) ^c$TEXT^| $(get_memory_usage) ^c$TEXT^| $(get_datetime)"
|
||||
fi
|
||||
|
||||
# Update the root window name with a darker background
|
||||
xsetroot -name "$status"
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
xorg.xinit
|
||||
xorg.xinput
|
||||
brightnessctl
|
||||
playerctl
|
||||
qt6ct
|
||||
xautolock
|
||||
xclip
|
||||
# gnome.gnome-keyring
|
||||
feh
|
||||
@@ -64,6 +67,7 @@
|
||||
virt-manager
|
||||
xfce.thunar
|
||||
dconf
|
||||
xidlehook
|
||||
];
|
||||
|
||||
home.file = {
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
# ./configs/keys.nix
|
||||
|
||||
./system/dunst.nix
|
||||
./system/hypr.nix
|
||||
./system/hyprland.nix
|
||||
# ./system/hypr.nix
|
||||
# ./system/hyprland.nix
|
||||
./system/rofi.nix
|
||||
./system/stylix.nix
|
||||
./system/theme.nix
|
||||
|
||||
@@ -50,18 +50,23 @@
|
||||
okular
|
||||
|
||||
# > desktop < #
|
||||
# firefox
|
||||
firefox
|
||||
httrack
|
||||
# whatsapp-for-linux
|
||||
telegram-desktop
|
||||
google-chrome
|
||||
chromium
|
||||
# telegram-desktop
|
||||
kotatogram-desktop
|
||||
# google-chrome
|
||||
# chromium
|
||||
brave
|
||||
evolution
|
||||
obsidian
|
||||
foliate
|
||||
helio-workstation
|
||||
# vesktop
|
||||
equibop
|
||||
inputs.zen-browser.packages."${system}".default
|
||||
# inputs.zen-browser.packages."${system}".default
|
||||
papers
|
||||
|
||||
|
||||
# > gaming < #
|
||||
prismlauncher
|
||||
|
||||
@@ -13,62 +13,62 @@
|
||||
]
|
||||
);
|
||||
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-python.python
|
||||
ms-python.debugpy
|
||||
jnoortheen.nix-ide
|
||||
mkhl.direnv
|
||||
arrterian.nix-env-selector
|
||||
mvllow.rose-pine
|
||||
github.copilot
|
||||
# github.copilot-chat
|
||||
ms-vsliveshare.vsliveshare
|
||||
rust-lang.rust-analyzer
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"editor.fontSize" = 16;
|
||||
"editor.fontFamily" = "FiraCode Nerd Font";
|
||||
"explorer.confirmDelete" = false;
|
||||
"disable-hardware-acceleration" = true;
|
||||
"explorer.confirmDragAndDrop" = true;
|
||||
"git.openRepositoryInParentFolders" = "never";
|
||||
|
||||
"[python]" = {
|
||||
"editor.defaultFormatter" = "ms-python.black-formatter";
|
||||
"editor.formatOnSave" = true;
|
||||
};
|
||||
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "${pkgs.nixd}/bin/nixd";
|
||||
"nix.serverSettings" = {
|
||||
"nixd" = {
|
||||
"formatting" = {
|
||||
"command" = ["${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt"];
|
||||
};
|
||||
"nixpkgs" = {
|
||||
"expr" = "import <nixpkgs> { }";
|
||||
"options" = {
|
||||
"nixos" = {
|
||||
"expr" = ''(builtins.getFlake "/home/mike/.files").nixosConfigurations.zion.options'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"editor.formatOnSave" = true;
|
||||
|
||||
"editor.fontLigatures" = true;
|
||||
"editor.formatOnPaste" = true;
|
||||
"editor.minimap.enabled" = false;
|
||||
|
||||
# "symbols.hidesExplorerArrows" = false;
|
||||
|
||||
"workbench.iconTheme" = "rose-pine-icons";
|
||||
"workbench.colorTheme" = "Rosé Pine";
|
||||
"workbench.preferredDarkColorTheme" = "Rosé Pine";
|
||||
"workbench.preferredHighContrastColorTheme" = "Rosé Pine";
|
||||
};
|
||||
# extensions = with pkgs.vscode-extensions; [
|
||||
# ms-python.python
|
||||
# ms-python.debugpy
|
||||
# jnoortheen.nix-ide
|
||||
# mkhl.direnv
|
||||
# arrterian.nix-env-selector
|
||||
# mvllow.rose-pine
|
||||
# github.copilot
|
||||
# # github.copilot-chat
|
||||
# ms-vsliveshare.vsliveshare
|
||||
# rust-lang.rust-analyzer
|
||||
# ];
|
||||
#
|
||||
# userSettings = {
|
||||
# "editor.fontSize" = 16;
|
||||
# "editor.fontFamily" = "FiraCode Nerd Font";
|
||||
# "explorer.confirmDelete" = false;
|
||||
# "disable-hardware-acceleration" = true;
|
||||
# "explorer.confirmDragAndDrop" = true;
|
||||
# "git.openRepositoryInParentFolders" = "never";
|
||||
#
|
||||
# "[python]" = {
|
||||
# "editor.defaultFormatter" = "ms-python.black-formatter";
|
||||
# "editor.formatOnSave" = true;
|
||||
# };
|
||||
#
|
||||
# "nix.enableLanguageServer" = true;
|
||||
# "nix.serverPath" = "${pkgs.nixd}/bin/nixd";
|
||||
# "nix.serverSettings" = {
|
||||
# "nixd" = {
|
||||
# "formatting" = {
|
||||
# "command" = ["${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt"];
|
||||
# };
|
||||
# "nixpkgs" = {
|
||||
# "expr" = "import <nixpkgs> { }";
|
||||
# "options" = {
|
||||
# "nixos" = {
|
||||
# "expr" = ''(builtins.getFlake "/home/mike/.files").nixosConfigurations.zion.options'';
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
#
|
||||
# "editor.formatOnSave" = true;
|
||||
#
|
||||
# "editor.fontLigatures" = true;
|
||||
# "editor.formatOnPaste" = true;
|
||||
# "editor.minimap.enabled" = false;
|
||||
#
|
||||
# # "symbols.hidesExplorerArrows" = false;
|
||||
#
|
||||
# "workbench.iconTheme" = "rose-pine-icons";
|
||||
# "workbench.colorTheme" = "Rosé Pine";
|
||||
# "workbench.preferredDarkColorTheme" = "Rosé Pine";
|
||||
# "workbench.preferredHighContrastColorTheme" = "Rosé Pine";
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
...
|
||||
}: let
|
||||
hostname = "zion";
|
||||
in {
|
||||
in {
|
||||
# ------------------------------------------------
|
||||
# Needed Packages
|
||||
# ------------------------------------------------
|
||||
|
||||
@@ -62,9 +62,18 @@
|
||||
cachix
|
||||
lorri
|
||||
niv
|
||||
nixd
|
||||
nixfmt-classic
|
||||
statix
|
||||
vulnix
|
||||
haskellPackages.dhall-nix
|
||||
|
||||
# java
|
||||
jdk
|
||||
jdk8
|
||||
jdk17
|
||||
maven
|
||||
gradle
|
||||
|
||||
tex-fmt
|
||||
];
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
boot = {
|
||||
kernelModules = ["nvidia-uvm"];
|
||||
kernelParams = ["nvidia-drm.fbdev=1"];
|
||||
kernelModules = ["nvidia" "nvidia-uvm"];
|
||||
kernelParams = ["nvidia-drm.fbdev=1" "nvidia-drm.modeset=1"];
|
||||
};
|
||||
|
||||
hardware = {
|
||||
@@ -24,8 +24,8 @@
|
||||
};
|
||||
|
||||
nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
open = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
open = true;
|
||||
|
||||
nvidiaSettings = true;
|
||||
|
||||
|
||||
@@ -118,6 +118,8 @@
|
||||
source-han-sans
|
||||
source-han-sans-japanese
|
||||
source-han-serif-japanese
|
||||
vistafonts
|
||||
corefonts
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
config,
|
||||
hostname,
|
||||
...
|
||||
}: {
|
||||
{config, ...}: {
|
||||
boot = {
|
||||
kernelModules = ["acpi_call"];
|
||||
extraModulePackages = with config.boot.kernelPackages; [acpi_call];
|
||||
@@ -12,15 +8,9 @@
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
TLP_DEFAULT_MODE =
|
||||
if hostname == "laptop"
|
||||
then "BAT"
|
||||
else "AC";
|
||||
TLP_DEFAULT_MODE = "BAT";
|
||||
|
||||
TLP_PERSISTENT_DEFAULT =
|
||||
if hostname == "laptop"
|
||||
then 0
|
||||
else 1;
|
||||
TLP_PERSISTENT_DEFAULT = 0;
|
||||
|
||||
CPU_BOOST_ON_AC = 1;
|
||||
CPU_BOOST_ON_BAT = 0;
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
owner = "eRgo35";
|
||||
repo = "dwm";
|
||||
rev = "main";
|
||||
hash = "sha256-Fq6FhrUYzQ6yiAAVstZkTZV6/80xIToZirDtJTBDRHQ=";
|
||||
hash = "sha256-1syRNBc/i8uSbJ4Kp/4+m8xnh5xkyY1eQvFf1/RXi2U=";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
../modules/ananicy.nix
|
||||
../modules/bluetooth.nix
|
||||
../modules/boot.nix
|
||||
../modules/configuration.nix
|
||||
../modules/common.nix
|
||||
../modules/development.nix
|
||||
../modules/distributed-builds.nix
|
||||
../modules/fstrim.nix
|
||||
../modules/gaming.nix
|
||||
../modules/greetd.nix
|
||||
# ../modules/greetd.nix
|
||||
../modules/gsettings.nix
|
||||
# ../modules/kde.nix
|
||||
# ../modules/lanzaboot.nix
|
||||
@@ -45,11 +45,14 @@
|
||||
../modules/packages.nix
|
||||
../modules/pipewire.nix
|
||||
../modules/printing.nix
|
||||
# ../modules/remote-builder.nix
|
||||
../modules/security.nix
|
||||
../modules/ssh.nix
|
||||
# ../modules/steam.nix
|
||||
../modules/tlp.nix
|
||||
../modules/users.nix
|
||||
../modules/vm.nix
|
||||
../modules/xserver.nix
|
||||
];
|
||||
|
||||
networking.hostName = "thor";
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
../modules/boot.nix
|
||||
../modules/common.nix
|
||||
../modules/development.nix
|
||||
# ../modules/distributed-builds.nix
|
||||
../modules/fstrim.nix
|
||||
../modules/gaming.nix
|
||||
# ../modules/greetd.nix
|
||||
@@ -48,6 +49,7 @@
|
||||
../modules/security.nix
|
||||
../modules/ssh.nix
|
||||
../modules/steam.nix
|
||||
# ../modules/tlp.nix
|
||||
../modules/users.nix
|
||||
../modules/vm.nix
|
||||
../modules/xserver.nix
|
||||
|
||||
Reference in New Issue
Block a user