Live data from Hacker News

NixOS on Framework Laptop

kvark.github.io

151–160 of 250 posts

Re: NixOS on Framework Laptop

#151
post #28

Earlier quoted context omitted.

So far, incredible! Still setting up my environment, but as far as how it’s running on the Framework, I 100% see myself fully transitioning to it from my MacBook. Desktop wise, I’ve been using PopOS for 7-8 months now, so it’s quite great to have that same setup in a portable fashion now.

How do you deal with the transitiob from MacOS to PopOs? I'm trying to do it, but discouraged from all the small annoying things: - changing default shortcuts from CMD to CTRL. Is swapping the positions enough? - Janky scrolling/no inertia ( i'm not on a framework (hp x360 spectre), is the framework better? - all the small tuning software i have (Karabiner for remapping, Amethyst for tiling, BitBar etc) - is there a…

> changing default shortcuts from CMD to CTRL. Is swapping the positions enough?

I strongly recommend not to do this.

I did it and it was a nightmare: some of mac's hotkeys are like linux hotkeys but reversing Meta & Ctrl, but not all of them. I adjusted the most egregious hotkeys, but there were always more. This went on for around a month. In the end, it was impossible for me to get used to the differences: my muscle memory would betray me many times over the day, and it wasn't getting better.

Then I deicded to just reset everything back to my distro's defaults. It was painful for a couple days. I made a few mistakes in the next week... and then it all got in muscle memory. I can even switch from working on a mac to working on linux without issues now.

Re: NixOS on Framework Laptop

#152
post #13

Framework + NixOS is the most exciting hardware + OS going IMHO. If someone wants to do a crowdfunding or devpay or similar to make them work out of the box together, I will gladly donate or pay.

I don't really see them as exciting when they are still Intel only. As far as I am aware you can't upgrade the CPU, much less upgrade it to AMD.

I plan on keeping my M1 for a 2-3 more years, then we will have to see what Framework has come up with then.

I like them a lot in principle (peripherals that can be switched to what I need? Yes please. Upgradable RAM? thanks), but I also won't compromise on battery time, performance or "linux works outside the box". Battery time could have been an easy fix if they had made it so I could switch the battery without taking the laptop apart.

Re: NixOS on Framework Laptop

#153

Earlier quoted context omitted.

To me, Macbooks have the worst trackpad 'feel' so hopefully it's nothing like that.

You're definitely in the minority, macbook trackpads are widely accepted as the best ones currently out there. Some good discussion on this: https://news.ycombinator.com/item?id=19485178

Widely accepted by who? Mac users? It's nothing more than what you're used to.

Re: NixOS on Framework Laptop

#154
> X1 took 120s, so 4.5x slower… totally unexpected

Your numbers are clearly suspicious. Did you ever take measures to circumvent the CPU throttling bug under Linux on your X1E? See [1].

Also, regarding your battery comments, when my X1E G1 was new I got great battery life, around 7-8 hours. I still get 5ish.

> requires LUKS full-disk encryption, and having it setup conflicted with NVidia’s proprietary driver.

This just seems bizarre and hard to believe to me; once mounted your LUKS drive is no different (to software) than any other block device.

[1] https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Extreme#...

Re: NixOS on Framework Laptop

#155
post #97

Earlier quoted context omitted.

If you have a parser for systemd unit files then you might have a chance to get that to work. If the whole reason you're doing it is to migrate back to upstart's syntax then it seems that would be not so useful, you might as well go in the other direction: write an upstart generator for systemd, and then you can just plug that into ordinary NixOS. Edit: Actually I think at some point NixOS did support upstart? Not su…

I'm not planning on working on anything related to systemd in the near future. If anything, I will write a config generator/type spec for startup/Upstart in Nix.

Unfortunately I think you probably will have to work on it if you want to not break existing configurations, so maybe NixOS is not for you. You could try alpine possibly? But with that you will have to do the same with init.d, so it's going to be somewhat of an uphill battle either way I guess. This is generally why I would discourage maintaining a service manager outside of an established distro, I tried to do it for about the same amount of time as you and it became not worth it. Upstart in particular has been basically entirely replaced by systemd.

Re: NixOS on Framework Laptop

#156
post #148

Earlier quoted context omitted.

Nix works on more than just linux. Google Cloud uses gvisor for their K8s offering; AWS and Fly.io use firecracker for their container offerings. Cgroups in v2 can be delegated easily and cleanly. As well as namespaced. Systemd or no systemd. Systemd just makes your life harder if you want to do rootless containers without integrating with them.

"Nix works on more than just linux." IIRC the GP comment was asking about NixOS, not Nix. If you have everything already going through managed K8s or firecracker then I don't understand what you are using NixOS for. You could just install Nix on some other distribution that uses whatever init/container setup you want. "Cgroups in v2 can be delegated easily and cleanly. As well as namespaced." Right but none of those…

I don't have a specific use case in mind. The possibilities are endless.

Delegating a cgroups doesn't take systemd, by the way. You can do it with mkdir().

Systemd puts user processes in a part of the cgroups tree where they can't work freely, by default. You have to use a systemd unit or the dbus api to break out of that box. That is a design decision on system's part. If I was putting user processes in cgroups, I would give them space to work amongst themselves.

Re: NixOS on Framework Laptop

#157
post #155

Earlier quoted context omitted.

I'm not planning on working on anything related to systemd in the near future. If anything, I will write a config generator/type spec for startup/Upstart in Nix.

