···2727 # We set it to null, to remove the "legacy" entrypoint's
2828 # non-hermetic default.
2929 system = null;
3030- } // args
3030+3131+ modules = args.modules ++ [
3232+ # This module is injected here since it exposes the nixpkgs self-path in as
3333+ # constrained of contexts as possible to avoid more things depending on it and
3434+ # introducing unnecessary potential fragility to changes in flakes itself.
3535+ #
3636+ # See: failed attempt to make pkgs.path not copy when using flakes:
3737+ # https://github.com/NixOS/nixpkgs/pull/153594#issuecomment-1023287913
3838+ ({ config, pkgs, lib, ... }: {
3939+ config.nixpkgs.flake.source = self.outPath;
4040+ })
4141+ ];
4242+ } // builtins.removeAttrs args [ "modules" ]
3143 );
3244 });
3345
···2020 - This can be disabled through the `environment.stub-ld.enable` option.
2121 - If you use `programs.nix-ld.enable`, no changes are needed. The stub will be disabled automatically.
22222323+- On flake-based NixOS configurations using `nixpkgs.lib.nixosSystem`, NixOS will automatically set `NIX_PATH` and the system-wide flake registry (`/etc/nix/registry.json`) to point `<nixpkgs>` and the unqualified flake path `nixpkgs` to the version of nixpkgs used to build the system.
2424+2525+ This makes `nix run nixpkgs#hello` and `nix-build '<nixpkgs>' -A hello` work out of the box with no added configuration, reusing dependencies already on the system.
2626+2727+ This may be undesirable if nix commands are not going to be run on the built system since it adds nixpkgs to the system closure. For such closure-size-constrained non-interactive systems, this setting should be disabled.
2828+2929+ To disable this, set [nixpkgs.flake.setNixPath](#opt-nixpkgs.flake.setNixPath) and [nixpkgs.flake.setFlakeRegistry](#opt-nixpkgs.flake.setFlakeRegistry) to false.
3030+2331- Julia environments can now be built with arbitrary packages from the ecosystem using the `.withPackages` function. For example: `julia.withPackages ["Plots"]`.
24322533- A new option `systemd.sysusers.enable` was added. If enabled, users and
···111119112120- `nitter` requires a `guest_accounts.jsonl` to be provided as a path or loaded into the default location at `/var/lib/nitter/guest_accounts.jsonl`. See [Guest Account Branch Deployment](https://github.com/zedeus/nitter/wiki/Guest-Account-Branch-Deployment) for details.
113121122122+- `boot.supportedFilesystems` and `boot.initrd.supportedFilesystems` are now attribute sets instead of lists. Assignment from lists as done previously is still supported, but checking whether a filesystem is enabled must now by done using `supportedFilesystems.fs or false` instead of using `lib.elem "fs" supportedFilesystems` as was done previously.
123123+114124- `services.aria2.rpcSecret` has been replaced with `services.aria2.rpcSecretFile`.
115125 This was done so that secrets aren't stored in the world-readable nix store.
116126 To migrate, you will have create a file with the same exact string, and change
···172182- The vendored third party libraries have been mostly removed from `cudaPackages.nsight_systems`, which we now only ship for `cudaPackages_11_8` and later due to outdated dependencies. Users comfortable with the vendored dependencies may use `overrideAttrs` to amend the `postPatch` phase and the `meta.broken` correspondingly. Alternatively, one could package the deprecated `boost170` locally, as required for `cudaPackages_11_4.nsight_systems`.
173183174184- The `cudaPackages` package scope has been updated to `cudaPackages_12`.
185185+186186+- Ada packages (libraries and tools) have been moved into the `gnatPackages` scope. `gnatPackages` uses the default GNAT compiler, `gnat12Packages` and `gnat13Packages` use the respective matching compiler version.
187187+188188+- `spark2014` has been renamed to `gnatprove`. A version of `gnatprove` matching different GNAT versions is available from the different `gnatPackages` sets.
175189176190- `services.resolved.fallbackDns` can now be used to disable the upstream fallback servers entirely by setting it to an empty list. To get the previous behaviour of the upstream defaults set it to null, the new default, instead.
177191
···11-{ pkgs, ... }:
11+{ lib, ... }:
2233{
44 imports = [ ./installation-cd-minimal-new-kernel.nix ];
5566- # Makes `availableOn` fail for zfs, see <nixos/modules/profiles/base.nix>.
77- # This is a workaround since we cannot remove the `"zfs"` string from `supportedFilesystems`.
88- # The proper fix would be to make `supportedFilesystems` an attrset with true/false which we
99- # could then `lib.mkForce false`
1010- nixpkgs.overlays = [(final: super: {
1111- zfs = super.zfs.overrideAttrs(_: {
1212- meta.platforms = [];
1313- });
1414- })];
66+ boot.supportedFilesystems.zfs = lib.mkForce false;
157}
···11-{ pkgs, ... }:
11+{ lib, ... }:
2233{
44 imports = [ ./sd-image-aarch64-new-kernel-installer.nix ];
5566- # Makes `availableOn` fail for zfs, see <nixos/modules/profiles/base.nix>.
77- # This is a workaround since we cannot remove the `"zfs"` string from `supportedFilesystems`.
88- # The proper fix would be to make `supportedFilesystems` an attrset with true/false which we
99- # could then `lib.mkForce false`
1010- nixpkgs.overlays = [(final: super: {
1111- zfs = super.zfs.overrideAttrs(_: {
1212- meta.platforms = [];
1313- });
1414- })];
66+ boot.supportedFilesystems.zfs = lib.mkForce false;
157}
+105
nixos/modules/misc/nixpkgs-flake.nix
···11+{ config, options, lib, pkgs, ... }:
22+33+with lib;
44+55+let
66+ cfg = config.nixpkgs.flake;
77+in
88+{
99+ options.nixpkgs.flake = {
1010+ source = mkOption {
1111+ # In newer Nix versions, particularly with lazy trees, outPath of
1212+ # flakes becomes a Nix-language path object. We deliberately allow this
1313+ # to gracefully come through the interface in discussion with @roberth.
1414+ #
1515+ # See: https://github.com/NixOS/nixpkgs/pull/278522#discussion_r1460292639
1616+ type = types.nullOr (types.either types.str types.path);
1717+1818+ default = null;
1919+ defaultText = "if (using nixpkgsFlake.lib.nixosSystem) then self.outPath else null";
2020+2121+ example = ''builtins.fetchTarball { name = "source"; sha256 = "${lib.fakeHash}"; url = "https://github.com/nixos/nixpkgs/archive/somecommit.tar.gz"; }'';
2222+2323+ description = mdDoc ''
2424+ The path to the nixpkgs sources used to build the system. This is automatically set up to be
2525+ the store path of the nixpkgs flake used to build the system if using
2626+ `nixpkgs.lib.nixosSystem`, and is otherwise null by default.
2727+2828+ This can also be optionally set if the NixOS system is not built with a flake but still uses
2929+ pinned sources: set this to the store path for the nixpkgs sources used to build the system,
3030+ as may be obtained by `builtins.fetchTarball`, for example.
3131+3232+ Note: the name of the store path must be "source" due to
3333+ <https://github.com/NixOS/nix/issues/7075>.
3434+ '';
3535+ };
3636+3737+ setNixPath = mkOption {
3838+ type = types.bool;
3939+4040+ default = cfg.source != null;
4141+ defaultText = "config.nixpkgs.flake.source != null";
4242+4343+ description = mdDoc ''
4444+ Whether to set {env}`NIX_PATH` to include `nixpkgs=flake:nixpkgs` such that `<nixpkgs>`
4545+ lookups receive the version of nixpkgs that the system was built with, in concert with
4646+ {option}`nixpkgs.flake.setFlakeRegistry`.
4747+4848+ This is on by default for NixOS configurations built with flakes.
4949+5050+ This makes {command}`nix-build '<nixpkgs>' -A hello` work out of the box on flake systems.
5151+5252+ Note that this option makes the NixOS closure depend on the nixpkgs sources, which may add
5353+ undesired closure size if the system will not have any nix commands run on it.
5454+ '';
5555+ };
5656+5757+ setFlakeRegistry = mkOption {
5858+ type = types.bool;
5959+6060+ default = cfg.source != null;
6161+ defaultText = "config.nixpkgs.flake.source != null";
6262+6363+ description = mdDoc ''
6464+ Whether to pin nixpkgs in the system-wide flake registry (`/etc/nix/registry.json`) to the
6565+ store path of the sources of nixpkgs used to build the NixOS system.
6666+6767+ This is on by default for NixOS configurations built with flakes.
6868+6969+ This option makes {command}`nix run nixpkgs#hello` reuse dependencies from the system, avoid
7070+ refetching nixpkgs, and have a consistent result every time.
7171+7272+ Note that this option makes the NixOS closure depend on the nixpkgs sources, which may add
7373+ undesired closure size if the system will not have any nix commands run on it.
7474+ '';
7575+ };
7676+ };
7777+7878+ config = mkIf (cfg.source != null) (mkMerge [
7979+ {
8080+ assertions = [
8181+ {
8282+ assertion = cfg.setNixPath -> cfg.setFlakeRegistry;
8383+ message = ''
8484+ Setting `nixpkgs.flake.setNixPath` requires that `nixpkgs.flake.setFlakeRegistry` also
8585+ be set, since it is implemented in terms of indirection through the flake registry.
8686+ '';
8787+ }
8888+ ];
8989+ }
9090+ (mkIf cfg.setFlakeRegistry {
9191+ nix.registry.nixpkgs.to = mkDefault {
9292+ type = "path";
9393+ path = cfg.source;
9494+ };
9595+ })
9696+ (mkIf cfg.setNixPath {
9797+ # N.B. This does not include nixos-config in NIX_PATH unlike modules/config/nix-channel.nix
9898+ # because we would need some kind of evil shim taking the *calling* flake's self path,
9999+ # perhaps, to ever make that work (in order to know where the Nix expr for the system came
100100+ # from and how to call it).
101101+ nix.nixPath = mkDefault ([ "nixpkgs=flake:nixpkgs" ]
102102+ ++ optional config.nix.channel.enable "/nix/var/nix/profiles/per-user/root/channels");
103103+ })
104104+ ]);
105105+}
···33# the modules necessary to mount the root file system, then calls the
44# init in the root file system to start the second boot stage.
5566-{ config, lib, utils, pkgs, ... }:
66+{ config, options, lib, utils, pkgs, ... }:
7788with lib;
99···636636 };
637637638638 boot.initrd.supportedFilesystems = mkOption {
639639- default = [ ];
640640- example = [ "btrfs" ];
641641- type = types.listOf types.str;
642642- description = lib.mdDoc "Names of supported filesystem types in the initial ramdisk.";
639639+ default = { };
640640+ inherit (options.boot.supportedFilesystems) example type description;
643641 };
644642645643 boot.initrd.verbose = mkOption {
+17-4
nixos/modules/tasks/filesystems.nix
···246246 };
247247248248 boot.supportedFilesystems = mkOption {
249249- default = [ ];
250250- example = [ "btrfs" ];
251251- type = types.listOf types.str;
252252- description = lib.mdDoc "Names of supported filesystem types.";
249249+ default = { };
250250+ example = lib.literalExpression ''
251251+ {
252252+ btrfs = true;
253253+ zfs = lib.mkForce false;
254254+ }
255255+ '';
256256+ type = types.coercedTo
257257+ (types.listOf types.str)
258258+ (enabled: lib.listToAttrs (map (fs: lib.nameValuePair fs true) enabled))
259259+ (types.attrsOf types.bool);
260260+ description = lib.mdDoc ''
261261+ Names of supported filesystem types, or an attribute set of file system types
262262+ and their state. The set form may be used together with `lib.mkForce` to
263263+ explicitly disable support for specific filesystems, e.g. to disable ZFS
264264+ with an unsupported kernel.
265265+ '';
253266 };
254267255268 boot.specialFileSystems = mkOption {
···2121 postPatch = ''
2222 # relax version bounds
2323 sed -i 's/\([A-z0-9]*\)~=.*$/\1/' setup.cfg
2424- # not sure what Flask-Session2 is but flask-session works just fine
2525- sed -i '/Flask-Session2/d' setup.cfg
2624 '';
27252826 propagatedBuildInputs = with python3.pkgs; [
···2828 '';
29293030 meta = with lib; {
3131+ # Does not build against gcc-13. No development activity upstream
3232+ # for past few years.
3333+ broken = true;
3134 description = "General-purpose neural model for efficient learning of entity embeddings";
3235 homepage = "https://ai.facebook.com/tools/starspace/";
3336 license = licenses.mit;
···377377378378 # this symlink points to the unwrapped gnat's output "out". It is used by
379379 # our custom gprconfig compiler description to find GNAT's ada runtime. See
380380- # ../../development/tools/build-managers/gprbuild/{boot.nix, nixpkgs-gnat.xml}
380380+ # ../../development/ada-modules/gprbuild/{boot.nix, nixpkgs-gnat.xml}
381381 ln -sf ${cc} $out/nix-support/gprconfig-gnat-unwrapped
382382 ''
383383
···5454 # link gprconfig_kb db from gprbuild-boot into build dir,
5555 # the install process copies its contents to $out
5656 preInstall = ''
5757- ln -sf ${gprbuild-boot}/share/gprconfig share/gprconfig
5757+ # Use PATH to discover spliced gprbuild-boot from buildPackages,
5858+ # since path interpolation would give us gprbuild-boot from pkgsHostTarget
5959+ gprbuild_boot="$(dirname "$(type -p gprbuild)")/.."
6060+ ln -sf "$gprbuild_boot/share/gprconfig" share/gprconfig
5861 '';
59626063 # no need for the install script