aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 83b33bddfded29b3e88b016acd86184b86a44254 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# hm-extra

> Custom, mostly ad hoc, sometimes experimental home-manager modules

## Usage

Just add this flake as a home-manager module:

```nix
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

    nix-darwin.url = "github:LnL7/nix-darwin";
    nix-darwin.inputs.nixpkgs.follows = "nixpkgs";

    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    home-manager-extra.url = "git+https://git.segundo.io/nix/hm-extra";
  };

  outputs = inputs @ { self, nix-darwin, nixpkgs, home-manager, home-manager-extra }:
    let
      configuration = { ... }: {
        # Necessary for using flakes on this system.
        nix.settings.experimental-features = "nix-command flakes";
        # Set Git commit hash for darwin-version.
        system.configurationRevision = self.rev or self.dirtyRev or null;
      };
    in
    {
      darwinConfigurations = {
        lenny = nix-darwin.lib.darwinSystem {
          system = "aarch64-darwin";
          specialArgs = inputs;
          modules = [ configuration ] ++ [
            home-manager.darwinModules.home-manager
            { home-manager.sharedModules = [ home-manager-extra.default ]; }
          ];
        };
      };
    };
}
```