This is a community guide. It was written by Reposilite's community member and may not be up to date. It may also reference thrid-party services that are not affiliated with the Reposilite project.
/etc/nixos/reposilite-bin.nix
file (adjust JDK package
and JVM properties to your needs):{ pkgs, ... }:
let
jdk = pkgs.openjdk17_headless;
stdenv = pkgs.stdenv;
in
stdenv.mkDerivation rec {
pname = "reposilite-bin";
version = "3.3.2";
jar = builtins.fetchurl {
url="https://maven.reposilite.com/releases/com/reposilite/reposilite/${version}/reposilite-${version}-all.jar";
sha256="369345847c98033ff2546d76e74702b859b41d05135997b4740d8e925f361a85";
};
dontUnpack = true;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
runHook preInstall
makeWrapper ${jdk}/bin/java $out/bin/reposilite \
--add-flags "-Xmx40m -jar $jar" \
--set JAVA_HOME ${jdk}
runHook postInstall
'';
}
/etc/nixos/reposilite.nix
(adjust cfg.user
, cfg.group
etc. to your needs):{ config, pkgs, ... }:
let
reposilite = (import ./reposilite-bin.nix { inherit pkgs; });
cfg = {
user = "reposilite";
group = "reposilite";
home = "/var/lib/reposilite";
pkg = reposilite;
port = 8084;
};
in
{
environment.systemPackages = [
cfg.pkg
];
users.groups.${cfg.group} = {
name = cfg.group;
};
users.users.${cfg.user} = {
isSystemUser = true;
group = cfg.group;
home = cfg.home;
createHome = true;
};
systemd.services."reposilite" = {
description = "Reposilite - Maven repository";
wantedBy = [ "multi-user.target" ];
script = "${cfg.pkg}/bin/reposilite --working-directory ${cfg.home} --port ${toString cfg.port}";
serviceConfig = {
User = cfg.user;
Group = cfg.group;
};
};
}
/etc/nixos/configuration.nix
:{ config, pkgs, ... }:
{
imports = [
# ...
./reposilite.nix
];
# ...
}
systemctl stop reposilite.service
runuser -u reposilite -g reposilite -- reposilite --working-directory /var/lib/reposilite --port 8084
Did you find misleading or deprecated content? Maybe you just feel this section misses important elements?
Copyright © 2023 dzikoysk with ❤ panda-lang