add initial vision14 hw and kernel module

This commit is contained in:
foosinn 2021-10-06 00:30:20 +02:00
parent bab83119cc
commit de4fafc2e2
2 changed files with 92 additions and 0 deletions

53
hardware/vison14.nix Normal file
View file

@ -0,0 +1,53 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
let
tuxedo-keyboard = pkgs.callPackage (import ../packages/tuxedo-keyboard.nix) {};
in
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [
tuxedo-keyboard
];
fileSystems."/" =
{ device = "tank/root/nixos";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "tank/root/home";
fsType = "zfs";
};
fileSystems."/tmp" =
{ device = "tank/root/tmp";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7E36-C774";
fsType = "vfat";
};
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
# custom
boot.loader.systemd-boot.enable = true;
hardware.cpu.intel.updateMicrocode = true;
networking.hostId = "eff291c7";
networking.hostName = "ds9";
services.tlp.enable = true;
}

View file

@ -0,0 +1,39 @@
{ stdenv, lib, linuxPackages, fetchurl }:
let
kernel = linuxPackages.kernel;
kernelDir = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
in
stdenv.mkDerivation rec {
name = "tuxedo-keyboard";
version = "v3.0.8";
src = builtins.fetchGit {
url = "git://github.com/tuxedocomputers/tuxedo-keyboard";
ref = "refs/tags/${version}";
};
nativeBuildInputs = kernel.moduleBuildDependencies;
buildPhase = ''
make KDIR='${kernelDir}' all
'';
installPhase = ''
install -v -D -m 644 \
-t "$out/lib/modules/${kernel.modDirVersion}/extra/" \
./src/tuxedo_keyboard.ko \
./src/clevo_wmi.ko \
./src/tuxedo_io/tuxedo_io.ko \
./src/clevo_acpi.ko
find -name '*.ko'
echo ${kernel.modDirVersion}
'';
meta = {
homepage = https://github.com/tuxedocomputers/tuxedo-keyboard/blob/master/Makefile;
};
}