[Nix-dev] Should you be able to call args: the same way as { .. } : ?

Marc Weber marco-oweber at gmx.de
Fri Sep 25 13:56:34 CEST 2009


Example


my-experimental-modified-all-packages-dot-nix-with-post-processing.nix

1) 
  args:

  let pkgs = import /etc/nixos/nixpkgs/pkgs/all-packages.nix args;
  in [ .. Do whatever you want here .. ]
===


Using this function argument I can't just, can I?

nix-build -A MPlayer $PATH_TO_THAT_FILE


However when duplicating the arguments it works fine. But this is much
more verbose. I can't even use args@{..} style here, can I?

2)
  # copy paste from all-packages.nix (I can't use args:)
  { system ? builtins.currentSystem
  , stdenvType ? system
  , bootStdenv ? null
  , noSysDirs ? true
  , gccWithCC ? true
  , gccWithProfiling ? true
  , config ? null
  }:

  let 
      args = { inherit system stdenvType bootStdenv noSysDirs gccWithCC gccWithProfiling config; };
      pkgs = import ./all-packages.nix args;

===

Does it make sense to allow nix-build (ing) from a file as show in 1) ?

Marc Weber



More information about the nix-dev mailing list