From 89ec258c7cac6d83f673ae5e4ce170bfc2c1f615 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 30 Jun 2023 02:14:35 +0200 Subject: documentation: Link to nixpkgs master if rev is unknown This fixes error: The option `system.nixpkgsRevision' is used but not defined. --- modules/documentation/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules/documentation') diff --git a/modules/documentation/default.nix b/modules/documentation/default.nix index a49d277..4a4bcdc 100644 --- a/modules/documentation/default.nix +++ b/modules/documentation/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, baseModules, modules, ... }: +toplevel@{ config, lib, pkgs, baseModules, modules, ... }: with lib; @@ -25,7 +25,15 @@ let inherit pkgs config; version = config.system.darwinVersion; revision = config.system.darwinRevision; - nixpkgsRevision = config.system.nixpkgsRevision; + nixpkgsRevision = + if toplevel.options.system.nixpkgsRevision.isDefined + then config.system.nixpkgsRevision + + # If user does not use flakes and does not add rev to nixpkgs, we don't + # know which revision or even branch they're on. In this case we still want + # to link somewhere, so we hope that master hasn't changed too much. + else "master"; + options = let scrubbedEval = evalModules { -- cgit v1.2.3