Unfortunately I think you probably will have to work on it if you want to not break existing configurations, so maybe NixOS is not for you. You could try alpine possibly? But with that you will have to do the same with init.d, so it's going to be somewhat of an uphill battle either way I guess. This is generally why I would discourage maintaining a service manager outside of an established distro, I tried to do it fo…

I already use upstart on void no problem. Alpine would be a similar deal with me just managing the configs as raw text files via rsync. In fact my fork is already packaged in Alpine. A few people use it as a session manager for sway.

There is no chance that my Nix changes would affect existing configurations. They would be completely self contained.

Re: NixOS on Framework Laptop

#158

Currently using my Framework laptop with Arch Linux. Was able to get everything working, including Bluetooth. Even got the battery life tamed. So far, my favorite laptop since the Thinkpad T42 I had back in the day (other laptops I’ve owned: 2013 MB Air, Dell XPS 15 9550, and a 2018 MBP)

I had a 1600x1200 T42p and loved that thing to death too. My fav laptop ever though was the original 15" MacBook Retina from 2012. I pre-ordered mine the hour it came available, as I had been waiting years for a good IPS HiDPI laptop. I had never even owned a Mac before that. Mine was one of the first off the line where the display had a temporary-burn-in (very long ghosting for any pixels that are fixed for more tha…

Oh yeah, and I'm running the Pro Display XDR through a USB-C 3.1 Gen 2 (10Gbps) cable. Plugging that into the VirtualLink port on an Nvidia RTX 20xx card is the easiest way to get the native 6K @ 60hz with 10bpc on Windows. These days you can get these cables at lengths up to 3 meters, which is nice. There's also this weird VR headset cable which works a treat if you need something longer or have a graphics card without the VirtualLink port: https://www.aliexpress.com/item/4001290509128.html

You need to use Brigadier to download the Boot Camp drivers to get the display brightness controls widget. Unfortunately, there isn't an option for Linux.

Re: NixOS on Framework Laptop

#159
post #148

Earlier quoted context omitted.

"Nix works on more than just linux." IIRC the GP comment was asking about NixOS, not Nix. If you have everything already going through managed K8s or firecracker then I don't understand what you are using NixOS for. You could just install Nix on some other distribution that uses whatever init/container setup you want. "Cgroups in v2 can be delegated easily and cleanly. As well as namespaced." Right but none of those…

I don't have a specific use case in mind. The possibilities are endless. Delegating a cgroups doesn't take systemd, by the way. You can do it with mkdir(). Systemd puts user processes in a part of the cgroups tree where they can't work freely, by default. You have to use a systemd unit or the dbus api to break out of that box. That is a design decision on system's part. If I was putting user processes in cgroups, I w…

Well you have to understand that my mental picture from your past description is FreeBSD running in KVM on NixOS running on managed GCP/AWS, which is a somewhat confusing and convoluted architecture to me and I'm not sure what it's for or what the possibilities are that can't be done with some other setup. You could probably simplify and cut out some of those pieces. But if you meant something else, then let me know.

AFAIK you actually should not be using mkdir, because it is racy to have more than one process writing to the toplevel hierarchy. It's only safe to do that from the cgroup manager. That's what I've seen with all the existing implementations anyway.

"Systemd puts user processes in a part of the cgroups tree where they can't work freely, by default. You have to use a systemd unit or the dbus api to break out of that box. That is a design decision on system's part."

It's a design decision that was made because of cgroupsv2. You should really read systemd's documentation on this if you haven't, it describes in detail why this is. https://systemd.io/CGROUP_DELEGATION/

Edit: and also the kernel documentation on delegation. https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2...

In particular, any other container manager that wants delegation needs to do this same thing using a similar mechanism that you initiate by configuring it somehow. (It doesn't have to be a unit file or dbus call obviously.) Processes cannot just freely break out of their cgroup, that wouldn't be secure. Sorry if you know all this already, maybe a reader doesn't. Or maybe this is helpful to you if you want to add this to startup, I don't know.

"If I was putting user processes in cgroups, I would give them space to work amongst themselves. "

Ok now you lost me again... is this not exactly the purpose of cgroup delegation?

Re: NixOS on Framework Laptop

#160
post #28

Earlier quoted context omitted.

So far, incredible! Still setting up my environment, but as far as how it’s running on the Framework, I 100% see myself fully transitioning to it from my MacBook. Desktop wise, I’ve been using PopOS for 7-8 months now, so it’s quite great to have that same setup in a portable fashion now.

How do you deal with the transitiob from MacOS to PopOs? I'm trying to do it, but discouraged from all the small annoying things: - changing default shortcuts from CMD to CTRL. Is swapping the positions enough? - Janky scrolling/no inertia ( i'm not on a framework (hp x360 spectre), is the framework better? - all the small tuning software i have (Karabiner for remapping, Amethyst for tiling, BitBar etc) - is there a…

> changing default shortcuts from CMD to CTRL. Is swapping the positions enough?

For me, I just adjust to using CTRL instead of CMD. It only takes me a day or two of consistent use for the muscle memory to switch over.

The most painful part is if I try and go back-and-forth between the Mac and Linux laptop, that causes pain. But if I just switch pretty completely over to the linux environment, the muscle-memory switches over pretty quickly.

If you don't need to go back-and-forth on an ongoing basis, I'd recommend just pushing through the transition period.

Post reply on HN