No description
Find a file
2024-11-10 16:28:47 +01:00
.github Move scripts/flake-regressions.sh into the flake-regressions repo 2024-11-06 17:09:11 +01:00
build-utils-meson refact: Extract build-utils-meson/libatomic 2024-11-07 11:40:02 +01:00
config Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
contrib function-trace: always show the trace 2019-09-18 23:23:21 +02:00
doc/manual Merge pull request #11826 from DeterminateSystems/revert-11804 2024-11-08 12:04:55 +01:00
m4 Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
maintainers Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
misc Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
mk Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
packaging Remove shellInputs.i686-linux 2024-11-08 13:14:43 +01:00
scripts Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
src Merge remote-tracking branch 'nixos/master' 2024-11-10 16:28:47 +01:00
tests Merge remote-tracking branch 'nixos/master' 2024-11-10 16:28:47 +01:00
.clang-format Factor out lookupExecutable and other PATH improvments 2024-08-07 18:12:58 -04:00
.clang-tidy Add .clang-tidy 2024-02-01 01:01:39 +01:00
.dir-locals.el .dir-locals.el: Set c-block-comment-prefix 2020-07-10 11:21:06 +02:00
.editorconfig No global eval settings in libnixexpr 2024-06-24 12:15:16 -04:00
.gitignore Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
.mergify.yml mergify: enable merge-queue for backports 2024-09-18 08:46:07 +02:00
.shellcheckrc housekeeping: shellcheck for tests/functional/ca/build-cache.sh 2024-06-12 17:41:16 -04:00
.version Bump version 2024-08-01 10:43:00 +02:00
CITATION.cff chore: PhD thesis as reference in CITATION.cff 2024-05-18 20:05:22 +02:00
configure.ac Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
CONTRIBUTING.md Rename doc/manual{src -> source} 2024-10-14 11:21:24 -04:00
COPYING * Change this to LGPL to keep the government happy. 2006-04-25 16:41:06 +00:00
default.nix add flake-compat to flake.nix and use sha256 in default.nix 2023-03-06 21:11:24 +01:00
docker.nix fix "add an option to include flake-registry..." 2023-05-16 14:35:31 +02:00
flake.lock flake.lock: Update 2024-08-16 07:09:27 -07:00
flake.nix Merge remote-tracking branch 'nixos/master' 2024-11-10 16:28:47 +01:00
HACKING.md Rename doc/manual{src -> source} 2024-10-14 11:21:24 -04:00
local.mk Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
Makefile Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
Makefile.config.in Revert "Merge pull request #11804 from obsidiansystems/remove-old-make" 2024-11-07 13:46:37 +01:00
meson.build meson: add options for docs, unit tests and binding 2024-11-06 00:21:18 +11:00
meson.options meson: add options for docs, unit tests and binding 2024-11-06 00:21:18 +11:00
package.nix Merge remote-tracking branch 'nixos/master' 2024-11-10 16:28:47 +01:00
precompiled-headers.h Build a minimized Nix with MinGW 2024-04-17 12:26:10 -04:00
README.md README: update CI badge 2024-08-22 23:16:14 +08:00
shell.nix Remove url literals 2022-01-24 13:28:21 +01:00

Nix Super

It's Nix, but super!

This is an upstream-tracking fork of Nix that includes various patches, some controversial in nature and not fit for Nix upstream.

Features

nix-flake-default.patch from nix-dram

This uses an older version of the patch, when the name of the default installable was not yet configurable.

If you have an entry called default in your Nix registry, you can do things like:

$ nix shell jq gron kubectl
# equivalent to nix shell default#jq default#gron default#kubectl

More information

Experimental features enabled by default

The following experimental features are enabled by default:

  • flakes (Xp::Flakes)
  • nix-command (Xp::NixCommand)
  • fetch-tree (Xp::FetchTree)

Additional settings

The following settings are added to this fork:

  • reject-flake-config: rejects all flake configuration (including whitelisted settings) and warns about it

Full thunk evaluation in flake.nix

In stock Nix, only the outputs section of flake.nix is able to make full use of the Nix language. The inputs section as well as the top-level attribute set are required to be trivial. This is for good reason, as it prevents arbitrarily complex computations during operations where you would not expect this, such as nix flake metadata. Nonetheless, people were often annoyed by this limitation. Nix Super includes patches to disable the triviality checks, to encourage experimentation with fancy new ways of handling flake inputs.

Named packages in nix profile

A preemptive merge of https://github.com/NixOS/nix/pull/8678

Activatables

Nix Super introduces the concept of activatables; applications that are installed solely in their own profile and rely on an activation script to perform actions outside of the Nix store.

Two new subcommands are implemented to make use of activatables:

  • nix system for managing NixOS, as a replacement for nixos-rebuild
  • nix home for managing home-manager configurations, as a replacement for the home-manager CLI tool

The $ operator

The $ operator or function application operator can be used to reduce parentheses hell in some situations, though its semantics are slightly different from the Haskell variant, making this one less useful.

builtins.trace "asdf" $ map toString [ 1 2 3 ]

Easy use of callPackage from the CLI

The flag -C/--call-package allows you to directly build callPackageable expressions from the CLI. This invokes import <nixpkgs> {} to get access to callPackage.

$ cat hello.nix
{
  stdenv,
  hello
}:

stdenv.mkDerivation {
  name = "hello";

  nativeBuildInputs = [ hello ];

  buildCommand = "hello > $out";
}

$ nix build -C hello.nix
$ cat result
Hello, world!

CLI overrides

Various CLI flags have been added to allow on-the-fly overriding of installables.

Override expression arguments

Allows overriding any argument usually overridable via .override. Can be used multiple times.

$ nix build ffmpeg --override withMfx true

Override packages

Like --override, but for overriding packages. This can be any installable from any flake. Can be used multiple times.

$ nix build nil --override-pkg nix github:privatevoid-net/nix-super

Override attributes

The previous attributes are available in old, but are also in scope via with.

$ nix build hello --override-attrs '{ name = "my-${name}"; src = ./.; }' --impure

Use withPackages

The packages are available in ps, but are also in scope via with.

$ nix shell python3 --with '[ numpy pandas matplotlib ]'

Do anything

--apply-to-installabe gives you direct access to the installable in a function

$ nix build writeText --apply-to-installable 'writeText: writeText "test" "hello"'

Additional environment variables for nix shell

nix shell will prepend the /bin directory of a given package to PATH, but what about other environment variables?

Nix Super configures many other environment variables, including:

  • CUPS_DATADIR
  • DICPATH
  • GIO_EXTRA_MODULES
  • GI_TYPELIB_PATH
  • GST_PLUGIN_PATH_1_0
  • GTK_PATH
  • INFOPATH
  • LADSPA_PATH
  • LIBEXEC_PATH
  • LV2_PATH
  • MOZ_PLUGIN_PATH
  • QTWEBKIT_PLUGIN_PATH
  • TERMINFO_DIRS
  • XDG_CONFIG_DIRS
  • XDG_DATA_DIRS

It also sets IN_NIX3_SHELL=1 to allow external processes to detect when you're in a Nix shell, for scripting or shell prompt customization.

Support for the git+ipld fetcher scheme

Adds git+ipld to the list of supported URL schemes for the git fetcher. Allows you to use Nix with git-remote-ipld.

NOTE: This does not mean that Nix Super itself has any IPFS capabilities (yet).