Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Nix + Home Manager to installation documentation #111

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading