PrismLauncher/nix/NIX.md

90 lines
1.9 KiB
Markdown
Raw Normal View History

# Running on Nix
2022-01-08 15:27:47 +00:00
## Putting it in your system configuration
### On flakes-enabled nix
#### Directly installing
The `prismlauncher` flake provides a package which you can install along with
the rest of your packages
2022-01-08 15:27:47 +00:00
```nix
# In your flake.nix:
{
inputs = {
prismlauncher.url = "github:PrismLauncher/PrismLauncher";
};
}
```
2022-01-08 15:27:47 +00:00
```nix
# And in your system configuration:
environment.systemPackages = [ prismlauncher.packages.${pkgs.system}.prismlauncher ];
2022-01-08 15:27:47 +00:00
# Or in your home-manager configuration:
home.packages = [ prismlauncher.packages.${pkgs.system}.prismlauncher ];
```
#### Using the overlay
Alternatively, you can overlay the prismlauncher version in nixpkgs which will
allow you to install using `pkgs` as you normally would while also using the
latest version
```nix
# In your flake.nix:
{
inputs = {
prismlauncher.url = "github:PrismLauncher/PrismLauncher";
};
}
2022-01-08 15:27:47 +00:00
```
```nix
# And in your system configuration:
nixpkgs.overlays = [ inputs.prismlauncher.overlay ];
environment.systemPackages = [ pkgs.prismlauncher ];
# Or in your home-manager configuration:
config.nixpkgs.overlays = [ inputs.prismlauncher.overlay ];
home.packages = [ pkgs.prismlauncher ];
```
### Without flakes-enabled nix
<details>
<summary>Using channels</summary>
2022-01-08 15:27:47 +00:00
```sh
nix-channel --add https://github.com/PrismLauncher/PrismLauncher/archive/master.tar.gz prismlauncher
nix-channel --update prismlauncher
nix-env -iA prismlauncher
2022-01-08 15:27:47 +00:00
```
</details>
<details>
<summary>Using the overlay</summary>
2022-01-09 14:15:47 +00:00
```nix
# In your configuration.nix:
{
nixpkgs.overlays = [
(import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz")).overlay
];
2022-01-09 14:17:52 +00:00
environment.systemPackages = with pkgs; [ prismlauncher ];
}
2022-01-13 13:43:29 +00:00
```
</details>
## Running ad-hoc
If you're on a flakes-enabled nix you can run the launcher in one-line
```sh
nix run github:PrismLauncher/PrismLauncher
```