cleanup foryog

This commit is contained in:
Cyryl Płotnicki 2023-04-08 22:00:27 +01:00
parent 71d6a42823
commit a3f0ce315a
5 changed files with 10 additions and 168 deletions

View file

@ -5,7 +5,6 @@
./hardware-configuration.nix ./hardware-configuration.nix
../../backups.nix ../../backups.nix
../../boot.nix ../../boot.nix
../../gfx-intel-dri2.nix
../../git ../../git
../../gnome ../../gnome
../../gui ../../gui
@ -32,10 +31,6 @@
time.timeZone = "Europe/London"; time.timeZone = "Europe/London";
virtualisation.kvmgt = {
enable = true;
device = "0000:00:02.0";
};
hardware.trackpoint.enable = true; hardware.trackpoint.enable = true;
services.xserver = { services.xserver = {

View file

@ -1,16 +1,11 @@
{ { config, lib, pkgs, inputs, ... }: {
config,
lib,
pkgs,
inputs,
...
}: {
boot = { boot = {
kernelModules = ["kvm-intel"]; kernelModules = [ "kvm-intel" ];
initrd = { initrd = {
kernelModules = ["dm-snapshot"]; kernelModules = [ "dm-snapshot" ];
availableKernelModules = ["xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod"]; availableKernelModules =
[ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
}; };
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
@ -18,8 +13,9 @@
loader.efi.efiSysMountPoint = "/boot/efi"; loader.efi.efiSysMountPoint = "/boot/efi";
}; };
boot.initrd.secrets = {"/crypto_keyfile.bin" = null;}; boot.initrd.secrets = { "/crypto_keyfile.bin" = null; };
boot.initrd.luks.devices."luks-43a80125-4089-45be-9561-fab93f984916".device = "/dev/disk/by-uuid/43a80125-4089-45be-9561-fab93f984916"; boot.initrd.luks.devices."luks-43a80125-4089-45be-9561-fab93f984916".device =
"/dev/disk/by-uuid/43a80125-4089-45be-9561-fab93f984916";
fileSystems."/boot/efi" = { fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/D6C0-1A9D"; device = "/dev/disk/by-uuid/D6C0-1A9D";
@ -29,13 +25,8 @@
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/98f3597c-183a-45fb-b2a4-b598c18d089a"; device = "/dev/disk/by-uuid/98f3597c-183a-45fb-b2a4-b598c18d089a";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@"]; options = [ "subvol=@" ];
}; };
swapDevices = []; swapDevices = [ ];
nix.settings = {
max-jobs = 7;
cores = 4;
};
} }

View file

@ -1,9 +0,0 @@
{
config,
pkgs,
...
}: {
environment.systemPackages = with pkgs; [libqmi];
boot.extraModulePackages = with pkgs; [libqmi];
boot.kernelModules = ["qmi_wwan" "qcserial"];
}

View file

@ -1,105 +0,0 @@
#!/usr/bin/env bash
###
# This script automate the setup of QMI supported wwan devices.
#
# Tested on following environment:
# * Lenovo ThinkPad X220 (4286-CTO)
# * Gentoo/Linux, Linux Kernel 3.9.6
# * NTT Docomo UIM card (Xi LTE SIM)
# * Sierra Wireless, Inc. Gobi 3000 wireless wan module
# (FRU 60Y3257, vendor and device id is 1199:9013)
# memo:
# I recommend to check if your wwan module works fine
# for your mobile broadband provider with Windows
# especially if you imported the device from other country.
# You may have to initialize your device for your region.
# * Required kernel config (other modules may be also required):
# - qmi_wwan (CONFIG_USB_NET_QMI_WWAN)
# - qcserial (CONFIG_USB_SERIAL_QUALCOMM)
# * Required settings:
# - you may have to create /etc/qmi-network.conf.
# My qmi-network.conf has only a line "APN=mopera.net".
#
# your wwan device name created by qmi_wwan kernel module
# check it with "ip a" or "ifconfig -a". it may be wwan0?
WWAN_DEV=wwp0s29u1u4
# your cdc_wdm modem location
CDC_WDM=/dev/cdc-wdm0
# this script uses following qmi commands
QMICLI=/usr/bin/qmicli
QMI_NETWORK=/usr/bin/qmi-network
# the places of following commands vary depending on your distribution
IFCONFIG=/bin/ifconfig
DHCPCD=/sbin/dhcpcd
SUDO=/usr/bin/sudo
function helpmsg {
echo "usage: $0 {start|stop|restart|status}"
exit 1
}
function qmi_start {
$COMMAND_PREFIX $IFCONFIG $WWAN_DEV up
$COMMAND_PREFIX $QMICLI -d $CDC_WDM --dms-set-operating-mode=online
if [ $? -ne 0 ]; then
echo "your wwan device may be RFKilled?"
exit 1
fi
$COMMAND_PREFIX $QMI_NETWORK $CDC_WDM start
$COMMAND_PREFIX $DHCPCD $WWAN_DEV
}
function qmi_stop {
$COMMAND_PREFIX $QMI_NETWORK $CDC_WDM stop
$COMMAND_PREFIX kill `cat /var/run/dhcpcd-${WWAN_DEV}.pid`
$COMMAND_PREFIX $IFCONFIG $WWAN_DEV down
}
function qmi_strength {
dbm=`$COMMAND_PREFIX $QMICLI -d $CDC_WDM --nas-get-signal-strength | tr "'" " " | grep Network | head -1 | awk '{print $4}'`
echo -n "Signal strength is "
if [ $dbm -ge -73 ]; then
echo -n 'Excellent'
elif [ $dbm -ge -83 ]; then
echo -n 'Good'
elif [ $dbm -ge -93 ]; then
echo -n 'OK'
elif [ $dbm -ge -109 ]; then
echo -n 'Marginal'
else
echo Unknown
fi
echo " (${dbm} dBm)"
}
function qmi_status {
$COMMAND_PREFIX $QMI_NETWORK $CDC_WDM status
qmi_strength
}
# check argument number
if [ $# -ne 1 ]
then
helpmsg
fi
# check permission
if [ `whoami` != 'root' ]
then
echo "warning: root permission required. setting command prefix to 'sudo'."
COMMAND_PREFIX=$SUDO
fi
# run commands
case $1 in
start) qmi_start ;;
stop) qmi_stop ;;
restart) qmi_stop; qmi_start ;;
status) qmi_status ;;
*) helpmsg ;;
esac

View file

@ -1,30 +0,0 @@
{pkgs, ...}: let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
whichgpu = pkgs.writeShellScriptBin "whichgpu" "glxinfo | grep vendor";
nvidiaon = pkgs.writeShellScriptBin "nvidiaon" ''
export __NV_PRIME_RENDER_OFFLOAD=1;
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0;
export __GLX_VENDOR_LIBRARY_NAME=nvidia;
export __VK_LAYER_NV_optimus=NVIDIA_only;
glxinfo | grep vendor; echo OK!;
'';
in {
environment.systemPackages = [nvidia-offload whichgpu nvidiaon];
hardware.opengl.enable = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [libva];
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia.prime = {
offload.enable = true;
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
};
}