File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ if [[ -z "$flake_uri" ]]; then
6565 )
6666else
6767 extraBuildFlags+=(
68- --extra-experimental-features " flakes"
68+ --extra-experimental-features " flakes"
69+ --argstr flakeStr " $flake "
6970 --argstr flakeUri " $flake_uri "
7071 --argstr flakeAttr " ${flake_attr:- " vm" } "
7172 )
Original file line number Diff line number Diff line change 22, system ? builtins . currentSystem
33, configuration ? <nixos-config>
44
5+ , flakeStr ? null # flake as named on the command line
56, flakeUri ? null
67, flakeAttr ? null
78} :
@@ -42,8 +43,28 @@ if flakeUri != null then
4243 if flakeSystem != null then
4344 if flakeSystem ? "extendModules" then
4445 flakeSystem . extendModules { modules = nixosShellModules ; }
45- else
46+ else if flakeSystem ? "override" then
4647 flakeSystem . override ( attrs : { modules = attrs . modules ++ nixosShellModules ; } )
48+ else
49+ throw ''
50+ '${ flakeStr } #${ flakeAttr } ' is missing the expected 'override' attribute.
51+
52+ Please ensure that '${ flakeStr } #${ flakeAttr } ' is an overridable attribute set by declaring it with 'lib.makeOverridable'.
53+
54+ For instance:
55+
56+ nixosConfigurations = let
57+ lib = nixpkgs.lib;
58+ in {
59+ "${ flakeAttr } " = lib.makeOverridable lib.nixosSystem {
60+ # ...
61+ };
62+ };
63+
64+ Alternatively, upgrade to a version of nixpkgs that provides the 'extendModules' function on NixOS system configurations.
65+
66+ See https://github.com/Mic92/nixos-shell#start-a-virtual-machine for additional information.
67+ ''
4768 else if flakeModule != null then
4869 mkShellSystem flakeModule
4970 else
You can’t perform that action at this time.
0 commit comments