@@ -45,15 +45,25 @@ func Run(opts ...command.Option[Options]) error {
4545 return StartFromGit (o .Runner , o .Profile , o .GitURL , o .Path , o .Local )
4646 }
4747
48- if o .Config == nil {
48+ path := filepath .Join (o .Local , o .Path , "qubesome.config" )
49+ if _ , err := os .Stat (path ); err != nil {
50+ return err
51+ }
52+ cfg , err := types .LoadConfig (path )
53+ if err != nil {
54+ return err
55+ }
56+ cfg .RootDir = filepath .Dir (path )
57+
58+ if cfg == nil {
4959 return fmt .Errorf ("cannot start profile: nil config" )
5060 }
51- profile , ok := o . Config .Profile (o .Profile )
61+ profile , ok := cfg .Profile (o .Profile )
5262 if ! ok {
5363 return fmt .Errorf ("cannot start profile: profile %q not found" , o .Profile )
5464 }
5565
56- return Start (o .Runner , profile , o . Config )
66+ return Start (o .Runner , profile , cfg )
5767}
5868
5969func validGitDir (path string ) bool {
@@ -157,6 +167,10 @@ func StartFromGit(runner, name, gitURL, path, local string) error {
157167 return fmt .Errorf ("cannot file profile %q in config %q" , name , cfgPath )
158168 }
159169
170+ if p .Runner != "" {
171+ runner = p .Runner
172+ }
173+
160174 // When sourcing from git, ensure profile path is relative to the git repository.
161175 pp , err := securejoin .SecureJoin (filepath .Dir (cfgPath ), p .Path )
162176 if err != nil {
@@ -462,6 +476,9 @@ func createNewDisplay(bin string, profile *types.Profile, display string) error
462476 dockerArgs = append (dockerArgs , "-v=" + xdgRuntimeDir + ":/run/user/1000" )
463477 }
464478 if profile .HostAccess .Gpus != "" {
479+ if strings .HasSuffix (bin , "podman" ) {
480+ dockerArgs = append (dockerArgs , "--runtime=nvidia.com/gpu=all" )
481+ }
465482 dockerArgs = append (dockerArgs , "--gpus" , profile .HostAccess .Gpus )
466483 }
467484
0 commit comments