Conversation
This seems reasonable. Do you have info on the idiom? Does this increase evaluation time?
This also seems good, I like less inputs. What does this do to
Reasonable.
I don't understand the advantages here, assuming The docs were written long ago. Even back then though I think the majority of users should use the pre-built ISOs though that may change as we change the release model. The docs certainly need updating, I don't think that thought has ever been particularly clear. |
$ nix eval .#self.
.#self.checks .#self.inputs .#self.outPath .#self.sourceInfo
.#self.devShells .#self.lastModified .#self.outputs .#self.submodules
.#self.dirtyRev .#self.lastModifiedDate .#self.overlays .#self._type
.#self.dirtyShortRev .#self.narHash .#self.packages
.#self.formatter .#self.nixosModules .#self.self
It doesn't, nixfmt-tree is simply just a nixpkgs way of creating a treefmt.toml for use with
Many users (including me) use direnv to automatically enter a nix shell environment within their editors. nix-shell complains if there isn't a default package set and so setting the installer iso as the default package resolves that. |
I'm not sure the installer iso is a reasonable default package setting. nixos-apple-silicon provides a bunch of individual packages, but its main output is mostly the module code, which is consumed from other NixOS code. Maybe it's fine to leave that warning for now. Can you rebase this PR (it needs rebasing) and drop 50b90e1? |
|
Sorry, I thought I commented, but my concern with making the installer as the dev shell is that the user would have to build all the dependencies (kernel, etc.) just to start the environment. |
|
Dropped the default package commit and rebased on current main. |
|
Force pushed and rebased on current main |
Changes Summary
Outputs pattern
I noticed that the flake used
selfas a self-referential attribute but the more idiomatic way to use it is withinherit (self) outputswhich allows for droppingrecand makes self-referring much easier.Dropping treefmt-nix
In my research while looking at the CI for nixpkgs, I discovered the
nixfmt-treepackage which fills in all the messy details for us while also allowing for dropping the treefmt-nix input.For more information see: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/ni/nixfmt-tree/package.nix#L60
For the PR linting workflow: we can use
nix flake checkas always.devShells/Direnv
In addition, I added direnv support and devshells which contains only
treefmtin its environment to assist in contributions.Default package attribute:
The next thing that the devshell also pointed out is that there wasn't a default package attribute for this flake, so I used the installer-boostrap for it. This allows for one-liners like this to be used:
So we can simplify the cloning step for flakes users (which afaik is in the majority) and also have a one liner for building the ISO which can shorten the install documentation which has users build each package separately.
flatten
nixpkgs.urlJust for consistency, I don't see any need for any additional flake inputs besides nixpkgs and flake compat.
Testing
For testing this PR, I ran
nix flake checkas well asnix flake showandnix flake metadata