flake: add package attribute

It could be used like this:
```nix
{
  inputs = {
    nix-doom-emacs.url = "github:vlaci/nix-doom-emacs";
  };

  outputs =
    { nixpkgs, nix-doom-emacs
    , ...
    }: {
      nixosConfigurations.exampleHost = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ({ pkgs, ... }: {
            boot.isContainer = true;
            environment.systemPackages =
              let
                doom-emacs = nix-doom-emacs.package.${system} { doomPrivateDir = ./doom.d; };
              in
              [
                doom-emacs
              ];
          })
        ];
      };
    };
}
```

See documentation in `default.nix` to see what can be passed here
This commit is contained in:
László Vaskó
2021-07-09 00:25:52 +02:00
committed by ckie
parent 6379986368
commit c67cefcb80

View File

@ -77,7 +77,7 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }@inputs:
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
let
inherit (flake-utils.lib) eachDefaultSystem eachSystem;
in
@ -88,6 +88,10 @@
in
{
devShell = pkgs.mkShell { buildInputs = [ (pkgs.python3.withPackages (ps: with ps; [ PyGithub ])) ]; };
package = { dependencyOverrides ? { }, ...}@args:
pkgs.callPackage self (
args // { dependencyOverrides = (inputs // dependencyOverrides); }
);
}) //
eachSystem [ "x86_64-linux" ]
(system: {