diff --git a/nixos/boxes/foryog/default.nix b/nixos/boxes/foryog/default.nix index 39db3dca..dafc046d 100644 --- a/nixos/boxes/foryog/default.nix +++ b/nixos/boxes/foryog/default.nix @@ -5,7 +5,6 @@ ./hardware-configuration.nix ../../backups.nix ../../boot.nix - ../../gfx-intel-dri2.nix ../../git ../../gnome ../../gui @@ -32,10 +31,6 @@ time.timeZone = "Europe/London"; - virtualisation.kvmgt = { - enable = true; - device = "0000:00:02.0"; - }; hardware.trackpoint.enable = true; services.xserver = { diff --git a/nixos/boxes/foryog/hardware-configuration.nix b/nixos/boxes/foryog/hardware-configuration.nix index a3986d72..6df72b45 100644 --- a/nixos/boxes/foryog/hardware-configuration.nix +++ b/nixos/boxes/foryog/hardware-configuration.nix @@ -1,16 +1,11 @@ -{ - config, - lib, - pkgs, - inputs, - ... -}: { +{ config, lib, pkgs, inputs, ... }: { boot = { - kernelModules = ["kvm-intel"]; + kernelModules = [ "kvm-intel" ]; initrd = { - kernelModules = ["dm-snapshot"]; - availableKernelModules = ["xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod"]; + kernelModules = [ "dm-snapshot" ]; + availableKernelModules = + [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; }; loader.systemd-boot.enable = true; @@ -18,8 +13,9 @@ loader.efi.efiSysMountPoint = "/boot/efi"; }; - 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.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"; fileSystems."/boot/efi" = { device = "/dev/disk/by-uuid/D6C0-1A9D"; @@ -29,13 +25,8 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/98f3597c-183a-45fb-b2a4-b598c18d089a"; fsType = "btrfs"; - options = ["subvol=@"]; + options = [ "subvol=@" ]; }; - swapDevices = []; - - nix.settings = { - max-jobs = 7; - cores = 4; - }; + swapDevices = [ ]; } diff --git a/nixos/boxes/foryog/lte-modem.nix b/nixos/boxes/foryog/lte-modem.nix deleted file mode 100644 index 9b0f4df2..00000000 --- a/nixos/boxes/foryog/lte-modem.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - config, - pkgs, - ... -}: { - environment.systemPackages = with pkgs; [libqmi]; - boot.extraModulePackages = with pkgs; [libqmi]; - boot.kernelModules = ["qmi_wwan" "qcserial"]; -} diff --git a/nixos/boxes/foryog/modem.sh b/nixos/boxes/foryog/modem.sh deleted file mode 100644 index 849fa0cf..00000000 --- a/nixos/boxes/foryog/modem.sh +++ /dev/null @@ -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 - - - diff --git a/nixos/boxes/foryog/nvidia.nix b/nixos/boxes/foryog/nvidia.nix deleted file mode 100644 index da12f86c..00000000 --- a/nixos/boxes/foryog/nvidia.nix +++ /dev/null @@ -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"; - }; -}