From c4c761ba554bc674b0d5a89eb7e9f7a488a8859d Mon Sep 17 00:00:00 2001 From: contrun Date: Tue, 23 Nov 2021 14:36:55 +0800 Subject: [PATCH] add flake attribute apps to make it easier to run (#2442) Home Manager can be ran with `nix run --no-write-lock-file github:nix-community/home-manager`. This is useful for people who want to try out Home Manager or, want to bootstrap their home-environment. --- flake.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flake.nix b/flake.nix index 3114798e..9382351e 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,15 @@ defaultPackage = forAllSystems (system: self.packages.${system}.home-manager); + apps = forAllSystems (system: { + home-manager = { + type = "app"; + program = "${defaultPackage.${system}}/bin/home-manager"; + }; + }); + + defaultApp = forAllSystems (system: apps.${system}.home-manager); + lib = { hm = import ./modules/lib { lib = nixpkgs.lib; }; homeManagerConfiguration = { configuration, system, homeDirectory