Skip to content

Commit

Permalink
Adopt nix files
Browse files Browse the repository at this point in the history
  • Loading branch information
eikek committed Jan 6, 2024
1 parent fdde76e commit 1e59bac
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
30 changes: 30 additions & 0 deletions nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ let
enabled = true;
order = 50;
};
proxy = {
enabled = false;
user-header = "";
email-header = null;
};
oauth = [
{
enabled = false;
Expand Down Expand Up @@ -618,6 +623,31 @@ in {
The authentication module checks against the internal database.
'';
};
proxy = mkOption {
type = types.submodule({
options = {
enabled = mkOption {
type = types.bool;
default = defaults.backend.auth.proxy.enabled;
description = "Whether to enable this auth mechanism or not";
};
user-header = mkOption {
type = types.str;
default = defaults.backend.auth.proxy.user-header;
description = "The header name that picks the user id";
};
email-header = mkOption {
type = types.nullOr types.str;
default = defaults.backend.auth.proxy.email-header;
description = "The header name that picks the email";
};
};
});
default = defaults.backend.auth.proxy;
description = ''
Authentication via request headers.
'';
};
oauth = mkOption {
type = types.listOf (types.submodule {
options =
Expand Down
4 changes: 2 additions & 2 deletions nix/pkg.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cfg: { lib, stdenv, fetchzip, jre8_headless, unzip, bash }:
cfg: { lib, stdenv, fetchzip, jdk17, unzip, bash }:

stdenv.mkDerivation rec {
name = "sharry-restserver-${cfg.version}";
Expand All @@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
cp -R * $out/sharry-${cfg.version}/
cat > $out/bin/sharry-restserver <<-EOF
#!${bash}/bin/bash
$out/sharry-${cfg.version}/bin/sharry-restserver -java-home ${jre8_headless} "\$@"
$out/sharry-${cfg.version}/bin/sharry-restserver -java-home ${jdk17} "\$@"
EOF
chmod 755 $out/bin/sharry-restserver
'';
Expand Down
44 changes: 8 additions & 36 deletions nix/release.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
rec {
cfg = {
v1_13_0 = rec {
version = "1.13.0";
src = {
url = "https://github.com/eikek/sharry/releases/download/v${version}/sharry-restserver-${version}.zip";
sha256 = "sha256-0tfdEd5i1SRSN/kb/gHINiZxOtCWcmzxC4530c7yd3c=";
};
};
v1_12_1 = rec {
version = "1.12.1";
src = {
Expand All @@ -14,41 +21,6 @@ rec {
sha256 = "sha256-YzBjeW12V3xxt1EAKg15vHdv5q9DkFQRnE/+WES1alU=";
};
};
v1_10_0 = rec {
version = "1.10.0";
src = {
url = "https://github.com/eikek/sharry/releases/download/v${version}/sharry-restserver-${version}.zip";
sha256 = "sha256-CbuBnuSfUsOgsAWqzSRXLhB/fd76AOuD7B7f9MuT8nk=";
};
};
v1_9_0 = rec {
version = "1.9.0";
src = {
url = "https://github.com/eikek/sharry/releases/download/v${version}/sharry-restserver-${version}.zip";
sha256 = "0wx41sw7272g26jx3c93ixl0ky1jswdhlcvkxmzf1gyg9vs26nyc";
};
};
v1_8_0 = rec {
version = "1.8.0";
src = {
url = "https://github.com/eikek/sharry/releases/download/v${version}/sharry-restserver-${version}.zip";
sha256 = "034qlf4y2j6gjyy3fkpfrcz3d1nrvyp2n75ssh4ani64qqld028k";
};
};
v1_7_1 = rec {
version = "1.7.1";
src = {
url = "https://github.com/eikek/sharry/releases/download/v${version}/sharry-restserver-${version}.zip";
sha256 = "011zj8iq0zmb22zn49b5dlqqm707bvrqnv9xvxn2z96d6cgi47an";
};
};
v1_6_0 = rec {
version = "1.6.0";
src = {
url = "https://github.com/eikek/sharry/releases/download/release%2F${version}/sharry-restserver-${version}.zip";
sha256 = "0fd77hv1sqwfybxgcvxkwgw9qlm7iqhvaasgkj7cq7ka9nbcrbcy";
};
};
v1_0_0 = rec {
version = "1.0.0";
src = {
Expand All @@ -58,7 +30,7 @@ rec {
};
};
pkg = v: import ./pkg.nix v;
currentPkg = pkg cfg.v1_12_1;
currentPkg = pkg cfg.v1_13_0;
module = ./module.nix;
modules = [ module
];
Expand Down

0 comments on commit 1e59bac

Please sign in to comment.