A few of the most complete nix documentation I rely on:
I don’t know if this is correct place but since this looks like an open discussion of nix over framework laptop, I’m asking for inputs on a new RFC I recently made:
Any public opinion matters!
Thank you
I could probably use some help if anyone is willing. I installed NixOS on my 13" and didn’t even think to check the forums here. But I basically have the single config file. Haven’t delved into flakes yet. Was thinking that may just complicate things more before I got a grasp of how everything works.
But I’ve been having a bunch of issues.
The system wont auto-boot. It shows the generations but doesn’t select one automatically even though those settings weren’t modified in configuration.nix.
I cannot get my egpu working with my 3090 no matter what I try. System always gets all jerky and low frame rates even when setting it up as prime. And offload doesn’t work.
I am thinking about doing a new install to see if that fixes any issues. Which is what made me come and and search to see if anyone else has been using NixOS.
So if anyone has some time I could probably use some help doing it a better way this time around.
Fingerprint won’t work in NixOS even with hardware config file in NixOS-hardware
Someone please make a script for NixOS that clears the fingerprints I beg lol
Below are the additional lines I set this morning into /etc/nixos/configuration.nix
(and rebooted) when I was at 95% battery. After logging back in, loading up all my usual apps in gnome40, I shut the lid and when opening again 7+ hours later was at 88%. This is a huge improvement for me as before I’d have found it at 20% if lucky.
# Ensures lid-close leads to a sleep I actually expect, that doesn't drain my battery.
# "S3" here refers to Suspend-to-Ram of Intel's si0x documentation:
# https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/reference/energy-analysis-metrics-reference/s0ix-states.html
# Lines below taken from https://github.com/NixOS/nixos-hardware/blob/488931efb69a50307fa0d71e23e78c8706909416/dell/xps/13-9370/default.nix
#
# Force S3 sleep mode. See README.wiki for details.
boot.kernelParams = [ "mem_sleep_default=deep" ];
Hope this helps someone else!
Nice tip!
Thank you!
do you happen to use systemds hybrid-sleep
feature? I keep seeing the large energy consumption during hybrid-sleep even with your fix (running nixos 23.05).
I do use hybrid-sleep my because framework keeps consuming that much power during sleep and hybrid-sleep ensures my RAM content isnt lost when the battery is drained.
This would be helpful for other NixOS users, rolling this into the existing thread to maintain visibility for those who may not know about this thread.
Do you have a command I could run in order to determine what my mode is? Happy to run it and get back to you.
my original PSA here about `mem_sleep_default` is wrong~ish
tl;dr anyone who comes across this big, unified nixos+framework thread that Matt’s kindly maintaining is a prime candidate to at least read the configs nixos-hardware/framework at master · NixOS/nixos-hardware · GitHub (and consider using them per the README, if not also contributing).
new PSA for nixos users (particularly new-to-nixos like I am)
I don’t have edit access to that^ post anymore, so I’m starting a new PSA for nixos users: don’t use^ this tip. Or rather, you probably don’t want that tip, and instead use the more robust route maintained by other folks for you: the nixos-hardware
project … by doing this:
- figure out your framework laptop’s “generation”; for me it’s “11th” gen…
there must be a faster way to look up your generation? eg: via order page? but whatever, here’s steps I used…
-
- Framework | Sign in → find your laptop
-
- under “order summary” the “configuration” field shows your chip’s identifier (for me it’s
i7-1165G7
)
- under “order summary” the “configuration” field shows your chip’s identifier (for me it’s
-
- ctrl+f for your chip from step 2
-
- scroll down to “processor options” table (this will force a header-row to float down with generation indicators)
-
- for me
i7-1165G7
shows “13 (11th Gen Intel Core)”
- for me
-
-
lookup your framework generation in the table here GitHub - NixOS/nixos-hardware: A collection of NixOS modules covering hardware quirks. (stable link) (ctrl+f for
framework
) -
follow GitHub - NixOS/nixos-hardware: A collection of NixOS modules covering hardware quirks. (stable link) which I’ll summarize here for convenience:
- add and update the
nixos-hardware
nixos “channel” by running:
sudo nix-channel --add \ https://github.com/NixOS/nixos-hardware/archive/master.tar.gz \ nixos-hardware sudo nix-channel --update
-
copy the string on the right side (for me it was
<nixos-hardware/framework>
; for you it might be<nixos-hardware/framework/13th-gen-intel>
); let’s call it$YOUR_FRAMEWORK_STRING
-
pull up your
configuration.nix
and add string from step 3:- find the spot in your
configuration.nix
that looks like:
imports = [ ./hardware-configuration.nix ];
- add
$YOUR_FRAMEWORK_STRING
in that list
imports = [ $YOUR_FRAMEWORK_STRING # for me this line is: <nixos-hardware/framework> ./hardware-configuration.nix ];
- find the spot in your
- add and update the
-
see if this is working…
- unset previous hand-made changes for framework (eg: comment out my PSA about
mem_leep_default=deep
) - force set the new changes:
sudo nixos-rebuild switch --upgrade
- reboot to be sure all’s well
- unset previous hand-made changes for framework (eg: comment out my PSA about
I think it’s self-explanatory why a collective of configurations is better than hand-maintaining duplicate versions on your own (and likely not as complete). If you want to see what your generation’s nixos-hardware configuration is in this repo, click into your subfolder here: nixos-hardware/framework at master · NixOS/nixos-hardware · GitHub (stable link)
If you’re curious why the 11th gen does not have mem_sleep_default=deep
line any longer, see this PR: framework laptop 11th gen: Improve sleep power efficiency by obj-obj · Pull Request #717 · NixOS/nixos-hardware · GitHub.
(I really wanted to make this a separate post for higher visibility, but as it’s been merged into this thread, I’ll leave it be)
but why did you post the tip above then? doesn't it work?
Yes the original tip works, but I just didn’t look closely at the larger repo when I copied that xps13 config (until now). If you’re reading this and you’re a nixos expert, please comment with more guidance (and/or confirmation even). I certainly didn’t figure this out via any official nixos docs/wiki (would’ve been nice), so I feel like I should document how I stumbled upon this…
- I recently loaded this old
mem_sleep_default=deep
post and looked at the original github link in my inline-comment, to jog my memory…- Realized the xps hardware config I link to in my original snippet has a sibling file for framework(!) already present nixos-hardware/framework at master · NixOS/nixos-hardware · GitHub (stable link)
- … and sure enough my PSA’s
mem_sleep_default=deep
was already set by said configs 9 months before I posted
- I commented out my own PSA’s fix, and following this
nixos-hardware
repo’s instructions (summary above) - I rebooted my machine and tested
- sleep works as intended (shut lid mid-workstream, had 98% battery; 3 hours later had 97% battery)
- improvement: to take advantage of this
fprintd
default already set (stable link), I tested fingerprint unlock (after runningfprintd-enroll
), and confirmed gdm3 andsudo
both behave as expected. This hadn’t actually worked for me for a long time.
Edit: lol nixos-hardware called out in the third post on this uber thread Well, I guess Matt merging everyone in here will decrease likelihood folks like me will miss it (I’m clearly not the only one, since folks appreciated my one-off tweak). Edit2: typo in bullets’ nestings
Yeah I was pondering the same the other day, given the various success and failure stories with different Linux distros around here.
Maybe a small script that checks the relevant settings from /sys
to report what has been configured correctly or not.
EDIT
While I generally agree a central collection being helpful, it’s also highly specific to NixOS at a current point in time, because modules like nixos-hardware
are merged with the “builtin” modules that a NixOS release ships with. And due to how merging works the magic happens because of the sum of all the modules.
A form of magic where the outcomes is really hard to translate into the non-NixOS world.
I guess this is kinda a rant-like argument for my idea above - the checkscript.
Dang, thanks for all the digging @jon. I was already using nixos-hardware
but didn’t realize PR #717 was created.
Hey friends ---- a situation emerged approaching the 2-year mark of daily driving my batch 5 with my power button.
I don’t know if it’s battery or button press, but basically it has no way of turning on without being plugged in. Also, it will interpret the moment of plugging in as “power on”, so the button is effectively doing nothing.
I can unplug it after boot sequence starts and things are basically fine. (battery life is of course not super great, but I haven’t invested a lot of time into optimizing my OS for that).
Anyone have ideas or advice?
Is there some reason you suspect this behaviour is related to NixOS?
Always test against a live USB of Fedora or Ubuntu LTS. If the power behavior is not present there, it’s your config. If it is present in the live environments, then I’d open a ticket and link to your thread here pointing out clearly you did indeed, test the Live USB approach to triage.
Hey, all! Let me know if a separate thread would be preferable and I’ll post elsewhere.
I’m trying to install NixOS on my Framework 13 with a Ryzen 7640U mainboard, but cannot get the ISO to boot from my USB drive. Fedora Workstation 39 Beta booted just fine from the same flash drive and I dd
’d the ISO to the flash drive the same way:
dd if=$ISO of=/dev/sda status=progress bs=1M
I’m guessing the issue has something to do with the way the ISO boots. NixOS, to my knowledge, boots in a different way than other distros, but I have another system that can boot off this drive, so I would consider this a bug in the BIOS. Correct me if I’m wrong!
The BIOS of the 7640U mainboard as of today is on 3.02, which I understand has issues with certain Linux kernels, but I tried building my own NixOS ISO using Linux 6.5.7 (the Fedora install currently on it is 6.5.6) and that didn’t seem to resolve the issue in any way. The USB drive still does not boot on the Framework but does boot on my current laptop, a Lenovo T480.
For anybody interested, the flake for this is here (you can build it with
nix build git+ssh://gitea@git.lyte.dev/lytedev/foxtrot-nix#nixosConfigurations.live.config.system.build.isoImage
) and its worth noting that I stripped all the NixOS kernel patches since they were incompatible with 6.5.7.
I’m guessing my next step is to go ahead and try GitHub - nix-community/nixos-anywhere: install nixos everywhere via ssh [maintainer=@numtide] to convert the Fedora installation into a NixOS one?
Either way, I’d love to know that my shiny, powerful new laptop will boot my bootable media, even if it is kind of wacky. Ultimately, I’m very much wanting to run NixOS on this thing since I run it everywhere else. I know it’s not officially supported, but I also know that there are other people out there that will want this like me and I’m willing to put in effort on my end to make it happen, but I suspect we’re stuck waiting on the 3.03 BIOS upgrade to hopefully fix this bug (even though the official reason for the BIOS upgrade seems mostly related to amdgpu graphics driver issues). That thread is here for posterity: Laptop 13 AMD Ryzen 7040 BIOS 3.03 and driver Release
This is a perfect place to ask and folks here should be able to help.