nix-bundle icon indicating copy to clipboard operation
nix-bundle copied to clipboard

Bundle non-nixpkgs attributes

Open domenkozar opened this issue 8 years ago • 2 comments

How hard would it be to specify what nix file to use and which attribute to package outside nixpkgs?

cc @matthewbauer

domenkozar avatar Dec 18 '17 13:12 domenkozar

I haven't experimented too much with this but I think it's possible right now if a little bit hacky. Because it treats 'target' as an expression you can just pass in a Nix import like this:

nix-bundle '(import ./file.nix).attr'

See here for how it works:

https://github.com/matthewbauer/nix-bundle/blob/master/nix-bundle.sh#L45

matthewbauer avatar Dec 19 '17 18:12 matthewbauer

{ pkgs, daedalus, nix-bundle }:

let
  bundle = import "${nix-bundle}/share/nix-bundle" { nixpkgs = pkgs; };
  foo = bundle.nix-bootstrap {
    target = "${daedalus}";
    run = "/bin/daedalus";
  };
in foo

this is how i had solved it

cleverca22 avatar Feb 15 '18 17:02 cleverca22