@@ -36,19 +36,19 @@ impl interface::OsArgs {
3636 /// - `BuildVm`: Builds a `NixOS` VM image
3737 pub fn run ( self ) -> Result < ( ) > {
3838 use OsRebuildVariant :: { Boot , Build , Switch , Test } ;
39- // Always resolve installable from env var at the top
40- let resolved_installable = platform :: resolve_env_installable (
41- "NH_OS_FLAKE" ,
42- match & self . subcommand {
43- OsSubcommand :: Boot ( args) => args. common . installable . clone ( ) ,
44- OsSubcommand :: Test ( args) => args. common . installable . clone ( ) ,
45- OsSubcommand :: Switch ( args) => args. common . installable . clone ( ) ,
46- OsSubcommand :: Build ( args) => args. common . installable . clone ( ) ,
47- OsSubcommand :: BuildVm ( args ) => args . common . common . installable . clone ( ) ,
48- OsSubcommand :: Repl ( args ) => args . installable . clone ( ) ,
49- _ => Installable :: default ( ) , // fallback for Info/Rollback, not used
50- } ,
51- ) ;
39+ // Always resolve installable from env var at the top, or use the provided one
40+ let fallback_installable = match & self . subcommand {
41+ OsSubcommand :: Boot ( args ) => args . common . installable . clone ( ) ,
42+ OsSubcommand :: Test ( args ) => args . common . installable . clone ( ) ,
43+ OsSubcommand :: Switch ( args) => args. common . installable . clone ( ) ,
44+ OsSubcommand :: Build ( args) => args. common . installable . clone ( ) ,
45+ OsSubcommand :: BuildVm ( args) => args. common . common . installable . clone ( ) ,
46+ OsSubcommand :: Repl ( args) => args. installable . clone ( ) ,
47+ _ => Installable :: default ( ) , // fallback for Info/Rollback, not used
48+ } ;
49+
50+ let resolved_installable =
51+ platform :: resolve_env_installable ( "NH_OS_FLAKE" ) . unwrap_or ( fallback_installable ) ;
5252 match self . subcommand {
5353 OsSubcommand :: Boot ( args) => {
5454 args. rebuild_with_installable ( Boot , None , resolved_installable)
0 commit comments