From 520adafcb993bf382e9c3e20742c9b4f998330bf Mon Sep 17 00:00:00 2001 From: Sandro Date: Thu, 11 Nov 2021 22:46:52 +0100 Subject: [PATCH] docs: add example how to use flakes on non-NixOS --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 80a6c3eca..b36712897 100644 --- a/README.md +++ b/README.md @@ -356,6 +356,33 @@ as follows: } ``` +If you are not using NixOS you can place the following flake in +`~/.config/nixpkgs/flake.nix` to load your standard Home Manager +configuration: + +```nix +{ + description = "A Home Manager flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs: { + homeConfigurations = { + jdoe = inputs.home-manager.lib.homeManagerConfiguration { + system = "x86_64-linux"; + homeDirectory = "/home/jdoe"; + username = "jdoe"; + configuration.imports = [ ./home.nix ]; + }; + }; + }; +} +``` + Note, the Home Manager library is exported by the flake under `lib.hm`.