dell
This commit is contained in:
@@ -5,9 +5,6 @@
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cec = "${pkgs.v4l-utils}/bin/cec-ctl";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
@@ -16,34 +13,12 @@ in
|
||||
../../modules/misc/faster-boot-time.nix
|
||||
../../modules/misc/kernel.nix
|
||||
../../modules/services/ssh.nix
|
||||
../../modules/misc/tv-on-off.nix
|
||||
../../modules/thunderbolt.nix
|
||||
./disk-config.nix
|
||||
inputs.nixos-hardware.nixosModules.dell-xps-15-7590-nvidia
|
||||
];
|
||||
|
||||
|
||||
# after suspend, do `cec-ctl -A | grep cec0 | wc -l`, if >0, do `cec-ctl --standby --to TV`
|
||||
# similar on wakeup, if present send `cec-ctl --user-control-pressed ui-cmd=power-on-function --to TV`
|
||||
environment.etc."systemd/system-sleep/sleep-turn-tv-off-on.sh".source =
|
||||
pkgs.writeShellScript "post-sleep-turn-tv-off.sh" ''
|
||||
case $1/$2 in
|
||||
pre/*)
|
||||
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
|
||||
${cec} -C --skip-info
|
||||
${cec} --tv --skip-info
|
||||
${cec} --standby --skip-info --to TV
|
||||
echo "Turning TV off!"
|
||||
${pkgs.coreutils}/bin/sleep 2
|
||||
fi
|
||||
;;
|
||||
post/*)
|
||||
if [ $(${cec} -A | ${pkgs.gnugrep}/bin/grep cec0 | ${pkgs.coreutils}/bin/wc -l) -gt 0 ]; then
|
||||
${cec} --tv --skip-info
|
||||
${cec} --skip-info --user-control-pressed ui-cmd=power-on-function --to TV
|
||||
echo "Turning TV on!"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
|
||||
custom = {
|
||||
cli-tools.enable = true;
|
||||
tmpfs.enable = true;
|
||||
|
||||
@@ -14,32 +14,18 @@
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "uas" "sd_mod" "rtsx_pci_sdmmc" "thunderbolt"];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"rtsx_pci_sdmmc"
|
||||
];
|
||||
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
#fileSystems."/" =
|
||||
# {
|
||||
# device = "/dev/disk/by-uuid/10537ea5-9d9f-4be8-8509-c7f9c9b978b8";
|
||||
# fsType = "ext4";
|
||||
# };
|
||||
|
||||
#fileSystems."/boot" =
|
||||
# {
|
||||
# device = "/dev/disk/by-uuid/C163-6BD5";
|
||||
# fsType = "vfat";
|
||||
# };
|
||||
|
||||
#swapDevices =
|
||||
# [{ device = "/dev/disk/by-uuid/3ef4829c-e9ea-4cc0-85a1-bd8e704b9940"; }];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
@@ -48,5 +34,5 @@
|
||||
# networking.interfaces.wlp59s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user