Readit News logoReadit News
aidenn0 commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
xaduha · 17 hours ago

    [user@nixos:~]$ which grep
    /run/current-system/sw/bin/grep

    [user@nixos:~]$ ls -l /run/current-system/sw/bin/grep
    lrwxrwxrwx 1 root root 65 Jan  1  1970 /run/current-system/sw/bin/grep -> /nix/store/737jwbhw8ji13x9s88z3wpp8pxaqla92-gnugrep-3.12/bin/grep
Basically, it is still in your environment, so I don't see how he can claim that this problem doesn't exist in Nix, unless you use flakes like a proper Nix afficionado.

aidenn0 · 14 hours ago
Yes, the original comment that this problem doesn't exist in Nix is wrong for a typical user environment.

It does contain the issue a bit though:

I'm running isync in a systemd service, yet the program "mbsync" is not in my path. I have several services installed, yet their programs aren't in my path. My e-mail client shells out to "file" for mime-type verification, yet "file" is not in my path.

Run "compgen -c |wc -l" to get a list of commands; its over 7000 on my Ubuntu system and right around 2000 on my NixOS system.

As an aside, the packages that put the most executables in my path are probably going to be in the path for most NixOS installs (231 just for coreutils+util-linux):

     27 /nix/store/csxa6mi2mpjl9vqxbv2j0bha6sz6nbjw-cups-2.4.14
     31 /nix/store/334afxah19b3hr6ll93pfxlcyhhh2vws-pipewire-1.4.9
     31 /nix/store/h2jsb5i4yfblr2f3ac2c7zpmlmj7zjym-perl-5.40.0
     33 /nix/store/914x32c982bs3i1998yxvkg9svm3ycr5-shadow-4.18.0
     33 /nix/store/a6s3hzj3b2z6rsyfkjyxwn265iyfl2gn-mtools-4.0.49
     33 /nix/store/jky7jszaci5n7g426wf6nsg5dmik9nfw-kbd-2.9.0
     37 /nix/store/2v1l6mqz0d7mfpp4ksw2048v3g0a1a19-hplip-3.25.2
     45 /nix/store/90wlc37ljr6rpy2lan46bp0gq19vbgl5-iptables-1.8.11
     48 /nix/store/1byhxs7b28grh8s15jc2dvs2zg36swjb-lvm2-2.03.35-bin
     61 /nix/store/9xwxjkrwxjsvc5gs1l0syr4wbfvvvvcn-bluez-5.84
     64 /nix/store/zf8qy81dsw1vqwgh9p9n2h40s1k0g2l1-systemd-258.2
     72 /nix/store/1igrj9w84w7s3r80l3nkxcqwd84sw9mz-qemu-10.1.2
    106 /nix/store/v4q3154vdc83fxsal9syg9yppshdljyk-coreutils-full-9.8
    125 /nix/store/3c6r8gh8zrqw8xmncmlj9vivz9rz6r30-util-linux-2.41.2-bin

aidenn0 commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
Arcuru · 17 hours ago
I'm not sure I'll ever understand why they replaced their working ~50 line shell script with a Rust program that just shells out to the same nix-* commands. I appreciate that there are some safety benefits, but that program is just not complex enough to benefit.
aidenn0 · 15 hours ago
Shell is already memory safe, so there's not even "we replaced C" to lean on.
aidenn0 commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
ablob · 17 hours ago
So if I want to use grep in a small script, do I have to write:

/nix/store/grep-hash -flags files | /nix/store/head-hash

instead of: "grep -flags files | head"?

aidenn0 · 15 hours ago
If it's a one off, you just use something like "nix shell" to add it to your path for running the script.

For non one-off sorts of things, you would substitute in the nix expression "${gnugrep}/bin/grep" the "${gnugrep}" will expand to "/nix/store/grep-hash" and also make a dependency on the gnugrep package, so that the grep install won't get garbage-collected as long as your package is still around.

Here's an example[1] from a package expression for e-mail client I use, which will shell out to base64 and file. Upstream relies on these two programs being in $PATH, but this replaces the string used for shelling out with the absolute path in the nix store.

For shell scripts, I'll just do something like this near the top:

   GREP="${GNU_GREP:-$(command -v grep)}"
Then I use "$GREP" in the script itself, and develop with grep in my path, but it's trivial to prepend all of my dependencies when I bundle it up for nix.

1: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/no...

aidenn0 commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
ahepp · 17 hours ago
The "solution" of only ever using full absolute paths works on any unix system, doesn't it?
aidenn0 · 15 hours ago
Yes with a but:

