Skip to content

Commit 21c3ae6

Browse files
authored
[config] update default nixpkgs commit to most recent nixos-22.11 (#344)
## Summary This PR updates the default nixpkgs commit to the most recent commit of nixos-22.11, as taken from https://status.nixos.org ## How was it tested? Added an example project, and verified that `devbox shell` for it works
1 parent c61ed06 commit 21c3ae6

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

config.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,10 @@ func ReadConfig(path string) (*Config, error) {
7676

7777
func upgradeConfig(cfg *Config, absFilePath string) error {
7878
if cfg.Nixpkgs.Commit == "" {
79-
// For now, we add the hardcoded value corresponding to the commit hash as of 2022-08-16 in:
80-
// `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable`
81-
// In the near future, this will be changed to the commit-hash of the unstable tag in nixpkgs github repository
82-
const defaultCommitHash = "af9e00071d0971eb292fd5abef334e66eda3cb69"
83-
debug.Log("Missing nixpkgs.version from config, so adding the default value of %s", defaultCommitHash)
79+
debug.Log("Missing nixpkgs.version from config, so adding the default value of %s",
80+
plansdk.DefaultNixpkgsCommit)
8481

85-
cfg.Nixpkgs.Commit = defaultCommitHash
82+
cfg.Nixpkgs.Commit = plansdk.DefaultNixpkgsCommit
8683
return WriteConfig(absFilePath, cfg)
8784
}
8885
return nil

examples/default_nixpkgs/devbox.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"packages": [
3+
"go"
4+
],
5+
"shell": {
6+
"init_hook": null
7+
},
8+
"nixpkgs": {
9+
"commit": "52e3e80afff4b16ccb7c52e9f0f5220552f03d04"
10+
}
11+
}

planner/plansdk/plansdk.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ type NixpkgsInfo struct {
217217
Sha256 string
218218
}
219219

220-
// Commit hash as of 2022-08-16
221-
// `git ls-remote https://github.com/nixos/nixpkgs nixos-unstable`
222-
const DefaultNixpkgsCommit = "af9e00071d0971eb292fd5abef334e66eda3cb69"
220+
// The commit hash for nixos-22.11 on 2022-12-06 from status.nixos.org
221+
const DefaultNixpkgsCommit = "52e3e80afff4b16ccb7c52e9f0f5220552f03d04"
223222

224223
func GetNixpkgsInfo(commitHash string) (*NixpkgsInfo, error) {
225224
return &NixpkgsInfo{

0 commit comments

Comments
 (0)