Skip to content

Instantly share code, notes, and snippets.

@manveru
Created March 5, 2016 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manveru/d4bc162127365f6f812d to your computer and use it in GitHub Desktop.
Save manveru/d4bc162127365f6f812d to your computer and use it in GitHub Desktop.
{ stdenv, fetchFromGitHub, kernel }:
stdenv.mkDerivation rec {
name = "tuxedo-wmi-${kernel.version}-${version}";
version = "1.5.1";
src = fetchFromGitHub {
owner = "metmayhem";
repo = "tuxedo-wmi";
rev = "a6ab8d4160b16ab75e2a820e1d69e71934017515";
sha256 = "12hf5cxmffk3jp8a178iw3jz4aa1k4f5zxmn8i66b9cbj60b6a4s";
};
NIX_DEBUG = 1;
unpackPhase = ''
mkdir -p $out/build
cp $src/src/* $out/build
'';
patchPhase = ''
substituteInPlace $out/build/Makefile --replace /lib/modules/ "${kernel.dev}/lib/modules/"
substituteInPlace $out/build/Makefile --replace '$(shell uname -r)' "${kernel.modDirVersion}"
'';
buildPhase = ''
make -C $out/build
'';
installPhase = ''
mkdir -p "$out/lib/modules/${kernel.modDirVersion}"
cp $out/build/tuxedo-wmi.ko $out/lib/modules/${kernel.modDirVersion}
rm -rf $out/build
'';
meta = {
description = "Full color keyboard / rfkill driver for late model Clevo laptops";
homepage = "https://github.com/fleaplus/tuxedo-wmi";
platforms = stdenv.lib.platforms.linux;
license = stdenv.lib.licenses.gpl2;
maintainer = stdenv.lib.maintainers.manveru;
};
}
Copy link

ghost commented May 5, 2018

i'm new to Nix. I like to install the tuxedo-wmi.nix but i get errors.

$ nix-build tuxedo-wmi.nix
error: cannot auto-call a function that has an argument without a default value ('stdenv')

or
$ nix-build -E 'with import <nixpkgs> {}; callPackage ./tuxedo-wmi.nix {}'
error: attempt to call something which is not a function but a set, at /nix/store/jwkxjj3j56f9dkh7w0lr186gdi5p5p7a-nixos-18.03/nixos/lib/customisation.nix:74:12

any hint?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment