Skip to content

Commit

Permalink
Add chrs installation instructions using nix flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Sep 14, 2024
1 parent 54b530f commit 8ee70f0
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/chrs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,58 @@ If necessary, add the `bin` folder to `$PATH`:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
```

## Home Manager using Nix Flakes

Edit `~/.config/home-manager/flake.nix`

```nix
{
description = "Home Manager configuration example";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
chrs.url = "github:FNNDSC/chrs"; # <-- add this line
};
outputs = { nixpkgs, home-manager, ... } @ inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
homeConfigurations."chris@computer" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./packages.nix # <-- file where chrs will be specified
];
extraSpecialArgs = { inherit inputs; }; # <-- pass inputs to modules
};
};
}
```

And create the file `~/.config/home-manager/packages.nix` with the content:

```nix
{ lib, pkgs, inputs, ... }:
{
home.packages = with pkgs; [
inputs.chrs.packages.${system}.default
];
}
```

Run

```shell
cd ~/.config/home-manager
git add flake.nix packages.nix
nix flake update
git add flake.lock
home-manager switch
```

0 comments on commit 8ee70f0

Please sign in to comment.