2023-06-20 00:12:22 +08:00
|
|
|
{ pkgs, ... }@inputs:
|
2023-06-19 16:56:49 +08:00
|
|
|
{
|
|
|
|
config =
|
|
|
|
{
|
2023-06-14 00:35:11 +08:00
|
|
|
nixpkgs =
|
|
|
|
{
|
2023-06-14 19:52:21 +08:00
|
|
|
overlays =
|
|
|
|
[(
|
2023-07-06 11:24:34 +08:00
|
|
|
final: prev:
|
|
|
|
let
|
|
|
|
generic-pkgs = (inputs.topInputs.nixpkgs.lib.nixosSystem
|
|
|
|
{
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [{ config.nixpkgs.config.allowUnfree = true; }];
|
|
|
|
}).pkgs;
|
|
|
|
in
|
|
|
|
{
|
2023-07-23 00:09:54 +08:00
|
|
|
# pandoc = generic-pkgs.pandoc;
|
|
|
|
# fwupd = generic-pkgs.fwupd;
|
2023-07-06 11:24:34 +08:00
|
|
|
}
|
2023-06-14 19:52:21 +08:00
|
|
|
)];
|
2023-06-14 00:35:11 +08:00
|
|
|
};
|
2023-07-15 12:19:14 +08:00
|
|
|
hardware.opengl =
|
|
|
|
{
|
|
|
|
extraPackages = with inputs.pkgs; [ intel-media-driver intel-ocl ];
|
|
|
|
driSupport32Bit = true;
|
|
|
|
};
|
2023-06-21 09:55:18 +08:00
|
|
|
systemd.services =
|
2023-06-20 00:12:22 +08:00
|
|
|
{
|
2023-06-21 09:55:18 +08:00
|
|
|
reload-iwlwifi-after-hibernate =
|
2023-06-20 00:12:22 +08:00
|
|
|
{
|
2023-06-21 09:55:18 +08:00
|
|
|
description = "reload iwlwifi after resume from hibernate";
|
|
|
|
after = [ "systemd-hibernate.service" ];
|
|
|
|
serviceConfig =
|
|
|
|
{
|
|
|
|
Type = "oneshot";
|
2023-06-25 00:31:46 +08:00
|
|
|
ExecStart = let inherit (inputs.pkgs) kmod bash; in
|
2023-06-21 09:55:18 +08:00
|
|
|
[
|
2023-06-25 00:31:46 +08:00
|
|
|
"${kmod}/bin/modprobe -r iwlwifi" "${kmod}/bin/modprobe iwlwifi"
|
|
|
|
"${bash}/bin/bash -c 'echo 0 /sys/devices/system/cpu/intel_pstate/no_turbo'"
|
2023-06-21 09:55:18 +08:00
|
|
|
];
|
|
|
|
};
|
|
|
|
wantedBy = [ "systemd-hibernate.service" ];
|
|
|
|
};
|
|
|
|
lid-no-wakeup =
|
|
|
|
{
|
|
|
|
description = "lid no wake up";
|
2023-06-25 00:31:46 +08:00
|
|
|
serviceConfig.ExecStart = let inherit (inputs.pkgs) bash coreutils gnugrep; in
|
|
|
|
"${bash}/bin/bash -c '"
|
|
|
|
+ "if ${coreutils}/bin/cat /proc/acpi/wakeup | "
|
|
|
|
+ "${gnugrep}/bin/grep LID0 | "
|
|
|
|
+ "${gnugrep}/bin/grep -q enabled; then "
|
|
|
|
+ "echo LID0 > /proc/acpi/wakeup; "
|
|
|
|
+ "fi"
|
|
|
|
+ "'";
|
2023-06-21 09:55:18 +08:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2023-06-20 00:12:22 +08:00
|
|
|
};
|
|
|
|
};
|
2023-06-19 16:56:49 +08:00
|
|
|
};
|
|
|
|
}
|