5 ms·
Nix is source-based. If you write your own "package definitions" you can distribute those in all the same ways you would use for source code, since they are sou
by matrss 3y ago
Nix is source-based. If you write your own "package definitions" you can distribute those in all the same ways you would use for source code, since they are source code. nixpkgs for example is a monorepo of many of those package definitions, among other things. Flakes are a (still experimental) approach to (among other things) streamline the options you have outside of nixpkgs inclusion.
If you also want to distribute pre-built binaries you would use a cache. https://cache.nixos.org/ https://cache.nixos.org/ is exactly that for nixpkgs. You can host your own via http(s), ssh or s3. There is also cachix, which is basically a hosting provider for nix caches that is pretty widespread in the community, I think.
- k__ 3y agoWhat about Nix Channels?
- matrss 3y agoChannels are, AFAIU, a reference to some point-in-time/commit/version of nixpkgs. They are exposed in the form of branches in the nixpkgs repository and used in some other places as well. A channel has a set of conditions that need to be met for it to be advanced to a newer version of nixpkgs. For the nixpkgs-unstable channel, which follows the master branch, the packages it contains need to be built by hydra and be present in the global cache before it advances (I don't think this is true for all packages, but this is the general idea). This is to make sure that users who use packages from this channel will mostly find them in the cache (if you use master directly you can often run into packages that you need to compile yourself, because they are not yet present in the cache). The stable channels are basically "just" branched of from master (or nixpkgs-unstable? not sure) when the given point release is due (there is more to it, for example there is an effort made to make all the packages contained in that release actually buildable, called "Zero Hydra Failures" or ZHF). They will then mostly stay that way apart from the odd backport for security reasons and the likes. Basically, it is very similar to how a larger software project might be managed with a develop branch and older releases that still receive backports. (This is my mental model of it anyway, as a user for a few years. There are probably details that might be a bit off or not exactly accurate.)
- rgoulter 3y ago> Channels are, AFAIU, a reference to some point-in-time/commit/version of nixpkgs It's not specifically nixpkgs, but any Nix code generally. Per the Nix manual[0]: > Channels are a mechanism for referencing remote Nix expressions and conveniently retrieving their latest version. e.g. home-manager's suggested channel is just the github tarball for the relevant branch[1]: nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager [0] https://nixos.org/manual/nix/stable/command-ref/nix-channel https://nixos.org/manual/nix/stable/command-ref/nix-channel [1] https://nix-community.github.io/home-manager/index.html#sec-install-standalone https://nix-community.github.io/home-manager/index.html#sec-...
- nurple 3y agoGreat clarification, and just to relate flakes: a flake input is like a package-local channel instead of being system-wide.
- anotherhue 3y agoI believe they ultimately end up pointing at git repos.
- rgoulter 3y agoe.g. I think it's common for users to share their config or sets of packages with something like a "nix user repository" https://github.com/nix-community/nur-packages-template https://github.com/nix-community/nur-packages-template