ITADN

devshell does not include `outputs` attrs

#340Openmaxheld83 创建于 2025-03-14
bug
M
maxheld83commented
**Describe the bug** A vanilla flake (or even with flake-parts) with `devShells` entry will yield, for example, a `outputs.devShells.aarch64-darwin.default.outputs` attribute set. A flake using on devshell does not have this attribute set. **To Reproduce** Steps to reproduce the behavior: Vanilla/flake-parts flake: ```nix { description = "Description for the project"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts = { inputs.nixpkgs-lib.follows = "nixpkgs"; url = "github:hercules-ci/flake-parts"; }; }; outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "aarch64-darwin" ]; perSystem = { pkgs, ... }: { devShells.default = pkgs.mkShell { packages = [ pkgs.git ]; }; }; }; } ``` in `nix repl`, this yields: ``` nix-repl> outputs.devShells.aarch64-darwin.default.outputs [ "out" ] ``` Using a minimal devshell flake: ```nix { description = "Description for the project"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts = { inputs.nixpkgs-lib.follows = "nixpkgs"; url = "github:hercules-ci/flake-parts"; }; devshell.url = "github:numtide/devshell"; }; outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { imports = [ inputs.devshell.flakeModule ]; systems = [ "aarch64-darwin" ]; perSystem = { pkgs, ... }: { devshells.default = { packages = [ pkgs.git ]; }; }; }; } ``` `nix repl` yields: ``` nix-repl> outputs.devShells.aarch64-darwin.default.outputs warning: Nix search path entry '/Users/max/.nix-defexpr/channels' does not exist, ignoring error: attribute 'outputs' missing at «string»:1:1: 1| outputs.devShells.aarch64-darwin.default.outputs | ^ ``` **Expected behavior** I am interpreting [`derivation {}`'s docs](https://nix.dev/manual/nix/2.25/language/derivations) to imply that while *it's* `outputs` argument is optional, because it has a default `"out"`, all flake outputs *can be expected to have a `*.default.outputs` attribute set*. **System information** This is macOS 15.3.1, nix (Nix) 2.26.2. **Additional context** Other software such as flake-iter also seems to assume the `*.default.outputs` attribute; that's where I ran into this problem, see https://github.com/DeterminateSystems/flake-iter/issues/22
1 条评论