-
-
Notifications
You must be signed in to change notification settings - Fork 386
most dev flake inputs flake=false #4294
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
base: main
Are you sure you want to change the base?
Changes from all commits
60aef07
201631b
0566e39
3b64bc6
27ab16a
7b80211
4d35f4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,39 @@ | ||
| { | ||
| description = "Private inputs for development purposes. These are used by the top level flake in the `dev` partition, but do not appear in consumers' lock files."; | ||
|
|
||
| # Avoid `flake = true` when we do not need to evaluate flake outputs or fetch flake inputs. | ||
| # e.g. when we only import loose files. | ||
|
MattSturgeon marked this conversation as resolved.
|
||
| inputs = { | ||
| # NOTE: Use a different name to the root flake's inputs.nixpkgs to avoid shadowing it. | ||
| # NOTE: The only reason we specify a nixpkgs input at all here, is so the other inputs can follow it. | ||
| # TODO: Once nix 2.26 is more prevalent, follow the root flake's inputs using a "path:../.." input. | ||
| dev-nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
|
|
||
| # flake-compat is used by the root `default.nix` to allow non-flake users to import nixvim | ||
| flake-compat.url = "github:NixOS/flake-compat"; | ||
| flake-compat = { | ||
| url = "github:NixOS/flake-compat"; | ||
| flake = false; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As @MattSturgeon pointed, flake-compat instructs declaring it with |
||
| }; | ||
|
|
||
| # keep-sorted start block=yes newline_separated=yes | ||
| devshell = { | ||
| url = "github:numtide/devshell"; | ||
| inputs.nixpkgs.follows = "dev-nixpkgs"; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not entirely sold on Imagine the scenario where an input changes its inputs without us noticing; if we pull it as a flake, then we get their new inputs transitively. If we don't, then things potentially break. If the reason we can set # Don't pull flake inputs or evaluate outputs.
# We exclusively use the flake-module file.
flake = false;Or perhaps a top-level comment along the lines of: # Avoid `flake = true` when we do not need to evaluate flake outputs or fetch flake inputs.
# e.g. when we only import loose files.TL;DR a) consider whether we're setting
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added that single comment above the inputs attribute. I've pointed out in this PR for each I think that projects that expose truly loose files such as |
||
| flake = false; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exposes a vanilla |
||
| }; | ||
|
|
||
| git-hooks = { | ||
| url = "github:cachix/git-hooks.nix"; | ||
| inputs.nixpkgs.follows = "dev-nixpkgs"; | ||
| inputs.flake-compat.follows = "flake-compat"; | ||
| flake = false; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exposes a vanilla |
||
| }; | ||
|
|
||
| home-manager = { | ||
| url = "github:nix-community/home-manager"; | ||
| inputs.nixpkgs.follows = "dev-nixpkgs"; | ||
| flake = false; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Provides a |
||
| }; | ||
|
|
||
| nix-darwin = { | ||
| url = "github:lnl7/nix-darwin"; | ||
| inputs.nixpkgs.follows = "dev-nixpkgs"; | ||
| flake = false; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Provides a vanilla |
||
| }; | ||
|
|
||
| nuschtosSearch = { | ||
|
|
@@ -40,7 +44,7 @@ | |
|
|
||
| treefmt-nix = { | ||
| url = "github:numtide/treefmt-nix"; | ||
| inputs.nixpkgs.follows = "dev-nixpkgs"; | ||
| flake = false; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Provides a vanilla |
||
| }; | ||
|
|
||
| # keep-sorted end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,30 @@ | ||
| { | ||
| self, | ||
| system, | ||
| lib, | ||
| }: | ||
| self.inputs.nix-darwin.lib.darwinSystem { | ||
| let | ||
| darwinSystem = import (self.inputs.nix-darwin + "/eval-config.nix"); | ||
| in | ||
| darwinSystem { | ||
| inherit lib; | ||
|
|
||
| modules = [ | ||
| { | ||
| nixpkgs.hostPlatform = system; | ||
| ( | ||
| { config, ... }: | ||
| { | ||
| nixpkgs = { | ||
| source = self.inputs.nixpkgs; | ||
| hostPlatform = system; | ||
| }; | ||
|
|
||
| programs.nixvim = { | ||
| enable = true; | ||
| }; | ||
| programs.nixvim = { | ||
| enable = true; | ||
| }; | ||
|
|
||
| system.stateVersion = 5; | ||
| } | ||
| system.stateVersion = config.system.maxStateVersion; | ||
|
MattSturgeon marked this conversation as resolved.
|
||
| } | ||
| ) | ||
| self.nixDarwinModules.nixvim | ||
| ]; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small price to pay?