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 support for GPD Pocket #48
Conversation
Another GPD Pocket User 👍 Have a look at https://github.com/andir/nixos-gpd-pocket those are my configuration files for the gpd pocket. I am currently running nixos unstable on it since there are a few parts that have been patched in newer alsa, kernel, … versions. It also comes with the (almost always) latest version of the Kernel of Hans de Goede (RedHat employee that works on the hardware support for this and many other devices). Things that do work for me with those settings:
I did intend to provide those changes to this repo as soon as everything is mainline/upstream. Feel free to pull those changes into your PR :-) |
Thanks, that looks indeed more polished, I'll look into it. This setup is also intended to be used on the unstable channel, with a stock 4.14 kernel. As a result some of the support is still missing. On the plus side, this could already be mergeable and updated later (on 4.15's release?) But I also realized that I forgot to include the brcmfmac4356 firmware anyway so my PR won't work as is. Definitely opened it too fast... |
Yep, mailine support is what this repo should probably prefer. Don't worry. That is why there is review :-) You can improve over time. |
gpd/gpd-pocket/default.nix
Outdated
}; | ||
|
||
# wifi | ||
nixpkgs.config.allowUnfree = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be up to the end user whether to allow unfree packages or not, even when crucial to hardware functionality.
Moreover, it would make sense to only enable the firmware if user explicitly allows unfree packages, so that people that don't install unfree packages can still use the profile, even if without functioning Wi-Fi:
nixpkgs.firmware = with pkgs; lib.optionals config.nixpkgs.config.allowUnfree [
brcmfmac4356-firmware
]
See:
nixos-hardware/apple/default.nix
Lines 8 to 9 in 88bd126
hardware.facetimehd.enable = lib.mkDefault | |
(config.nixpkgs.config.allowUnfree or false); |
gpd/gpd-pocket/default.nix
Outdated
# wifi | ||
nixpkgs.config.allowUnfree = true; | ||
hardware.firmware = with pkgs; [ | ||
brcmfmac4356-firmware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't evaluate:
undefined variable brcmfmac4356-firmware at /home/travis/build/NixOS/nixos-hardware/gpd/gpd-pocket/default.nix:29:5
gpd/gpd-pocket/default.nix
Outdated
|
||
# power management | ||
services.tlp = { | ||
enable = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already defined in laptop profile:
services.tlp.enable = lib.mkDefault true; |
gpd/gpd-pocket/default.nix
Outdated
''; | ||
xrandrHeads = [ { output= "DSI1"; monitorConfig = "Option \"Rotate\" \"right\""; } ]; | ||
libinput = { | ||
enable = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already defined in PC profile:
nixos-hardware/common/pc/default.nix
Line 4 in 5a00ea4
services.xserver.libinput.enable = lib.mkDefault true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, gpd/gpd-pocket
should be moved to gpd/pocket
, following the current naming convention.
gpd/gpd-pocket/default.nix
Outdated
}; | ||
|
||
environment.variables = { | ||
GDK_SCALE = "2"; # DPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All non-mergable attributes should be set via lib.mkDefault
so that they can be overrided in user profile:
GDK_SCALE = lib.mkDefault "2";
gpd/gpd-pocket/default.nix
Outdated
libinput = { | ||
enable = true; | ||
}; | ||
inputClassSections = ['' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required to discover input devices?
gpd/gpd-pocket/default.nix
Outdated
Option "TearFree" "true" | ||
Option "DRI" "3" | ||
''; | ||
xrandrHeads = [ { output= "DSI1"; monitorConfig = "Option \"Rotate\" \"right\""; } ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: "Option \"Rotate\" \"right\""
-> ''Option "Rotate" "right"''
Also, it would be easier to read with each attribute on a separate line.
gpd/gpd-pocket/default.nix
Outdated
services.xserver = { | ||
dpi = 168; | ||
deviceSection = '' | ||
Option "AccelMethod" "sna" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does explicit acceleration method affect anything?
gpd/gpd-pocket/default.nix
Outdated
}; | ||
|
||
# TODO: fix media keys | ||
# sound.mediaKeys.enable = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sound.mediaKeys.enable
overlaps with some desktop managers (e.g. Xfce), which is why it is not set in this repo even if the device does have media keys.
gpd/gpd-pocket/default.nix
Outdated
hardware.pulseaudio = { | ||
enable = true; | ||
extraConfig = '' | ||
set-card-profile alsa_card.platform-cht-bsw-rt5645 HiFi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required to make audio work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some hacks required with current mainline kernels. This will change in the future (4.15+).
I am not sure if this is exactly the one since I've been running the 4.15-rc kernels on mine.
gpd/gpd-pocket/default.nix
Outdated
set-sink-port alsa_output.platform-cht-bsw-rt5645.HiFi__hw_chtrt5645_0__sink [Out] Speaker | ||
''; | ||
daemon.config = { | ||
realtime-scheduling = "no"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it disabled?
gpd/gpd-pocket/default.nix
Outdated
}; | ||
|
||
hardware.pulseaudio = { | ||
enable = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far there are no profiles that explicitly depend on PulseAudio: the idea is to not force PulseAudio (there are cases that warrant pure ALSA setup, or Jack). Extra configuration for PulseAudio (to make it work once it's enabled) is of course welcome.
Also, would you license this work under CC0-1.0? License is not in the master branch yet, see #47. |
66bae91
to
055d98a
Compare
Licensing it under CC0-1.0 is fine by me, if @andir also agrees for the part I'd eventually take from their repo. I tried to apply some of your changes and I'll do some test later to verify that nothing is extraneous. About the wifi firmware, I suppose it's not really the place to put some blobs (see https://github.com/andir/nixos-gpd-pocket/tree/master/firmware). Would there be an alternate solution, for example leaving some instructions for the user to add and include from another channel? |
For what it is worth you could pull that from my repo.... I also grant permission to re-use my configuration from THAT repo under CC0-1.0. |
I think blob here will do, but it could be merged with Nixpkgs for a wider reach, perhaps later. |
any news here? |
@Mic92 I'm a bit short on time these days unfortunately, if someone wants to make progress on that, be my guest |
@lbonn wrong username? ;) |
Oops, sorry |
Please don't put blobs in this repo, though
…On Mar 12, 2018 6:53 AM, "lbonn" ***@***.***> wrote:
Oops, sorry
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAErrHCccuDrkyBffA2haerm1h3f0pOlks5tdlPGgaJpZM4Rdm96>
.
|
The GPD Pocket 2 is out now. Anybody running NixOS on that machine yet? |
@matthew-piziak I should be getting my Pocket 2 soon, interested to try out! |
@yrashk Exciting! Looking forward to hearing what you think. For what it's worth, I'm now using this configuration on a GDP 1 of my own. Works great! |
Looks like this PR got stalled. If someone wants to open a new PR, feel free. |
Here is a small number of settings for a reasonably functional system running on a GPD Pocket
Some parts might be out of scope for this repo (the environment variables at the end?). I'll let you be the judge of that: please tell me what I should remove.