deskwhich and some proper hotkeys
This commit is contained in:
parent
624fd23f8b
commit
159c70216e
13 changed files with 120 additions and 60 deletions
|
@ -16,6 +16,6 @@ with lib;
|
||||||
./gaming.nix
|
./gaming.nix
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
./cloudsync.nix
|
./cloudsync.nix
|
||||||
./laptop_hardware.nix
|
./hardware
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,8 @@ in
|
||||||
libsForQt5.qtgraphicaleffects
|
libsForQt5.qtgraphicaleffects
|
||||||
catppuccin-kvantum
|
catppuccin-kvantum
|
||||||
kdePackages.audiocd-kio
|
kdePackages.audiocd-kio
|
||||||
|
kdePackages.kio-extras
|
||||||
|
kdePackages.kio
|
||||||
xcb-util-cursor
|
xcb-util-cursor
|
||||||
qt6ct
|
qt6ct
|
||||||
kdePackages.dolphin
|
kdePackages.dolphin
|
||||||
|
|
6
common/hardware/default.nix
Normal file
6
common/hardware/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./laptop.nix
|
||||||
|
./tlp.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -5,25 +5,20 @@ in
|
||||||
{
|
{
|
||||||
config = with cfg; lib.mkIf (enable && laptop_hardware.enable) {
|
config = with cfg; lib.mkIf (enable && laptop_hardware.enable) {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
acpi
|
|
||||||
lm_sensors
|
lm_sensors
|
||||||
lshw
|
lshw
|
||||||
pciutils
|
pciutils
|
||||||
usbutils
|
usbutils
|
||||||
powertop
|
|
||||||
opentabletdriver
|
opentabletdriver
|
||||||
ddcutil
|
ddcutil
|
||||||
] ++ lib.optionals graphical [
|
] ++ lib.optionals graphical [
|
||||||
ddcui
|
ddcui
|
||||||
tlpui
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# services.ddccontrol.enable = true;
|
|
||||||
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
|
|
||||||
hardware.i2c.enable = true;
|
hardware.i2c.enable = true;
|
||||||
services.libinput.enable = true;
|
services.libinput.enable = true;
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
|
|
||||||
hardware.opentabletdriver.enable = true;
|
hardware.opentabletdriver.enable = true;
|
||||||
|
services.udisks2.enable = true;
|
||||||
|
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
SUBSYSTEM=="i2c-dev", ACTION=="add",\
|
SUBSYSTEM=="i2c-dev", ACTION=="add",\
|
||||||
|
@ -87,36 +82,10 @@ in
|
||||||
];
|
];
|
||||||
# blacklistedKernelModules = [ "i2c_nvidia_gpu" ];
|
# blacklistedKernelModules = [ "i2c_nvidia_gpu" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.power-profiles-daemon.enable = false;
|
|
||||||
# powerManagement.powertop.enable = true;
|
|
||||||
|
|
||||||
services.upower.enable = true;
|
|
||||||
|
|
||||||
services.tlp = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
USB_AUTOSUSPEND = 1;
|
|
||||||
USB_EXCLUDE_BTUSB = 1;
|
|
||||||
USB_EXCLUDE_PHONE = 1;
|
|
||||||
SOUND_POWER_SAVE_ON_AC = 0;
|
|
||||||
SOUND_POWER_SAVE_ON_BAT = 1;
|
|
||||||
SATA_LINKPWR_ON_AC = "max_performance";
|
|
||||||
SATA_LINKPWR_ON_BAT = "min_power";
|
|
||||||
MAX_LOST_WORK_SECS_ON_BAT = 15;
|
|
||||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
|
||||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
|
||||||
CPU_BOOST_ON_AC = 1;
|
|
||||||
CPU_BOOST_ON_BAT = 0;
|
|
||||||
RUNTIME_PM_ON_AC = "on";
|
|
||||||
RUNTIME_PM_ON_BAT = "auto";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.grimmShared.laptop_hardware = {
|
options.grimmShared.laptop_hardware = {
|
||||||
enable = lib.mkEnableOption "grimm-laptop";
|
enable = lib.mkEnableOption "grimm-laptop";
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
43
common/hardware/tlp.nix
Normal file
43
common/hardware/tlp.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{ pkgs, config, lib, system, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.grimmShared;
|
||||||
|
perf_policy = lib.optional (lib.systems.elaborate system).isx86 config.boot.kernelPackages.x86_energy_perf_policy;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = with cfg; lib.mkIf (enable && laptop_hardware.enable) {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
acpi
|
||||||
|
powertop
|
||||||
|
] ++ lib.optionals graphical [
|
||||||
|
tlpui
|
||||||
|
] ++ perf_policy;
|
||||||
|
|
||||||
|
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
|
||||||
|
|
||||||
|
services.power-profiles-daemon.enable = false;
|
||||||
|
services.upower.enable = true;
|
||||||
|
boot.extraModulePackages = perf_policy;
|
||||||
|
|
||||||
|
services.tlp = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
USB_AUTOSUSPEND = 1;
|
||||||
|
USB_EXCLUDE_BTUSB = 1;
|
||||||
|
USB_EXCLUDE_PHONE = 1;
|
||||||
|
SOUND_POWER_SAVE_ON_AC = 0;
|
||||||
|
SOUND_POWER_SAVE_ON_BAT = 1;
|
||||||
|
SATA_LINKPWR_ON_AC = "max_performance";
|
||||||
|
SATA_LINKPWR_ON_BAT = "min_power";
|
||||||
|
MAX_LOST_WORK_SECS_ON_BAT = 15;
|
||||||
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||||
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||||
|
CPU_BOOST_ON_AC = 1;
|
||||||
|
CPU_BOOST_ON_BAT = 0;
|
||||||
|
RUNTIME_PM_ON_AC = "on";
|
||||||
|
RUNTIME_PM_ON_BAT = "auto";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -15,13 +15,15 @@ in
|
||||||
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
|
(writeShellScriptBin "systemd-owner" "systemctl show -pUser,UID $@")
|
||||||
(writeShellScriptBin "lsiommu" ./lsiommu)
|
(writeShellScriptBin "lsiommu" ./lsiommu)
|
||||||
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
|
(writeShellScriptBin "tree" "${lib.getExe pkgs.eza} -T --git -lh --no-permissions --no-user --no-filesize --no-time")
|
||||||
|
urlencode
|
||||||
|
pstree
|
||||||
|
dos2unix
|
||||||
|
|
||||||
gcc
|
gcc
|
||||||
jdk17
|
jdk17
|
||||||
pkg-config
|
pkg-config
|
||||||
unzip
|
unzip
|
||||||
p7zip
|
p7zip
|
||||||
dos2unix
|
|
||||||
|
|
||||||
tea
|
tea
|
||||||
eza
|
eza
|
||||||
|
|
|
@ -36,6 +36,8 @@ in
|
||||||
{
|
{
|
||||||
config = with cfg; lib.mkIf (enable && portals && graphical) {
|
config = with cfg; lib.mkIf (enable && portals && graphical) {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
(callPackage ../../custom/deskwhich/package.nix {})
|
||||||
|
|
||||||
zathura
|
zathura
|
||||||
imhex
|
imhex
|
||||||
libreoffice-qt
|
libreoffice-qt
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
cloudSync = {
|
cloudSync = {
|
||||||
# enable = true;
|
enable = true;
|
||||||
username = "Grimmauld";
|
username = "Grimmauld";
|
||||||
server = "cloud.grimmauld.de";
|
server = "cloud.grimmauld.de";
|
||||||
passwordFile = config.age.secrets.nextcloud_pass.path;
|
passwordFile = config.age.secrets.nextcloud_pass.path;
|
||||||
|
|
27
custom/deskwhich/package.nix
Normal file
27
custom/deskwhich/package.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ fetchFromGitea
|
||||||
|
, lib
|
||||||
|
, rustPlatform
|
||||||
|
}:
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "deskwhich";
|
||||||
|
version = "unstable-2024-04-30";
|
||||||
|
|
||||||
|
src = fetchFromGitea {
|
||||||
|
domain = "codeberg.org";
|
||||||
|
owner = "axtlos";
|
||||||
|
repo = "deskwhich";
|
||||||
|
rev = "cbe8a0cdf4bdbb26faecb028e79ad6c409376051";
|
||||||
|
hash = "sha256-c0Q0oYIB/1eutV7tkqYXvDMw8A7YsT+5+CmmwbGvcNk=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoHash = "sha256-fBC3UBf9oLswlR6Kgw3nSwjqAtn7VQGzvbUJaYnOid4=";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "tool to find the path of desktop entries";
|
||||||
|
homepage = "https://codeberg.org/axtlos/deskwhich";
|
||||||
|
license = lib.licenses.gpl3Only;
|
||||||
|
mainProgram = "deskwhich";
|
||||||
|
maintainers = with lib.maintainers; [ grimmauld ];
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
|
@ -63,7 +63,6 @@
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
grimmauld-nixos = customNixosSystem "x86_64-linux" {
|
grimmauld-nixos = customNixosSystem "x86_64-linux" {
|
||||||
modules = [
|
modules = [
|
||||||
(import ./overlays)
|
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
chaotic.nixosModules.default
|
chaotic.nixosModules.default
|
||||||
nix-gaming.nixosModules.pipewireLowLatency
|
nix-gaming.nixosModules.pipewireLowLatency
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{ lib, config, ... }: {
|
|
||||||
nixpkgs.overlays = map (f: (final: prev: (import f { inherit final prev lib config; })))
|
|
||||||
[
|
|
||||||
./wlr_flicker.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{ final, prev, ... }: {
|
|
||||||
wlroots = prev.wlroots.overrideAttrs (o: {
|
|
||||||
patches = (o.patches or [ ]) ++ [
|
|
||||||
# ./patches/lessflicker.patch
|
|
||||||
# ./patches/screenshare.patch
|
|
||||||
];
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1,4 +1,12 @@
|
||||||
{ inputs, system, pkgs, config, lib, ... }: {
|
{ inputs, system, pkgs, config, lib, ... }:
|
||||||
|
let
|
||||||
|
searchclip = pkgs.writeShellScriptBin "searchclip" ''
|
||||||
|
xdg-open https://www.google.com/search?q=$(wl-paste -p | urlencode)
|
||||||
|
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
||||||
|
swaymsg [app_id="$browser" urgent="newest"] focus
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
alacritty
|
alacritty
|
||||||
rmenu
|
rmenu
|
||||||
|
@ -9,6 +17,7 @@
|
||||||
swaymux
|
swaymux
|
||||||
qt6ct
|
qt6ct
|
||||||
swaynotificationcenter
|
swaynotificationcenter
|
||||||
|
searchclip
|
||||||
];
|
];
|
||||||
|
|
||||||
grimmShared.sway = {
|
grimmShared.sway = {
|
||||||
|
@ -20,7 +29,9 @@
|
||||||
style = ./bar/style.css;
|
style = ./bar/style.css;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = with lib; {
|
config = with pkgs; let
|
||||||
|
inherit (lib) getExe;
|
||||||
|
in {
|
||||||
definitions = {
|
definitions = {
|
||||||
mod = "Mod4";
|
mod = "Mod4";
|
||||||
left = "h";
|
left = "h";
|
||||||
|
@ -28,8 +39,8 @@
|
||||||
up = "k";
|
up = "k";
|
||||||
right = "l";
|
right = "l";
|
||||||
term = getExe pkgs.alacritty;
|
term = getExe pkgs.alacritty;
|
||||||
menu = "${getExe pkgs.rmenu} -r drun | xargs swaymsg exec --";
|
menu = "${getExe rmenu} -r drun | xargs swaymsg exec --";
|
||||||
menu_run = "${getExe pkgs.rmenu} -r run | xargs swaymsg exec --";
|
menu_run = "${getExe rmenu} -r run | xargs swaymsg exec --";
|
||||||
|
|
||||||
primecol = "#8800FF";
|
primecol = "#8800FF";
|
||||||
accentcol = "#5700a0";
|
accentcol = "#5700a0";
|
||||||
|
@ -42,8 +53,8 @@
|
||||||
keybinds = {
|
keybinds = {
|
||||||
"$mod+d" = "exec $menu";
|
"$mod+d" = "exec $menu";
|
||||||
"$mod+Shift+d" = "exec $menu_run";
|
"$mod+Shift+d" = "exec $menu_run";
|
||||||
"$mod+Shift+s" = ''exec ${getExe pkgs.grim} -g "$(${getExe pkgs.slurp} -d)" - | wl-copy'';
|
"$mod+Shift+s" = ''exec ${getExe grim} -g "$(${getExe slurp} -d)" - | wl-copy'';
|
||||||
"$mod+Return" = "exec $term -e xonsh";
|
"$mod+Return" = "exec $term --command xonsh";
|
||||||
"$mod+Shift+Return" = "exec $term";
|
"$mod+Shift+Return" = "exec $term";
|
||||||
"$mod+Shift+q" = "kill";
|
"$mod+Shift+q" = "kill";
|
||||||
"$mod+Shift+c" = "reload";
|
"$mod+Shift+c" = "reload";
|
||||||
|
@ -136,9 +147,22 @@
|
||||||
XF86AudioPlay = "exec playerctl play-pause";
|
XF86AudioPlay = "exec playerctl play-pause";
|
||||||
XF86AudioNext = "exec playerctl next";
|
XF86AudioNext = "exec playerctl next";
|
||||||
XF86AudioPrev = "exec playerctl previous";
|
XF86AudioPrev = "exec playerctl previous";
|
||||||
"$mod+c" = "exec ${getExe pkgs.swaymux}";
|
"$mod+c" = "exec ${getExe swaymux}";
|
||||||
XF86MonBrightnessUp = "exec ${getExe pkgs.brightnessctl} s 10+%";
|
XF86MonBrightnessUp = "exec ${getExe brightnessctl} s 10+%";
|
||||||
XF86MonBrightnessDown = "exec ${getExe pkgs.brightnessctl} s 10-%";
|
XF86MonBrightnessDown = "exec ${getExe brightnessctl} s 10-%";
|
||||||
|
XF86Explorer = "exec $term --command ${getExe ranger}";
|
||||||
|
XF86Search = "exec ${getExe searchclip}";
|
||||||
|
XF86HomePage = let open = pkgs.writeShellScriptBin "open_or_switch_browser" ''
|
||||||
|
browser=$(xdg-settings get default-web-browser | sed "s/\.desktop//")
|
||||||
|
swaymsg [app_id="$browser"] focus || deskwhich $browser | xargs gio launch
|
||||||
|
''; in "exec ${getExe open}";
|
||||||
|
XF86Tools = let open = pkgs.writeShellScriptBin "open_or_switch_spotify" ''
|
||||||
|
# FIXME: spotify is being weird
|
||||||
|
while IFS= read -r pid; do
|
||||||
|
swaymsg [pid=$pid] focus && exit 0
|
||||||
|
done <<< $(pgrep spotify -u "$(whoami)")
|
||||||
|
deskwhich spotify | xargs gio launch
|
||||||
|
''; in "exec ${getExe open}"; # for some reason tools = audio media on my keyboard??
|
||||||
};
|
};
|
||||||
autolaunch = with pkgs; [
|
autolaunch = with pkgs; [
|
||||||
# fixme: absolute paths
|
# fixme: absolute paths
|
||||||
|
@ -146,7 +170,7 @@
|
||||||
"lxqt-policykit-agent"
|
"lxqt-policykit-agent"
|
||||||
"otd-daemon"
|
"otd-daemon"
|
||||||
swaynotificationcenter
|
swaynotificationcenter
|
||||||
# (pkgs.writeShellScriptBin "rmenu-cache-clear" "rm -r $HOME/.cache/rmenu") # invalidate rmenu cache on sway restart
|
# (pkgs.writeShellScriptBin "rmenu-cache-clear" "rm -r $HOME/.cache/rmenu") # invalidate rmenu cache on sway restart
|
||||||
"dbus-update-activation-environment"
|
"dbus-update-activation-environment"
|
||||||
];
|
];
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|
Loading…
Add table
Reference in a new issue