Skip to content

u/muntoo

In this archive from Mar 2012 to Apr 2024

5
posts
278
comments
3
media
1.7k
score
1 saved before deletion

Fake news. Unless you're just doing standard things on a standard setup. For anything else, you need to be prepared to do binary hackery, spend days reading through notoriously poor documentation, and fiddle around with configurations for weeks, until you come to the conclusion that it is just simpler to run Docker+Ubuntu to do what you want, even if it adds an annoying layer of abstraction, and finally wonder why you subjected yourself to this pain and torture, and then go back to newb-level distros like Arch/Gentoo/LFS.

10 points
muntooRemoved · saved before deletion
#!/bin/bash

START_DATE=$(date -d "7 months ago" +"%Y-%m-%d")
END_DATE=$(date -d "today" +"%Y-%m-%d")
MIRRORLIST=/etc/pacman.d/mirrorlist

curr_date=$(date -d "$START_DATE + 1 day" +"%Y-%m-%d")

update_by_date() {
  echo "$1"
  cp "$MIRRORLIST" "$MIRRORLIST.bak"
  year=$(date -d "$1" +"%Y")
  month=$(date -d "$1" +"%m")
  day=$(date -d "$1" +"%d")
  msg="Server = https://archive.archlinux.org/repos/$year/$month/$day/"'$repo/os/$arch'
  echo "$msg" > "$MIRRORLIST"
  sudo pacman -Syu
  cp "$MIRRORLIST.bak" "$MIRRORLIST"
}

while [ "$curr_date" != "$END_DATE" ]; do
  update_by_date "$curr_date"
  curr_date=$(date -d "$curr_date + 1 day" +"%Y-%m-%d")
done

Disclaimer: this is a joke. Maybe.

20 points

The community believes in a philosophically "correct" Nix way. NixOS has a fundamentally different design in package management at an operating system level. Unfortunately, this often means there are various incompatibilities between a traditional Linux system

/etc/        configuration
/usr/
  bin/       binaries
  lib/       libraries
  share/     other

...and a NixOS system, which has a central store that does not entirely disobey the traditional Filesystem Hierarchy Standard (FHS):

/etc/        configuration... except it is rebuilt/overwritten every install
/nix/store/
   4zby3xg4dayz4vfd00b9cxz9rgyr4wkr-libtiff-4.5.0
   9zkp73p2rzhi2ik784cibijknshccfg5-python3.9-docopt-0.6.2
   azw8rpjnfagvcqcrb1kprw5l13k9byaj-texlive-continue-0.2
   j00kdn6frhjvh5apw82y0314a2h2xh1v-tcl-8.6.11
   p02xv0wkyirnklvnwzrzgqks7vplqkif-firefox-99.0.1
   r0jh4xv63q39mp7jy2gfhdvgrp5fc5dn-texlive-cite-5.5
   v1yvlki9xi5bjjrzfw501z99wj4zd8l0-nvidia-optical-flow-sdk-2.0
   v43rggbqchp3l19692qwqmmfagf9l9qc-python3.9-more-itertools-8.12.0
   y4kagp06w01x31n1kr3ncpkvg5hiwidl-networkmanager-1.40.6

These hashes change very frequently (e.g. every update), so any package depending on one of these has to properly be patched to point to the correct location. Remember: NixOS has a different hierarchy that package developers are pretty much unaware of. For example, binaries sometimes need to stripped and/or told to point to another location for their dependencies. Making this work involves a lot of patching that has been done over the years by many contributors.

The focus on ensuring everything is "pure" (i.e., a deterministic function of deterministic dependencies, which may be located at some unknown path) is fine for users of officially maintained packages. However, this means that "impure" development methods (e.g. python virtualenvs) will suddenly break if any of the python libraries (e.g. numpy) depend on some external path that is assumed to be installed (e.g. /usr/lib/lib*.so.N). Various incompatibilities can occur, which all need to be manually patched by the user (i.e. not the official package maintainers!) to make the impure methods work, and if they do, then not necessarily in the originally desired way.

Allowing some "impurity" and improving compatibility with traditional Linux systems would likely make non-package-maintaining users' lives a lot easier, but the community does not think it's worth the tradeoff.


Disclaimer: I am not a Nix guru.

5 points

99% of NixOS's useful1 qualities without all the pain:

  • Simple declarative package management for Arch Linux. I keep my lists of packages in my dotfiles.

  • Backup all modified system configuration files:

      sudo tar czf backup.tar.gz $(sudo pacman -Qii | awk '/^MODIFIED/ {print $2}')
    
  • To restore packages from a specific date:

      sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
      sudo echo 'Server = https://archive.archlinux.org/repos/2023/05/28/$repo/os/$arch' > /etc/pacman.d/mirrorlist
      sudo pacman -Syu
      sudo mv /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist
    
  • Install all software using PKGBUILDs, and not sudo make install.

The resulting Arch system is immutable (without sudo), practically reproducible, and all configuration is declarative.

^1 What I find useful.



Rant section

NixOS is fun to try. But for my daily driver, I had to switch back to Arch after wantonly wasting weeks with Nix's nonpragmatically dogmatic paradigms.

  • Purity is taken to an insane level.
  • No FHS (e.g. /usr/lib/*.so) makes me pull my hair out.
  • Python and scientific computing and other "non-standard" development on NixOS truly sucks. Also poetry has quadruple the number of problems on NixOS.
  • PKGBUILDs are much easier to write than unholy NixOS incantations.
  • The AUR already has so many packages that I rarely have to write a PKGBUILD anyways. The same cannot be said of nixpkgs which is missing tons of packages.
  • #!/bin/bash --> #!/usr/bin/env bash... this actually leads to less portable scripts, and you're out of luck if you need any flags since the supposedly superior env method does not support such basic features.
  • Tons of stuff to learn and master or else: flakes, overlays, lazy functional package management requiring infinite Y-combinator recursion geekery but without stack-traces, patching libraries, a bunch of Nix "stdlib" commands like patchelf, lib.optional, and so on, and so on, and so on...
  • A PhD in reading PhD papers on NixOS à la Haskell syndrome. (Possibly an exaggeration.)
  • Avoiding dependency hell in the way that NixOS does induces a hell of its own.
  • Somehow knowing what libraries are needed for patching broken-out-of-the-box-software (literally all software on NixOS) since FHS is not a thing. Do you know what libz.so does? Do you remember what every one of the thousands of files in /usr/lib/lib*.so does? No? RIP. Google to find an unholy incantation if you're lucky.
  • Writing entire shell.nix files just to do some simple dev work... really?!

I breathe easy using Arch with the parts I find useful from NixOS and minus all the Haskell-inspired "avoid success at all costs" hair-pulling madness.

25 points

Give the application with a particular class, e.g.,

alacritty --class dropdown -e tmux new-session -A -s 0

Then move windows of that class to the special workspace automatically:

bind = $mod, grave, togglespecialworkspace, dropdown

windowrulev2 = float, class:^dropdown$
windowrulev2 = workspace special:dropdown, class:^dropdown$
windowrulev2 = size 99% 50%, class:^dropdown$
windowrulev2 = move 0.5% 0%, class:^dropdown$

...I use a similar mechanism for i3wm.

1 points

That does not necessarily indicate the environment variable was seen by Hyprland.

Try adding this to the Hyprland config:

env = WLR_NO_HARDWARE_CURSORS,1

Or alternatively, whatever executes Hyprland should see that variable:

WLR_NO_HARDWARE_CURSORS=1 Hyprland
1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.