Method: ConfCtl::Nix#run_command_in_shell

Defined in:
lib/confctl/nix.rb

#run_command_in_shell(packages: [], command: nil) ⇒ Boolean

Parameters:

  • packages (Array<String>) (defaults to: [])
  • command (String) (defaults to: nil)

Returns:

  • (Boolean)


338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/confctl/nix.rb', line 338

def run_command_in_shell(packages: [], command: nil)
  args = ['nix-shell']

  if packages.any?
    args << '-p'
    args.concat(packages)
  end

  args << '--command'
  args << command

  cmd.run!(*args, env: { 'shellHook' => nil }).success?
end