-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename defaultX
flake outputs to X.default
#5532
Comments
One issue with this is that we’ll then have a Also, if I want to reuse the outputs of flake as an overlay (do something like (not that these are really blockers of course, but it’s mildly annoying) |
Having suffered through lots of annoyance due to working with some nix code that mixes derivations with different meanings together: please keep collections homogeneous! Put the special attributes somewhere else. |
This brings up a slightly unrelated point of annoyance for me. There's a solid amount of flake attributes that are system namespaced as well as ones that are not system namespaced. The separation prevents things like cleanly writing a To reiterate on @michaelpj's point, one of the big appeals behind flakes (for me) was that:
If attributes are going to be modified for consistency, I think a standardized naming scheme and attribute shape makes more sense; but I think we should strongly avoid any situation in which |
Random suggestion: What about giving each flake a canonical name (with a That way there’s no need for a distinguished |
Beginning to implement: tomberek@28c2db5
Notes about using "name":
nixosConfigurations vs nixosConfigurations.HOSTNAME - special, need "hostname"
what if "name" is not defined? use "default" with warning to please add a name mismatch between flakeref's name and flake name attribute: todo: add to
Adding name will cause eval breakages.
|
Another suggestion: Introduce a default.package.<system>
default.devShell.<system>
default.app.<system>
...
# or
default.<system>.package
default.<system>.devShell
default.<system>.app
... This would lead to some consistency for default outputs and wouldn't "pollute" the namespace of the outputs. |
Another thought: if you only have a single item in the plural form (eg: |
@andreasfelix for the reasons contained in divnix/std#5 (comment) I think that's not a good idea (hence 👎 ). If not for that I would have liked your suggestion. TLDR; the special casing when consumed by downstream users "pollutes" downstream a bit through structurally different fully qualified identifiers, just looks weird. I'd favor a more "hidden"-feeling But I also like @tomberek last suggestion as a fall-back. |
Plan:
Solves the singular/plural issue. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/why-is-there-a-default-overlay-in-flakes/24422/1 |
Newer versions of Nix do not work with the old `flake.nix` because of the change described in: NixOS/nix#5532 This change fixes that while still preserving compatibility with older versions of Nix.
Newer versions of Nix do not work with the old `flake.nix` because of the change described in: NixOS/nix#5532 This change fixes that while still preserving compatibility with older versions of Nix.
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/modify-flake-now-that-defaultpackage-is-deprecated/25571/1 |
It seems somewhat unclear what the correct schema is for nix & nix-direnv, and id appears to differ between versions (?). The current version is based more or less on nix flake new -t github:nix-community/nix-direnv <desired output path> # from https://github.com/nix-community/nix-direnv https://serokell.io/blog/practical-nix-flakes NixOS/nix#5532 and https://nixos.wiki/wiki/Flakes With an extra output path alias added because my local nix-direnv complains otherwise.
As reported in #10 the cargo-culted warning about flake compatibility is showing up for users who are not on pre-2.7 nix. Additionally, running `nix flake check` shows warnings about the existence of the `defaultApp`, `defaultPackage`, and `devShell` keys that are only defined for compatibility purposes. At this point, feels safe enough to remove the warning. If someone complains because they are on a very old version of flakes I can easily revisit this decision. For background information on the flake schema change as of 2.7, see: - https://nixos.org/manual/nix/stable/release-notes/rl-2.7.html#release-27-2022-03-07 - NixOS/nix#5532 (comment)
This PR makes the following changes: * Add a `.envrc` file to auto-load the `flake.nix` when I enter the repository * This helps with e.g. Haskell VSCode integration * Only affects users of `direnv` * An alternative would be to add `.envrc` to the `.gitignore`, and let each developer write their own `.envrc` * Refactor the `flake.nix` file * Replace the [deprecated attributes](NixOS/nix#5532) `defaultPackage` and `devShell` * Explicitly track the `nixpkgs` dependency * This seems to be the convention for most flakes I have viewed * Add comments * Stop using a nixpkg overlay * Overlays are verbose & not newbie-friendly * [Overlays are overkill here, and do not scale well](https://zimbatm.com/notes/1000-instances-of-nixpkgs) * Misc. refactoring to reduce length I have tested the following features of `flake.nix`: * `nix develop` starts a sub-shell with `cabal`,etc. where I can build agda * `nix build` produces binaries in `result/bin/` Commits: * Add .envrc * flake.nix: replace deprecated `.devShell` etc. * flake.nix: track nixpkgs explicitly As opposed to implicitly via the flake registry: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#types * flake.nix: de-overlay & add comments * .gitignore nix build outputs * flake.nix: bump nixpkgs pin * flake.nix: add back overlay Using flake-parts to keep the overlay non-obtrusive * flake.nix: mark overlay as experimental
The switch from defaultPackage to packages.${system}.default happened in NixOS/nix#5532. Additionally I removed one layer: self.nixosConfigurations.my-microvm.config.microvm.declaredRunner; self.nixosConfiguration.config.microvm.declaredRunner; The latter should be easier to understand for new users.
This PR makes the following changes: * Add a `.envrc` file to auto-load the `flake.nix` when I enter the repository * This helps with e.g. Haskell VSCode integration * Only affects users of `direnv` * An alternative would be to add `.envrc` to the `.gitignore`, and let each developer write their own `.envrc` * Refactor the `flake.nix` file * Replace the [deprecated attributes](NixOS/nix#5532) `defaultPackage` and `devShell` * Explicitly track the `nixpkgs` dependency * This seems to be the convention for most flakes I have viewed * Add comments * Stop using a nixpkg overlay * Overlays are verbose & not newbie-friendly * [Overlays are overkill here, and do not scale well](https://zimbatm.com/notes/1000-instances-of-nixpkgs) * Misc. refactoring to reduce length I have tested the following features of `flake.nix`: * `nix develop` starts a sub-shell with `cabal`,etc. where I can build agda * `nix build` produces binaries in `result/bin/` Commits: * Add .envrc * flake.nix: replace deprecated `.devShell` etc. * flake.nix: track nixpkgs explicitly As opposed to implicitly via the flake registry: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#types * flake.nix: de-overlay & add comments * .gitignore nix build outputs * flake.nix: bump nixpkgs pin * flake.nix: add back overlay Using flake-parts to keep the overlay non-obtrusive * flake.nix: mark overlay as experimental
`nix flake check` no longer returns warnings.
`nix flake check` no longer returns warnings.
The switch from defaultPackage to packages.${system}.default happened in NixOS/nix#5532.
The switch from defaultPackage to packages.${system}.default happened in NixOS/nix#5532.
The switch from defaultPackage to packages.${system}.default happened in NixOS/nix#5532.
Bugfix over the short-lived 1.20.0 ChangeLog: https://github.com/brndnmtthws/conky/releases/tag/v1.20.0 Features * Build AppImage separately per OS * Rotate appimage signing key * Add/use clang 15 on ubuntu builds * Define text_object.data.l as "long long" * Bump web deps, fix lint * Updated flake per NixOS/nix#5532 * Fix bad imlib2 typedefs for imlib<1.10 * Use --force with brew install, block upgrades * Tidy up docs * Update README.md * Update README.md * Handle external PropertyNotify events * Label dependency changes * Tweak XSendEvent arguments * Add modified date to web docs * Improve documentation for window types and hints * Refactor x11 event handling * Issue template: Link docs to obtain stack traces * Exclusive XInput event handling Bug fixes * Enable wayland in appimage build * Fix regression in lua_load path handling * Lua imlib2 fixes * Increase max length of ACPI temp (fixes #977) * Skip propagation of non-input events * Fix render order in draw_stuff * Fix event propagation on Openbox * Fix missing y_abs argument copy
…20.0 Brenden Matthews (40): Bump version Enable wayland in appimage build Add missing deps Build appimage on PRs Only sign appimage if the signing key is available Typo Fix clang versions Include arch in appimage name Check librsvg version before enabling Make sure correct libc++ is installed Refactor this Underp this derp Rotate appimage signing key Add/use clang 15 on ubuntu builds This too Reorder these Bump version Bump web deps, fix lint Updated flake per NixOS/nix#5532 Update install instructions, fix Lua link Fix bad imlib2 typedefs for imlib<1.10 This is duplicated Actually that won't work Update README.md Use --force with brew install, block upgrades This too Just ignore homebrew return code Fix regression in lua_load path handling Fix naming conflict for Imlib2.h Tidy up docs Add note about nixpkgs package to README Increase max length of ACPI temp (fixes #977) Update README.md Update README.md Label dependency changes Bump web deps Add modified date to web docs Bump follow-redirects (and other things) Sort Issue template: Link docs to obtain stack traces Livanh (2): Define text_object.data.l as "long long" Re-define text_object.data.l as "int64_t" Simon Lees (12): lua-imlib2: Improve Error handling lua-imlib2: Implement Stride in a standard way lua-imlib2: Fix alpha mask so that its scaled lua-imlib2: Add cairo_imlib2_helper to docs. lua-imlib2: move to conky style logging lua-imlib2: Fix typo in the docs. lua-imlib2: Add missing logging.h file Split cairo_draw_image into two functions Swap to internal C++ logging.h Fix Memory Leak cmake: use full path rather then relative. Document cairo_place_image Stavros Ntentos (10): Build AppImage separately per OS `jobs.<job_id>.strategy.fail-fast = false` Missed `.sha256` extension Ubuntu 20.04 clang+library-versions typo D'oh! We need tags to `git describe` Try harder to ignore duplicate `conky.1.gz`s Allow visibility in `>> $GITHUB_ENV`s Download in `pwd`, not in `artifacts/` `git describe --tags --always --debug`?? `actions/checkout@v4`: with: `fetch-depth: 0` Tin Švagelj (9): Handle external PropertyNotify events Skip propagation of non-input events Fix render order in draw_stuff (#1801) Fix event propagation on Openbox Set propagate to True, to not propagate by default (#1809) Fix missing y_abs argument copy (#1813) Improve documentation for window types and hints (#1818) Refactor x11 event handling (#1819) Exclusive XInput event handling (#1821) dependabot[bot] (8): build(deps): bump softprops/action-gh-release from 1 to 2 build(deps): bump the web-deps group in /web with 6 updates build(deps): bump DeterminateSystems/magic-nix-cache-action from 3 to 4 build(deps): bump DeterminateSystems/nix-installer-action from 9 to 10 build(deps-dev): bump the web-deps group in /web with 7 updates build(deps): bump the web-deps group in /web with 11 updates build(deps): bump the web-deps group in /web with 8 updates build(deps-dev): bump express from 4.18.2 to 4.19.2 in /web
Bugfix over the short-lived 1.20.0 ChangeLog: https://github.com/brndnmtthws/conky/releases/tag/v1.20.0 Features * Build AppImage separately per OS * Rotate appimage signing key * Add/use clang 15 on ubuntu builds * Define text_object.data.l as "long long" * Bump web deps, fix lint * Updated flake per NixOS/nix#5532 * Fix bad imlib2 typedefs for imlib<1.10 * Use --force with brew install, block upgrades * Tidy up docs * Update README.md * Update README.md * Handle external PropertyNotify events * Label dependency changes * Tweak XSendEvent arguments * Add modified date to web docs * Improve documentation for window types and hints * Refactor x11 event handling * Issue template: Link docs to obtain stack traces * Exclusive XInput event handling Bug fixes * Enable wayland in appimage build * Fix regression in lua_load path handling * Lua imlib2 fixes * Increase max length of ACPI temp (fixes #977) * Skip propagation of non-input events * Fix render order in draw_stuff * Fix event propagation on Openbox * Fix missing y_abs argument copy
Yeah, it's deprecated NixOS/nix#5532. But that's the API we were fulfilling, let's be stable. Fixes #22
We have a couple of flake outputs that have a corresponding "default" flake output, e.g.
packages
anddefaultPackage
devShells
anddevShell
apps
anddefaultApp
overlays
andoverlay
nixosModules
andnixosModule
templates
anddefaultTemplate
bundlers
anddefaultBundler
There are also some flake outputs that lack a default, but could probably use one, like
nixosConfigurations
.As can be seen above, the naming is inconsistent. It also requires a lot of special handling in commands like
nix flake show
andnix flake check
. So I propose getting rid of all the singular flake outputs and using an attribute nameddefault
as the default. E.g.defaultPackage.<system>
=>packages.<system>.default
devShell.<system>
=>devShells.<system>.default
overlay
=>overlays.default
Migration: we can deprecate the old singular flake outputs in 2.5 and remove support for them some time later.
The text was updated successfully, but these errors were encountered: