New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial port of linux-surface/linux-surface patches to NixOS #170
Conversation
@hpfr, this may be of-interest to you? Would love to be able to add your https://github.com/hpfr/system/hosts/linux-surface.nix into the nixos-hardware/microsoft/surface upstream, so hopefully getting this merged will help -- if you're interested. |
Can we fetch those binaries and patches from the upstream repo instead of embedding them in ours? |
Yes. With so many patches, it is better to just pin the kernel version rather than apply them to our kernels. |
I can try pulling them from upstream, as part of the build, yes. Alternatively, in non-NixOS projects I've tended towards vendorising 3rd-party code to limit the impact of breaking changes from upstream. |
No. Please no git-submodules. If you need to rebase patches for some reason, I recommend if you maintain a fork of the repository and than just fetch them from their. However I would be interested why this is necessary? Did you update the patches for newer kernels? |
At the time, the original patches were for a different kernel rev (and different distrib's) from NixOS' so I had to do a few manual fixes. Last I tried, upstream patches applied cleanly. But I offered the option because upstream is out of my control and therefore could diverge in an unfortunate way again -- and creating a patch to adjust a patch seems a supreme cludge. FYI: I'm not a fan of git-submodules either, which is why I usually use the git-subrepo add-on to vendorise or run monorepos; but I didn't want to assume. |
Ever nixos-hardware user has to download this repository, that's why we want to keep it small. We can create a repository in https://github.com/nix-community, which can be fetched during the build. I don't think it is a good idea to complex software build in nixos-hardware since its used for both 20.03 and unstable it is hard to coordinate with kernel updates done in nixpkgs. Nixpkgs is probably a better place also given that hydra would actually built the kernel and provide a binary cache. |
It looks like I've got some time to work on this, again, so I'm going to try to revamp it to pull (appropriate) patches and apply them in-place, as you suggest. |
Hi folks, I've also been using NixOS on a Surface device as @mexisme mentioned. Sorry for the long wait; I only update this stuff occasionally. In my configuration I used a big, ugly function to overlay the kernel with a patched version by pulling from upstream, and I pin packages by reading files generated by Before you try to run NixOS on a Surface, you should know that building the kernel in the way I've implemented on the Surface itself will test your patience. It sometimes fails seemingly at random, possibly due to running out of memory for the build. It also takes a very long time (more than 3 hours in my experience, with only i3 and Alacritty running) and obviously superheats the device. Having a remote builder running NixOS makes things infinitely more bearable. Your remote builder will need the I eventually grew tired of mucking with this nonsense and bought a Ryzen 2-in-1. I'll be selling my Surface in the next couple weeks, but I can still try to help here and in |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/building-patched-4-19-kernel-fails-cryptically/4474/9 |
Thanks @hpfr! I'm hoping to do a huge tidy-up over the holidays, and would love to leverage what you've done. |
Hopefully this is what I've done, @JohnAZoidberg & @Mic92: replaced with #221 |
This is an initial port of the linux-surface patches to NixOS.
Current code still has a few bugs (e.g. keyboard initialisation) and WebCam support is missing from upstream for most Surface revisions/releases (see: https://github.com/linux-surface/linux-surface/wiki/Supported-Devices-and-Features#feature-matrix) but has otherwise been working extremely well for me at this iteration of the code for the last 3-4 months.
I wanted to offer it early, partly as I have irregular time to work on it and would love some pointers on what I can do to make it better.
The code is clunky in places, and I'd have liked to make it a lot easier to pick which Kernel revision an end-user wants to use.