-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
nixos/modules/flake/source-info: new module #179772
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,31 @@ | ||||||
{ config, lib, ... }: | ||||||
|
||||||
with lib; | ||||||
|
||||||
let sourceInfo = config.system.nixos.configuration.sourceInfo; | ||||||
|
||||||
in | ||||||
{ | ||||||
options = { | ||||||
|
||||||
system.nixos.configuration.sourceInfo = mkOption { | ||||||
type = types.attrsOf types.anything; | ||||||
default = {}; | ||||||
example = "self.sourceInfo"; | ||||||
description = '' | ||||||
The source information of a flake-based NixOS configuration. | ||||||
If set, the attribute <literal>configurationRevision</literal> | ||||||
will appear properly in the output of | ||||||
<literal>nixos-version --json</literal>. | ||||||
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. Doesn't it also occur in the grub and systemd-boot boot menus? 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. It does not. Currently, the menus contain only the Note that the 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.
Ok. That can be done in another PR if desirable.
Sounds good, but these are all quite independent problems. It's best to resolve them in separate PRs, so that maintainers don't need to keep (in the limit) all of NixOS in their head in order to approve them. 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. Sure, there will be at least three PRs: this one, one for obtaining revisions, and another one for applying the feature. I will try to write a detailed design later. |
||||||
|
||||||
Caution: Setting this option may result in unnecessary | ||||||
re-deployments if the flake repository changes but the | ||||||
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.
Suggested change
|
||||||
specific system configuration does not change. | ||||||
''; | ||||||
}; | ||||||
}; | ||||||
|
||||||
config = { | ||||||
system.configurationRevision = mkIf (sourceInfo ? rev) sourceInfo.rev; | ||||||
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. Can we set it to 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. 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. The intention of setting it to
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. @roberth Do we solve this later as a part of NixOS/rfcs#125? 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. We can scope this discussion out regardless. |
||||||
}; | ||||||
} |
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.
You could do this and then write markdown if you like
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.
Updated. The example also gets improved.