pollymc/nix/NIX.md
Skyler Grey dab091a7b7
Update NIX.md so it has more methods + is clearer
- Add proper headings
- Change flake codeblocks so that configuration stuff isn't in the same
  place as flake.nix stuff
- Add instructions for not using the overlay with flakes
- Add instructions for running ad-hoc with flakes

Signed-off-by: Skyler Grey <skyler3665@gmail.com>
2022-10-19 23:50:48 +01:00

1.8 KiB

Running on Nix

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

# In your flake.nix:
{
  inputs = {
    prismlauncher.url = "github:PrismLauncher/PrismLauncher";
  };
}
# And in your system configuration:
environment.systemPackages = [ prismlauncher.packages.${pkgs.system}.prismlauncher ];

# 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

# In your flake.nix:
{
  inputs = {
    prismlauncher.url = "github:PrismLauncher/PrismLauncher";
  };
}
# 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

nix-channel --add https://github.com/PrismLauncher/PrismLauncher/archive/master.tar.gz prismlauncher
nix-channel --update prismlauncher
nix-env -iA prismlauncher

Using the overlay

# In your configuration.nix:
{
  nixpkgs.overlays = [
    (import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz")).overlay
  ];

  environment.systemPackages = with pkgs; [ prismlauncher ];
}

Running ad-hoc

If you're on a flakes-enabled nix you can run the launcher in one-line

nix run github:PrismLauncher/PrismLauncher