furthre config on laptop

This commit is contained in:
2025-07-14 15:12:21 +02:00
parent 5b2b64611e
commit e2f428bc64
54 changed files with 1479 additions and 87 deletions
+13
View File
@@ -0,0 +1,13 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
];
hardware.bluetooth.enable = true;
hardware.bluetooth.settings = {
General = {
Enable = "Source,Sink,Media,Socket";
};
};
services.blueman.enable = true;
}
+7
View File
@@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }
{
environment.systemPackages = with pkgs; [
]
# Enable CUPS to print documents.
services.printing.enable = true;
}
+20
View File
@@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
{
imports = [
./fonts.nix
];
environment.systemPackages = with pkgs; [
# browsers
brave
firefox
chromium
# misc
];
# Enable CUPS to print documents.
services.printing.enable = true;
location.provider = "geoclue2";
}
+11
View File
@@ -0,0 +1,11 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
jdk
jetbrains.pycharm-professional
mongodb-compass
];
}
+10
View File
@@ -0,0 +1,10 @@
{ config, pkgs, ... }
{
# ly display manager
services.ly.enable = true;
# setup persmission for set in wayland
programs.seatd.enable = true;
}
+8
View File
@@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
virtualisation.docker.enable = true;
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
}
+6
View File
@@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }:
{
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
}
+44
View File
@@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
{
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "*" ];
settings = {
main = {
capslock = "layer(capslayer)";
"'" = "G-'";
};
otherlayer = {};
capslayer = {
# arrow keys vimlike
j = "down";
h = "left";
k = "up";
l = "right";
# german special keys
a = "G-q";
o = "G-p";
u = "G-y";
s = "G-s";
e = "G-5";
};
};
extraConfig = ''
# extra conf here
'';
};
};
};
# Optional, but makes sure that when you type the make palm rejection work with keyd
# https://github.com/rvaiya/keyd/issues/723
environment.etc."libinput/local-overrides.quirks".text = ''
[Serial Keyboards]
MatchUdevType=keyboard
MatchName=keyd virtual keyboard
AttrKeyboardIntegration=internal
'';
}
+55
View File
@@ -0,0 +1,55 @@
{
config,
lib,
vars,
pkgs,
...
}:
{
powerManagement.powertop.enable = true; # enable powertop auto tuning on startup.
networking.networkmanager.wifi.powersave = true;
services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!!
services.thermald.enable = true; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs)
services.power-profiles-daemon.enable = false; # Disable GNOMEs power management
services.tlp = {
enable = true; # Enable TLP (better than gnomes internal power manager)
settings = {
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 1;
CPU_HWP_DYN_BOOST_ON_AC = 1;
CPU_HWP_DYN_BOOST_ON_BAT = 1;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "balanced";
START_CHARGE_THRESH_BAT0 = 75;
STOP_CHARGE_THRESH_BAT0 = 81;
};
};
environment.systemPackages = with pkgs; [
powertop
];
programs.light.enable = true;
powerManagement = {
enable = true;
cpuFreqGovernor = "schedutil";
};
services.auto-cpufreq.enable = true;
services.auto-cpufreq.settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "auto";
};
};
}
+56
View File
@@ -0,0 +1,56 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
];
# Enable OpenGL
hardware.graphics = {
enable = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["modesetting" "nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = true;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
prime = {
# Make sure to use the correct Bus ID values for your system
offload = {
enable = true;
enableOffloadCmd = true;
};
# Bus ID of the Intel GPU.
intelBusId = lib.mkDefault "PCI:0:2:0";
# Bus ID of the NVIDIA GPU.
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
};
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}
@@ -0,0 +1,45 @@
{ config, pkgs, ... }:
let
hibernateEnvironment = {
HIBERNATE_SECONDS = "10";
HIBERNATE_LOCK = "/var/run/autohibernate.lock";
};
in {
systemd.services."awake-after-suspend-for-a-time" = {
description = "Sets up the suspend so that it'll wake for hibernation only if not on AC power";
wantedBy = [ "suspend.target" ];
before = [ "systemd-suspend.service" ];
environment = hibernateEnvironment;
script = ''
if [ $(cat /sys/class/power_supply/AC/online) -eq 0 ]; then
curtime=$(date +%s)
echo "$curtime $1" >> /tmp/autohibernate.log
echo "$curtime" > $HIBERNATE_LOCK
${pkgs.utillinux}/bin/rtcwake -m no -s $HIBERNATE_SECONDS
else
echo "System is on AC power, skipping wake-up scheduling for hibernation." >> /tmp/autohibernate.log
fi
'';
serviceConfig.Type = "simple";
};
systemd.services."hibernate-after-recovery" = {
description = "Hibernates after a suspend recovery due to timeout";
wantedBy = [ "suspend.target" ];
after = [ "systemd-suspend.service" ];
environment = hibernateEnvironment;
script = ''
curtime=$(date +%s)
sustime=$(cat $HIBERNATE_LOCK)
rm $HIBERNATE_LOCK
if [ $(($curtime - $sustime)) -ge $HIBERNATE_SECONDS ] ; then
systemctl hibernate
else
${pkgs.utillinux}/bin/rtcwake -m no -s 1
fi
'';
serviceConfig.Type = "simple";
};
}
+47
View File
@@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
xwayland
sway
swaylock
swayidle
nwg-displays
# screenshot stuff
grim
slurp
wl-clipboard
mako
];
programs.dconf.enable = true;
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway";
user = "greeter";
};
};
};
# x compatibility
programs.xwayland.enable = true;
# enable polkit to use home manager sway config
security.polkit.enable = true;
# for swaylock
security.pam.services.swaylock = {};
# keyring setup
programs.seahorse.enable = true;
services.gnome.gnome-keyring.enable = true;
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
}