Live data from Hacker News

What Is Nix?

engineering.shopify.com

321–330 of 344 posts

Re: What Is Nix?

#321

Earlier quoted context omitted.

It's not a bug in macOS, it's a security feature. However, you can use synthetic firmlinks to define arbitrary root-level paths that _are_ writable. See `man synthetic.conf` and check out https://derflounder.wordpress.com/2020/01/18/creating-root-l... for an example usage. PS: It looks like nix has a PR open to test that solution here: https://github.com/NixOS/nix/pull/3212

However, you can use synthetic firmlinks to define arbitrary root-level paths that _are_ writable. See `man synthetic.conf` No, synthetic.conf only creates directories or symlinks. If it actually created firmlinks, the problem would probably be much smaller. The problem with symlinks is that some builds use realpath . If /nix was a symlink to e.g. /usr/local/nix , this would result in /usr/local/nix being used in thi…

I stand corrected, I must have misunderstood the doc.

Re: What Is Nix?

#322

Earlier quoted context omitted.

By this do you mean developers doing local builds still run their builds at the command-line via nix-shell and don’t ever build from Xcode directly? That sounds very awkward.

Not at all — you can control what commands are actually executed when developers hit the play button or do ⌘+B/⌘+R in Xcode. Xcode is fundamentally just an IDE, even though we forget that sometimes since it's traditionally coupled so tightly with xcodebuild.

Ok so developers would normally just have an external build target selected as the active target? I assume this means you lose all of Xcode's scheme editor capabilities though.

Re: What Is Nix?

#323

Earlier quoted context omitted.

Interestingly, sshd WILL magically know to look at /nix/store/efgh5678-my-sshd-config-2.0/etc/ssh_config. Usually you would use sshd as a systemd service (possible to do and manage with Nix in Ubuntu, but why would you?). If so, you would write the systemd configuration using Nix and the service file deployed to NixOS (or Ubuntu, imagine deploying some custom/proprietary service you want isolated from whatever else t…

Interesting, thank you! So that means programs are sometimes patched to look for configs in nonstandard locations generated by Nix during installation time. But then if I wish to change any of those configs (maybe to change one of the defaults)... I have to copy them, make my modifications, generate my own package for them, and install them to wire them in as substitutes for the existing packages. Then when the upstr…

> programs are sometimes patched to look for configs in nonstandard locations generated by Nix

This may be true, but typically the NixOS module will specify the generated config file via the command line [0] or symlink the generated config to the default location in /etc [1]. I don't believe it's terribly common to patch programs to have different config file paths in nixpkgs.

If you're just using plain Nix on a foreign distro, and not, say, home-manager or similar, it's up to you to provide your own configuration including service units. Presumably you could use Nix for this as well, but I'm not terribly familiar with using Nix on foreign distros.

[0]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e... [1]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e...

Re: What Is Nix?

#324
post #181

Earlier quoted context omitted.

Interestingly, sshd WILL magically know to look at /nix/store/efgh5678-my-sshd-config-2.0/etc/ssh_config. Usually you would use sshd as a systemd service (possible to do and manage with Nix in Ubuntu, but why would you?). If so, you would write the systemd configuration using Nix and the service file deployed to NixOS (or Ubuntu, imagine deploying some custom/proprietary service you want isolated from whatever else t…

Woah, I'm lost here. The idea is that it uses /etc/ssh/sshd_config as its input? (How do you handle upgrades, then?) What is d4ys2c8kzzcp3g4fv3ivy7a5nkayg7w2?

In NixOS, typically the config files will be generated from scratch using the Nix language, see for example sshd [0] or bind [1].

`d4ys2c8kzzcp3g4fv3ivy7a5nkayg7w2` is a hash of the inputs to a derivation (a package in Nix terms).

In a sense, at it's lowest level, a derivation is a function `f(x) -> y` where `x` is some Nix expressions (including the inputs and how to build it, often in bash) and `y` is a nix store path. The nix store path includes the hash which is a hash of `x`.

For bind, the config file itself is a derivation, it just uses a plain string (interpolated with variables via Nix) into the writeText wrapper.

[0]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e... [1]: https://github.com/NixOS/nixpkgs/blob/de493bd74921139860624e...

Re: What Is Nix?

#325
post #265
post #56

Earlier quoted context omitted.

Hi! Yes, and here's the link to my recent Nixology playlist: https://www.youtube.com/playlist?list=PLRGI9KQ3_HP_OFRG6R-p4...

Hey! At the end of your article you mentioned you're hiring. Are the positions remote? If yes, how can I get in touch?

Yes, we’re hiring! You may have seen the news today that we’re all in on remote now. Send an email to burke.libbey@shopify.com, I’m as good a point of contact as any for Nix stuff.

Re: What Is Nix?

#326
post #233

Earlier quoted context omitted.

Funny, I was able to install it (for use with pytorch) just a few days ago without a hitch.

Did you use conda? It does a lot of the leg work for you.

No, I tried conda once, but it downloaded gigs and gigs of data, and I have enough trouble trying to keep nix under control.

Re: What Is Nix?

#327

Earlier quoted context omitted.

That was my reading, based on the fact that they glossed over Nix itself and attributed most of the issues to code complexity.

It explicitly says this, though: > while much of that build time is attributable to Nix's way of building dependencies And that part just doesn't make sense to me. I can't see any way in which specifically Nix's way of building dependencies would contribute to this. The compiling of the universe, sure, but then why mention Nix?

It does say that, but it's off in its own clause, then shifts focus away from it towards what seems like the focus of the auditors.

Re: What Is Nix?

#328

Earlier quoted context omitted.

Part of the removed code: test("guy", function() { assert.equal(typeof babel.guy, "string"); }); Facepalming so hard right now

In case you hadn't noticed, this was a joke commit. The code in question was never actually a real part of Babel.

I assure you, I understand what an easter egg is. I was facepalming at the test, which was doing the equivalent of:

    expect(true).toBe(true)

Re: What Is Nix?

#329
post #308

Earlier quoted context omitted.

Maybe I'm missing the joke, but even if you use printf() in C you are using C standard library.

It's not a joke. I don't use printf, scanf, malloc, etc...

What do you do?

I don't think you can make syscalls without embedding assembly into your C code.

Re: What Is Nix?

#330

Earlier quoted context omitted.

Then why would a build take so long as GP describes?

GP here. My guess is that they intentionally disabled binary caching because this is a financial application and they wanted to make sure no untrusted binaries got into the build pipeline.

Thanks! That makes some sense. Though, I work for a financial service provider as well and have never found compile-from source to be solution to that problem. If you do have dependencies, whether you trust the sources or the binaries shouldn't really matter, as long as you trust the repositories where they come from. And if you don't trust it I wanna see the army of developers actually checking all the sources down to the system level.
Post reply on HN