pollymc/nix/NIX.md

84 lines
1.6 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
2022-11-02 00:19:21 +05:30
The `pollymc` 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 = {
2022-11-02 00:19:21 +05:30
pollymc.url = "github:fn2006/PollyMC";
};
}
```
2022-01-08 20:57:47 +05:30
```nix
# And in your system configuration:
2022-11-02 00:19:21 +05:30
environment.systemPackages = [ pollymc.packages.${pkgs.system}.pollymc ];
2022-01-08 20:57:47 +05:30
# Or in your home-manager configuration:
2022-11-02 00:19:21 +05:30
home.packages = [ pollymc.packages.${pkgs.system}.pollymc ];
```
#### Using the overlay
2022-11-02 00:19:21 +05:30
Alternatively, you can overlay the pollymc 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 = {
2022-11-02 00:19:21 +05:30
pollymc.url = "github:fn2006/PollyMC";
};
}
2022-01-08 20:57:47 +05:30
```
```nix
# And in your system configuration:
2022-11-02 00:19:21 +05:30
nixpkgs.overlays = [ inputs.pollymc.overlay ];
environment.systemPackages = [ pkgs.pollymc ];
# Or in your home-manager configuration:
2022-11-02 00:19:21 +05:30
config.nixpkgs.overlays = [ inputs.pollymc.overlay ];
home.packages = [ pkgs.pollymc ];
```
### Without flakes-enabled nix
#### Using channels
2022-01-08 20:57:47 +05:30
```sh
2022-11-02 00:19:21 +05:30
nix-channel --add https://github.com/fn2006/PollyMC/archive/master.tar.gz pollymc
nix-channel --update pollymc
nix-env -iA pollymc
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 = [
2022-11-02 00:19:21 +05:30
(import (builtins.fetchTarball "https://github.com/fn2006/PollyMC/archive/develop.tar.gz")).overlay
];
2022-01-09 19:47:52 +05:30
2022-11-02 00:19:21 +05:30
environment.systemPackages = with pkgs; [ pollymc ];
}
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
2022-11-02 00:19:21 +05:30
nix run github:fn2006/PollyMC
```