From c67cefcb80c743ff5f4347e6ae5013c79f4da7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= Date: Fri, 9 Jul 2021 00:25:52 +0200 Subject: [PATCH] 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 --- flake.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 70c4ab3..a1f594b 100644 --- a/flake.nix +++ b/flake.nix @@ -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: {