summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.md1
-rw-r--r--machines/common/base.nix1
-rw-r--r--machines/magician/configuration.nix40
-rw-r--r--users/kassouni/home.nix4
-rw-r--r--users/kassouni/palette/bluetooth.nix2
-rw-r--r--users/kassouni/palette/default.nix20
-rw-r--r--users/kassouni/palette/kbd-backlight.nix20
7 files changed, 50 insertions, 38 deletions
diff --git a/TODO.md b/TODO.md
index ec4513f..652bc5a 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,5 +1,6 @@
# TODO
+- [ ] fingerprint reader
- [ ] tailscale more declarative
- [ ] declarative syncthing
- [ ] nvim binds, whichkey
diff --git a/machines/common/base.nix b/machines/common/base.nix
index 4146d98..81d713d 100644
--- a/machines/common/base.nix
+++ b/machines/common/base.nix
@@ -13,6 +13,7 @@
nixpkgs.config.allowUnfree = true;
programs.steam.enable = true;
+ hardware.steam-hardware.enable = true;
time.timeZone = "America/Los_Angeles";
i18n.defaultLocale = "en_US.UTF-8";
diff --git a/machines/magician/configuration.nix b/machines/magician/configuration.nix
index 6f085c5..e11434a 100644
--- a/machines/magician/configuration.nix
+++ b/machines/magician/configuration.nix
@@ -17,6 +17,31 @@
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
+
+ # intel_pstate runs in active mode, where the scaling governor barely
+ # matters. EPP is the knob that actually moves power.
+ CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance";
+ CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
+
+ # drives the EC's PL1/PL2 power limits
+ PLATFORM_PROFILE_ON_AC = "balanced";
+ PLATFORM_PROFILE_ON_BAT = "low-power";
+
+ # no turbo on battery, and cap sustained clocks. costs real
+ # performance (nix builds especially) to buy runtime.
+ CPU_BOOST_ON_BAT = 0;
+ CPU_HWP_DYN_BOOST_ON_BAT = 0;
+ CPU_MAX_PERF_ON_BAT = 60;
+
+ PCIE_ASPM_ON_BAT = "powersave";
+ RUNTIME_PM_ON_BAT = "auto";
+ WIFI_PWR_ON_BAT = "on";
+ SOUND_POWER_SAVE_ON_BAT = 1;
+ USB_AUTOSUSPEND = 1;
+
+ # battery longevity, not runtime. stops charging at 85%.
+ START_CHARGE_THRESH_BAT0 = 75;
+ STOP_CHARGE_THRESH_BAT0 = 85;
};
};
@@ -31,6 +56,11 @@
hardware.graphics.enable = true;
services.xserver.videoDrivers = [ "modesetting" ];
+ # eDP-1 reports vrr_capable. Only helps fullscreen apps flipping via Present.
+ services.xserver.deviceSection = ''
+ Option "VariableRefresh" "true"
+ '';
+
environment.variables = {
"MOZ_USE_XINPUT2" = "1";
};
@@ -45,10 +75,12 @@
services.libinput = {
enable = true;
- mouse.tapping = false;
- # No bottom-right corner right-click; use two-finger click instead.
- touchpad.clickMethod = "clickfinger";
- touchpad.naturalScrolling = true;
+
+ touchpad = {
+ tapping = false;
+ clickMethod = "clickfinger"; # no right click corner
+ naturalScrolling = true;
+ };
};
# This option defines the first version of NixOS you have installed on this particular machine,
diff --git a/users/kassouni/home.nix b/users/kassouni/home.nix
index 6242863..9268980 100644
--- a/users/kassouni/home.nix
+++ b/users/kassouni/home.nix
@@ -26,6 +26,8 @@
./palette
];
+ home.username = "kassouni";
+
xmonad-config = {
launcher = "rofi -show drun -show-icons";
terminal = "ghostty";
@@ -68,7 +70,7 @@
enable = true;
# modesetting has no TearFree option, so the compositor has to do the
# syncing. home-manager defaults vSync to false, which tears.
- backend = "glx";
+ backend = "egl";
vSync = true;
};
diff --git a/users/kassouni/palette/bluetooth.nix b/users/kassouni/palette/bluetooth.nix
index 58cdf2f..71e1aaf 100644
--- a/users/kassouni/palette/bluetooth.nix
+++ b/users/kassouni/palette/bluetooth.nix
@@ -3,7 +3,7 @@
kassouni.palette.commands = [
{
- name = "toggle bluetooth device";
+ name = "bluetooth";
icon = "󰂯";
# `jc --bluetoothctl` turns `bluetoothctl devices` into JSON, so the menu is
# built from parsed records rather than by splitting "Device <addr> <name>"
diff --git a/users/kassouni/palette/default.nix b/users/kassouni/palette/default.nix
index 7e9eec4..403aa60 100644
--- a/users/kassouni/palette/default.nix
+++ b/users/kassouni/palette/default.nix
@@ -6,18 +6,15 @@
}:
let
cfg = config.kassouni.palette;
-
- # Every sibling .nix file is an ordinary home-manager module that appends to
- # kassouni.palette.commands, so dropping a file in here adds an entry.
- commandModules = map (file: ./. + "/${file}") (
- lib.attrNames (
- lib.filterAttrs (name: type: type == "regular" && name != "default.nix" && lib.hasSuffix ".nix" name)
- (builtins.readDir ./.)
- )
- );
in
{
- imports = commandModules;
+ imports = [
+ ./bluetooth.nix
+ ./reboot.nix
+ ./rebuild.nix
+ ./screenshot.nix
+ ./shutdown.nix
+ ];
options.kassouni.palette.commands = lib.mkOption {
type = lib.types.listOf (
@@ -40,8 +37,7 @@ in
);
default = [ ];
description = ''
- Entries shown in the rofi command palette. Menu order follows module
- import order, which is alphabetical by filename.
+ Entries shown in the rofi command palette.
'';
};
diff --git a/users/kassouni/palette/kbd-backlight.nix b/users/kassouni/palette/kbd-backlight.nix
deleted file mode 100644
index 9da0fb9..0000000
--- a/users/kassouni/palette/kbd-backlight.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ pkgs, ... }:
-{
- kassouni.palette.commands = [
- {
- name = "toggle keyboard backlight";
- icon = "󰌌";
- # The leds sysfs node is group-writable by `video`, which kassouni is in, so
- # this needs no root. Toggle between off and full rather than cycling levels.
- exe = pkgs.writers.writeBash "kbd-backlight" ''
- set -eu
- dev=framework_laptop::kbd_backlight
- if [ "$(${pkgs.brightnessctl}/bin/brightnessctl -d "$dev" get)" -gt 0 ]; then
- ${pkgs.brightnessctl}/bin/brightnessctl -d "$dev" set 0
- else
- ${pkgs.brightnessctl}/bin/brightnessctl -d "$dev" set 100%
- fi
- '';
- }
- ];
-}