NixOS simultaneously smooths the path to using absolute paths while putting some (admittedly minor) speed-bumps in the way when avoiding them. If you package something up that uses relative paths it will probably break for someone else relatively quickly.

What that means is that you end up with a system in which absolute paths are used almost everywhere.

This is why the killer feature of NixOS isn't that you can configure things from a central place; RedHat had a tool to do that at least 25 years ago; it's that since most of /etc/ is read-only, you must configure everything from a central place, which has two important effects:

1. The tool for configuring things in a central place can be much simplified since it doesn't have to worry about people changing things out from under it

2. Any time someone runs into something that is painful with the tool for configuring things in a central place, they have to improve the tool (or abandon NixOS).

aidenn0 commented on Child prodigies rarely become elite performers   economist.com/science-and... · Posted by u/i7l
FeteCommuniste · 3 days ago
> I know nothing about child psychology or anything adjacent, but I honestly think a lot of "advanced child" stuff is just maturity.

That makes me think back to my elementary school, where a lot of the kids who got into the "gifted" program just happened to be, surprise surprise, some of the oldest kids in their grade.

At that age the better part of a year in brain development can be exactly the "edge" one needs to excel. And then it can become self-reinforcing when kids gravitate toward the areas in which they dominate their peers.

aidenn0 · 3 days ago
FWIW, the test for the gifted program at my elementary school normalized their entrytest results for age.
aidenn0 commented on How not to securely erase a NVME drive (2022)   peterbabic.dev/blog/how-n... · Posted by u/transpute
SoftTalker · 3 days ago
For SATA SSDs i've used the hdparm secure erase and then verified that dd | hexdump is all zeros. That was good enough for me.
aidenn0 · 3 days ago
Depending on your threat model, your check is insufficient, since dd |hexdump will be all zeros even if you just trim all the blocks for a drive that is trim-to-zero.

Securely erasing flash drives with a threat model of "someone will dump the raw data of the chips" is only fully solvable for self-encrypting drives where you can replace the key. Even if you can issue a block-erase for every single block of the device, block erase doesn't always succeed on NAND.

aidenn0 commented on 1 kilobyte is precisely 1000 bytes?   waspdev.com/articles/2026... · Posted by u/surprisetalk
Symbiote · 5 days ago
"Giga" was considered to sound silly until it became common and we no longer care. "Yotta" sounds silly (to me) now.
aidenn0 · 4 days ago
1.21 Gigawatts doesn't sound silly at all!
aidenn0 commented on Floppinux – An Embedded Linux on a Single Floppy, 2025 Edition   krzysztofjankowski.com/fl... · Posted by u/GalaxySnail
blackhaz · 5 days ago
I have MS Office 4.0 installed on my 386DX-40 with 4 MB of RAM and 210 MB HDD, running Windows 3.1, and it is good. Most of the common features are there, it's a perfectly working office setup. The major thing missing is font anti-aliasing. Office 95 and 97 are absolutely awesome.
aidenn0 · 5 days ago
I do remember running Word on an Am386DX-40 and later an i486DX2-66 and there was an issue that wouldn't be a problem with faster hardware; the widow/orphan control happened live so if you made an edit, then hit print, there was a race condition where you could end up with a duplicated line or missing line across page boundaries. Since later drafts tended to have fewer edits, I once turned in a final draft of a school paper with such an error.
aidenn0 commented on Pretty soon, heat pumps will be able to store and distribute heat as needed   sintef.no/en/latest-news/... · Posted by u/PaulHoule
rekabis · 6 days ago
I would love to see a bus-sized version for year-long temperature moderation. Like, drop house heat into it during the summer so it can re-heat the house over the winter, and pull all the heat out of it by Spring so that it can cool the house over the summer.

Bus sized because that amount of thermal mass is bound to take up a lot of space, but capable of being buried so that it doesn’t actually take up property space.

aidenn0 · 5 days ago
I live in a climate where, for most of the year, the daily high-low temperature range includes 20C, so I'd like a whatever sized one is needed to average that out, and run most of the year without any active heating or cooling.
aidenn0 commented on 4x faster network file sync with rclone (vs rsync) (2025)   jeffgeerling.com/blog/202... · Posted by u/indigodaddy
aidenn0 · 6 days ago
rclone is not as good as rsync for doing ad-hoc transfers; for anything not using the filesystem, you need to set up a configuration, which adds friction. It realy is purpose built for recurring transfers rather than "I need to move X to Y just once"

u/aidenn0

KarmaCake day29185November 13, 2008
About
e-mail: <my username>@geocities.com
View Original