Age | Commit message (Collapse) | Author | Files | Lines |
|
While an Emacs user edits a file foo.nix, Emacs creates a lock file
.#foo.nix as a broken symlink to USER@HOSTNAME.PID:TIMESTAMP.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Interlocking.html
If the file is in the overlays directory, this breaks all nixpkgs
imports with this error, until the user saves the file:
error: getting status of '/home/user/.config/nixpkgs/overlays/user@hostname.683628:1654370645': No such file or directory
Fix this by ignoring filenames beginning with .# in overlay
directories.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
|
|
|
This is now possible, since the `platform` attribute has been removed in
PR #107214. I've been waiting to do a cleanup like this for a long time!
|
|
This reverts commit fa6064ad86a020f52a75219bff044714f2a9ebbd.
|
|
For a full description of the underlying issue please read
https://github.com/NixOS/nix/issues/4003
|
|
This reverts commit 71184f8e157672789602d3f28bdd3c8079800687.
|
|
There were two issues:
* builtins.getEnv was called deep into the nixpkgs tree making it hard
to discover. This is solved by moving the call into
pkgs/top-level/impure.nix
* when the config was explicitly set by the user to false, it would
still try and load the environment variable. This meant that it was
not possible to guarantee the same outcome on two different systems.
|
|
This makes things a little bit more convenient. Just pass in like:
$ nix-build ’<nixpkgs>’ -A hello --argstr localSystem x86_64-linux --argstr crossSystem aarch64-linux
|
|
|
|
|
|
If we passed a localSystem in, we don’t want the current system to
override it. Now we check for localSystem first to avoid getting
"mixed" localSystem values from commands like this:
nix-build --arg localSystem '{config="x86_64-unknown-linux-musl";}' -A hello
Which would eventually evaluate localSystem to this:
{
config = "x86_64-unknown-linux-musl";
system = "x86_64-darwin";
}
& Nix would not be able to run it correctly.
Fixes #41599
/cc @Ericson2314
|
|
If impure.nix gets the path from NIX_PATH, the type is `path`, and `path+"/."` is a no-op. Stringify it first so `isDir` will return false if it's not, in fact, a dir. This way, single files can be specified with nixpkgs-overlays in the NIX_PATH.
|
|
"\." is apparently the same as "." wheras the correct one is "\\."
|
|
|
|
|
|
#23016.
Note that ${} substitution doesn't work because of the "cannot refer
to other paths" constraint. The paranthesis are needed to enforce
right-first evaluation.
|
|
|
|
This is instead of both system and platform, which is kind of ugly.
|
|
attrNames already returns names in sorted order.
|
|
The former is still respected as a fallback for config.nix for
backwards compatibility (but not for overlays because they're a new
feature).
|
|
The Nix search path is the established mechanism for specifying the
location of Nix expressions, so let's use it instead of adding another
environment variable.
|
|
For example, this prevents Nix from barfing on editor backup files in
~/.nixpkgs/overlays.
|
|
|
|
This patch add a new argument to Nixpkgs default expression named "overlays".
By default, the value of the argument is either taken from the environment variable `NIXPKGS_OVERLAYS`,
or from the directory `~/.nixpkgs/overlays/`. If the environment variable does not name a valid directory
then this mechanism would fallback on the home directory. If the home directory does not exists it will
fallback on an empty list of overlays.
The overlays directory should contain the list of extra Nixpkgs stages which would be used to extend the
content of Nixpkgs, with additional set of packages. The overlays, i-e directory, files, symbolic links
are used in alphabetical order.
The simplest overlay which extends Nixpkgs with nothing looks like:
```nix
self: super: {
}
```
More refined overlays can use `super` as the basis for building new packages, and `self` as a way to query
the final result of the fix-point.
An example of overlay which extends Nixpkgs with a small set of packages can be found at:
https://github.com/nbp/nixpkgs-mozilla/blob/nixpkgs-overlay/moz-overlay.nix
To use this file, checkout the repository and add a symbolic link to
the `moz-overlay.nix` file in `~/.nixpkgs/overlays` directory.
|
|
|