I just installed NixOS and entered this into my /etc/nixos/configuration.nix:
services.xserver.enable = true; services.xserver.windowManager.dwm.enable = true;
and then I ran nixos-rebuild switch followed by systemctl start display-manager and now I have dwm running?
No need to manually install xorg-server, dwm and friends, fiddling to run startx on boot while making sure keyboard mappings are correct1?
wtf, nix is magic

Footnotes

  1. services.xserver.xkb.layout got you covered
Thank you for the tip. I’m just getting familiar with Nix. What are your favorite features, and what is still giving you trouble?
reply
18 sats \ 4 replies \ @ek OP 20 Apr
What are your favorite features
The declarative configuration via configuration.nix and applying it with nixos-rebuild.1
For example, knowing which packages are installed and how the firewall is configured at all times gives me peace. I also intend to check this file into version control so I will never lose it. I can simply copy this file into a new NixOS install and run nixos-rebuild switch and then I should have everything up and running again iiuc.
Additionally, having to configure the system in this declarative way seems to be well-enforced: I literally can't change the system configuration myself since the system is mounted read-only.
what is still giving you trouble?
Imperative vs declarative user management. Not sure yet which one I should use. Imperative with manual password configuration via passwd seems to be recommended but feels weird to not go full declarative and set hashedPassword inside configuration.nix.
But I probably don't want to expose my hashed passwords or I can't share my configuration.nix publicly in a git repository.
Also currently figuring out basic workflows with nix-env and how to configure dwm.
Footnotes
  1. I guess that's the obvious killer feature of NixOS.
reply
I absolutely love NixOS! I use it as my main OS both on my desktop and my VPS.
What is truly magical is the ability to configure even projects with pinned dependencies via shell.nixand if you have NixOS on a server you can also write and import a default.nix to set up a reproducible deploy on any NixOS machine.
Here a couple of tips I learned myself:
  • If you want you can also use the passwordFile rule to store the encrypted passwords outside of your config code.
  • It's better to avoid nix-env entirely as it's NOT reproducible, it's better to use nix-shell for occasional use or add them to the environment directly.
  • Even cooler, you can write scripts with a special shebang that let you automatically load various languages or packages.
reply
Thank you!
reply
6 sats \ 1 reply \ @ek OP 20 Apr
I’m just getting familiar with Nix
Did you install only nix, the package manager, or NixOS?
Can you share some experiences?
reply
I installed NixOS only.
I tried to implement a custom network configuration script to automate VPN connections based on specific network conditions, but I couldn't quite figure it out.
reply
Yep, it's sweet, sweet magic.
reply
Oh hardly. It’s just scripts. Lots of Linux OOB experience is magic these days. You haven’t need to mess with that in a long time.
I don’t get the draw of nix at all. Seems like a lot of redundancy for little gain.
Yes I use archlinux
reply
What is nixos. I like magic.
reply
That sounds intriguing, but I just like my UIs, I like GNOME (especially recent...)
I made my custom xkb keyboard to have the exactly same shortcuts on Mac and Linux... and it was pain.
reply
77 sats \ 1 reply \ @ek OP 20 Apr
That sounds intriguing, but I just like my UIs, I like GNOME (especially recent...)
You can use GNOME with NixOS, no?
I made my custom xkb keyboard to have the exactly same shortcuts on Mac and Linux... and it was pain.
Sunk cost fallacy? Maybe it's time to explore and switch tools? 👀
took me just 6 months to try out NixOS since btc++ in Berlin
reply
Yeah, you can set up GNOME, but with config file and a bit too much work imo... I have to use MacOS for reasons (and I quite enjoy it fwiw), so it's unfortunately more that the linux side is the sunken cost for me. I spent a lot of time setting it up...
reply
I couldn't get xkb to work so plugged in directly to evdev to intercept keys and remap then so id get consistency between Linux and macos on all apps
reply
I ended up creating new symbols file and linking it from evdev.xml. Is that what you did?
reply
No as I couldn't get it to work quite right. I also wanted to have key cords and weird stuff. I used libevdev
reply
Aaaanndd... I don't get it.
reply
50 sats \ 8 replies \ @ek OP 20 Apr
You run Windows, don't you? 👀
reply
Worse, whatever's a Chromebook's running... 🤠
reply
Chromebooks run a linux distro called Chrome OS
Other than Android, Chrome OS is the most popular linux operating system available in stores
reply
Then why can't I run a frickin' Linux based software on it?! Or can I?
Hm. I'm not that handy in that regard.
reply
why can't I run a frickin' Linux based software on it?
You can
reply
Nice! I had no idea about that.
Ah crap, that means I'm once again reconsidering a Chromebook purchase, something I vowed to never do again after many bad results w/them in the past.
reply
Chrome OS is quite capable and so far I think Google has done a great job making it normie friendly
Except for one thing: spying on users is not user friendly, it's user hostile, and Chrome OS loves to spy on its users
Whoopsie-daisie, thanks.
reply
50 sats \ 0 replies \ @ek OP 20 Apr
tbh, I usually don't like magic but this might be the right amount of convenient magic
reply
How do you keep it updated it, you know day-zero stuff? Are all "normal" software compatible? Not sure what is the primary goal of this thing or just another *nix... Another words, how is it better say security wise?
reply
I have to dissent. Nix is a neat idea, but it has some serious drawbacks when it comes to installing your own software and generating hashes in the hash store and so on. The final nail in the coffin was the "creator covenant" bullshit they tried to pull. I need an OS, not an ethos. Let the ethos make the OS, but don't tell me what I have to believe to use or contribute to your OS.
reply
Yes, welcome to Nix! Yes, when I first started to use it, it blew my mind!
If you want bitcoin related stuff all working on NixOS here is our git page: https://git.sovranysystems.com
reply