Compare commits
3 Commits
a193b02ce0
...
1346cb93af
Author | SHA1 | Date | |
---|---|---|---|
1346cb93af | |||
1e24a7d6bc | |||
b58d5eb12f |
@ -56,7 +56,7 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
inherit (pkgs) wayqt dfl-ipc dfl-applications dfl-utils qtgreet xwaylandvideobridge obs-cli;
|
inherit (pkgs) wayqt dfl-ipc dfl-applications dfl-utils qtgreet xwaylandvideobridge obs-cli rgb_keyboard;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,8 @@
|
|||||||
kernel.sysctl = {
|
kernel.sysctl = {
|
||||||
# League of Legends under Linux
|
# League of Legends under Linux
|
||||||
"abi.vsyscall32" = 0;
|
"abi.vsyscall32" = 0;
|
||||||
|
# Fedora 39
|
||||||
|
"vm.max_map_count" = 2147483642;
|
||||||
};
|
};
|
||||||
|
|
||||||
extraModulePackages = [ kernel.vendor-reset ];
|
extraModulePackages = [ kernel.vendor-reset ];
|
||||||
|
@ -19,10 +19,11 @@
|
|||||||
boot = {
|
boot = {
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci"
|
availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci"
|
||||||
|
"aesni-intel"
|
||||||
# NOTE: See https://github.com/NixOS/nixos-hardware/blob/master/common/pc/laptop/acpi_call.nix
|
# NOTE: See https://github.com/NixOS/nixos-hardware/blob/master/common/pc/laptop/acpi_call.nix
|
||||||
#"acpi_call" ];
|
#"acpi_call" ];
|
||||||
];
|
];
|
||||||
kernelModules = [ "dm-snapshot" ];
|
kernelModules = [ "dm-snapshot" "aesni-intel" ];
|
||||||
luks.devices = {
|
luks.devices = {
|
||||||
cryptroot = {
|
cryptroot = {
|
||||||
device = "/dev/disk/by-uuid/e1011c40-e1a9-4ce6-b89f-f14b046639c1";
|
device = "/dev/disk/by-uuid/e1011c40-e1a9-4ce6-b89f-f14b046639c1";
|
||||||
|
@ -20,7 +20,7 @@ in {
|
|||||||
(pkgs.callPackage ./wrapper.nix {
|
(pkgs.callPackage ./wrapper.nix {
|
||||||
inherit (pkgs) retroarch;
|
inherit (pkgs) retroarch;
|
||||||
cores = with pkgs.libretro; [
|
cores = with pkgs.libretro; [
|
||||||
mgba mupen64plus melonds desmume dolphin
|
mgba mupen64plus melonds desmume dolphin pcsx2
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -7,7 +7,15 @@ in {
|
|||||||
enable = lib.mkEnableOption "Enable and configure gamemode";
|
enable = lib.mkEnableOption "Enable and configure gamemode";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = let
|
||||||
|
keyboardBrightnessScript = pkgs.writeShellScript "keyboard-brightness.sh" ''
|
||||||
|
${pkgs.rgb_keyboard}/bin/rgb_keyboard -l ripple -b "$1"
|
||||||
|
'';
|
||||||
|
in lib.mkIf cfg.enable {
|
||||||
|
security.sudo.extraConfig = ''
|
||||||
|
${config.ptw.system.singleUser} ALL = (ALL) NOPASSWD: ${keyboardBrightnessScript}
|
||||||
|
'';
|
||||||
|
|
||||||
programs.gamemode = {
|
programs.gamemode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableRenice = true;
|
enableRenice = true;
|
||||||
@ -29,14 +37,28 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
custom = let
|
custom = let
|
||||||
switchScript = groupName: pkgs.writeShellScript "switch-input-group.sh" ''
|
switchScript = groupName: "${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SwitchInputMethodGroup string:'${groupName}'";
|
||||||
${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SwitchInputMethodGroup string:'${groupName}'
|
|
||||||
'';
|
|
||||||
pauseFcitx = switchScript "Group 2";
|
pauseFcitx = switchScript "Group 2";
|
||||||
resumeFcitx = switchScript "Group 1";
|
resumeFcitx = switchScript "Group 1";
|
||||||
|
|
||||||
|
# The scripts
|
||||||
|
start = pkgs.writeShellScript "gamemode-start.sh" ''
|
||||||
|
# Disable Fcitx's IME
|
||||||
|
${pauseFcitx}
|
||||||
|
|
||||||
|
# Turn on the keyboard lights
|
||||||
|
${config.security.wrapperDir}/sudo ${keyboardBrightnessScript} 1
|
||||||
|
'';
|
||||||
|
end = pkgs.writeShellScript "gamemode-end.sh" ''
|
||||||
|
# Resume Fcitx's IME
|
||||||
|
${resumeFcitx}
|
||||||
|
|
||||||
|
# Turn off the keyboard lights
|
||||||
|
${config.security.wrapperDir}/sudo ${keyboardBrightnessScript} 0
|
||||||
|
'';
|
||||||
in {
|
in {
|
||||||
start = ''${pauseFcitx}'';
|
start = "${start}";
|
||||||
end = ''${resumeFcitx}'';
|
end = "${end}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
30
packages/applications/desktop/rgb_keyboard/default.nix
Normal file
30
packages/applications/desktop/rgb_keyboard/default.nix
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
stdenv
|
||||||
|
, fetchFromGitHub
|
||||||
|
, gcc, gnumake
|
||||||
|
, libusb
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "rgb_keyboard";
|
||||||
|
version = "20230430";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "PapaTutuWawa";
|
||||||
|
repo = "rgb_keyboard";
|
||||||
|
rev = "5bbdafea77ef3c3eb47081494f3b58abcd5c4e27";
|
||||||
|
sha256 = "0m5hvlhqncy1qn5v6gpsz9qd2p4cvcjjnma08vb4b2ybq4kfv7qw";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
libusb
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
${gnumake}/bin/make build
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin/
|
||||||
|
cp rgb_keyboard $out/bin/
|
||||||
|
'';
|
||||||
|
}
|
@ -123,4 +123,6 @@ in {
|
|||||||
gajim = prev.callPackage ./applications/networking/instant-messengers/gajim/default.nix {
|
gajim = prev.callPackage ./applications/networking/instant-messengers/gajim/default.nix {
|
||||||
nbxmpp = prev.python3.pkgs.callPackage ./applications/networking/instant-messengers/gajim/nbxmpp.nix {};
|
nbxmpp = prev.python3.pkgs.callPackage ./applications/networking/instant-messengers/gajim/nbxmpp.nix {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rgb_keyboard = prev.callPackage ./applications/desktop/rgb_keyboard/default.nix {};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user