Nix: add HM install info

This commit is contained in:
Mihai Fufezan 2022-09-09 17:53:49 +03:00
parent 85e8e93eba
commit 7545255f78
No known key found for this signature in database
GPG Key ID: 5899325F2F120900
1 changed files with 42 additions and 2 deletions

View File

@ -70,10 +70,50 @@ in {
You can use the Home Manager module by adding it to your configuration:
### With flakes
```nix
{ config, pkgs, inputs, ... }: {
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
# build with your own instance of nixpkgs
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, hyprland }: {
homeConfigurations."USER@HOSTNAME"= home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
hyprland.homeManagerModules.default
{ wayland.windowManager.hyprland.enable = true; }
# ...
];
};
};
```
Don't forget to replace `USER@HOSTNAME` with your username and hostname!
### Without flakes
```nix
# home config
{ config, pkgs, inputs, ... }: let
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
hyprland = (import flake-compat {
src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz";
}).defaultNix;
in {
imports = [
inputs.hyprland.homeManagerModules.default
hyprland.homeManagerModules.default
];
wayland.windowManager.hyprland.enable = true;