Skip to content

Commit

Permalink
docs(nix): use nix channels in more examples
Browse files Browse the repository at this point in the history
Signed-off-by: seth <getchoo@tuta.io>
  • Loading branch information
getchoo committed Jan 24, 2024
1 parent bfb2c23 commit 28aa5c0
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions nix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,30 +130,46 @@ Example (NixOS):
}
```

### Using the overlay (`fetchTarball`)
### Using the overlay

We offer standard Nix expressions and a channel to allow using this flake on a system that doesn't use flakes.

We use flake-compat to allow using this Flake on a system that doesn't use flakes.
To add the channel:

```shell
nix-channel --add https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz prismlauncher

nix-channel --update prismlauncher
```

Example:

```nix
{pkgs, ...}: {
nixpkgs.overlays = [(import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz" + "/overlays.nix"))];
{pkgs, ...}: let
# with channels
prismOverlay = import <prismlauncher/overlay.nix>;
# with fetchTarball
prismOverlay = import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz" + "/overlay.nix");
in {
nixpkgs.overlays = [prismOverlay];
environment.systemPackages = [pkgs.prismlauncher];
}
```

### Installing the package directly (`fetchTarball`)
### Installing the package directly

Alternatively, if you don't want to use an overlay, you can install Prism Launcher directly by installing the `prismlauncher` package.
This way the installed package is fully reproducible.

Example:

```nix
{
environment.systemPackages = [(import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz") {}).prismlauncher];
let
prismlauncher = import <prismlauncher> {};
prismlauncher = import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz") {};
in {
environment.systemPackages = [prismlauncher.prismlauncher];
}
```

Expand All @@ -164,10 +180,6 @@ You can add this repository as a channel and install its packages that way.
Example:

```shell
nix-channel --add https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz prismlauncher

nix-channel --update prismlauncher

nix-env -iA prismlauncher.prismlauncher
```

Expand Down

0 comments on commit 28aa5c0

Please sign in to comment.