@@ -18,6 +18,7 @@ module Cli = struct
1818 { installables : string list
1919 ; target_info : target_info
2020 ; printcmd : bool
21+ ; force_experimental_features : string list option
2122 }
2223
2324 (* * Positional URI arguments passed to the program via the command line. *)
@@ -28,9 +29,14 @@ module Cli = struct
2829 Arg. (value & flag & info [ " printcmd" ] ~doc )
2930 ;;
3031
32+ let force_experimental_features =
33+ let doc = " Force the use of flakes and nix-command experimental features." in
34+ Arg. (value & flag & info [ " force" ; " f" ] ~doc )
35+ ;;
36+
3137 (* * Processes the args so that the main function knows what to do with them. *)
3238 let make_strategy =
33- let build original_args printcmd =
39+ let build original_args printcmd force_experimental_features =
3440 let installables, target_info =
3541 let default_installables = []
3642 and default_target =
@@ -87,9 +93,22 @@ module Cli = struct
8793 , { entrypoint = None ; attribute = None ; subshell_dir = Some subshell_dir } )
8894 | _ -> Uri. parse_targets_tr original_args, default_target)
8995 in
90- { installables; target_info; printcmd }
96+ { installables
97+ ; target_info
98+ ; printcmd
99+ ; force_experimental_features =
100+ (if force_experimental_features
101+ then
102+ Some
103+ [ " --extra-experimental-features"
104+ ; " flakes"
105+ ; " --extra-experimental-features"
106+ ; " nix-command"
107+ ]
108+ else None )
109+ }
91110 in
92- Term. (const build $ uris $ printcmd)
111+ Term. (const build $ uris $ printcmd $ force_experimental_features )
93112 ;;
94113
95114 let cmd entrypoint =
0 commit comments