Skip to content

Commit

Permalink
Merge pull request #111 from Samxamnom/main
Browse files Browse the repository at this point in the history
Adding Nix + Home Manager to installation documentation
  • Loading branch information
joelparkerhenderson committed Apr 17, 2024
2 parents 7b941c3 + 8ab533f commit 6ccbd9c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions doc/install/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,39 @@ sudo curl https://raw.githubusercontent.com/GitAlias/gitalias/main/gitalias.txt
sudo git config --global include.path "$dir/gitalias.txt"
```

#### For Nix with Home Manager

You should get a `fetchFromGitHub`-snippet of the current version of the project via `nurl` with the following command:

```bash
nix run nixpkgs#nurl https://github.com/GitAlias/gitalias/
> fetchFromGitHub {
> owner = "GitAlias";
> repo = "gitalias";
> rev = "7b941c3abbcee391b6bfc4f8d6b8372064245b49";
> hash = "sha256-IvHM6mRtoeVm01cUmTkKqjm6/n3Izau89B7MT69Afo0=";
> }
```
This snippet can then be used inside your Home Manager configuration like so:
```nix
# link gitalias.txt from store to
# $XDG_CONFIG_HOME/gitalias/gitalias.txt
xdg.configFile = {
"gitalias/gitalias.txt".source = pkgs.fetchFromGitHub {
# fill with snippet here
} + "/gitalias.txt";
};

# tell git to include gitalias.txt
programs.git = {
enable = true;
includes = [
{ path = "${config.xdg.configHome}/gitalias/gitalias.txt"; }
];
};
```
### For Windows
Expand Down

0 comments on commit 6ccbd9c

Please sign in to comment.