pollymc/nix/NIX.md

84 lines
1.8 KiB
Markdown
Raw Normal View History

# Running on Nix
2022-01-08 20:57:47 +05:30
## 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 20:57:47 +05:30
```nix
# In your flake.nix:
{
inputs = {
prismlauncher.url = "github:PrismLauncher/PrismLauncher";
};
}
```
2022-01-08 20:57:47 +05:30
```nix
# And in your system configuration:
environment.systemPackages = [ prismlauncher.packages.${pkgs.system}.prismlauncher ];
2022-01-08 20:57:47 +05:30
# 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 20:57:47 +05:30
```
```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
#### Using channels
2022-01-08 20:57:47 +05:30
```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 20:57:47 +05:30
```
#### Using the overlay
2022-01-09 19:45:47 +05:30
```nix
# In your configuration.nix:
{
nixpkgs.overlays = [
(import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz")).overlay
];
2022-01-09 19:47:52 +05:30
environment.systemPackages = with pkgs; [ prismlauncher ];
}
2022-01-13 19:13:29 +05:30
```
## 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
```