Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Jun 24, 2024
2 parents fd8d424 + 8b1e2a8 commit e62ea54
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 39 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2024-06-11

Updated:
- VPNConfinement submodule


## 2024-03-12

Added:
Expand Down
52 changes: 37 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion nixarr/bazarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ in {
];

options.nixarr.bazarr = {
enable = mkEnableOption "the bazarr service.";
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not to enable the Bazarr service.
**Required options:** [`nixarr.enable`](#nixarr.enable)
'';
};

stateDir = mkOption {
type = types.path;
Expand Down Expand Up @@ -62,6 +71,13 @@ in {
nixarr.vpn.enable option to be set, but it was not.
'';
}
{
assertion = cfg.enable -> nixarr.enable;
message = ''
The nixarr.bazarr.enable option requires the nixarr.enable option
to be set, but it was not.
'';
}
];

util-nixarr.services.bazarr = {
Expand Down
36 changes: 27 additions & 9 deletions nixarr/ddns/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
}:
with lib; let
cfg = config.nixarr.ddns;
nixarr = config.nixarr;
ddns-njalla = pkgs.writeShellApplication {
name = "ddns-njalla";

Expand Down Expand Up @@ -44,6 +45,7 @@ in {
description = ''
**Required options:**
- [`nixarr.enable`](#nixarr.enable)
- [`nixarr.ddns.njalla.keysFile`](#nixarr.ddns.njalla.keysfile)
- [`nixarr.vpn.enable`](#nixarr.vpn.enable)
Expand Down Expand Up @@ -73,6 +75,7 @@ in {
description = ''
**Required options:**
- [`nixarr.enable`](#nixarr.enable)
- [`nixarr.ddns.njalla.keysFile`](#nixarr.ddns.njalla.keysfile)
Whether or not to enable DDNS for a [Njalla](https://njal.la/)
Expand Down Expand Up @@ -118,16 +121,31 @@ in {
'';
}
{
assertion =
cfg.njalla.vpn.enable
-> (
cfg.njalla.vpn.keysFile
!= null
&& config.nixarr.vpn.enable
);
assertion = cfg.njalla.enable -> nixarr.enable;
message = ''
The nixarr.ddns.njalla.enable option requires the
nixarr.vpn.enable option to be set, but it was not.
The nixarr.ddns.njalla.enable option requires the nixarr.enable
option to be set, but it was not.
'';
}
{
assertion = cfg.njalla.vpn.enable -> nixarr.enable;
message = ''
The nixarr.ddns.njalla.vpn.enable option requires the nixarr.enable
option to be set, but it was not.
'';
}
{
assertion = cfg.njalla.vpn.enable -> cfg.njalla.vpn.keysFile != null;
message = ''
The nixarr.ddns.njalla.enable option requires the nixarr.vpn.keysFile
option to be set (not null), but it was not.
'';
}
{
assertion = cfg.njalla.vpn.enable -> config.nixarr.vpn.enable;
message = ''
The nixarr.ddns.njalla.enable option requires the nixarr.vpn.enable
option to be set, but it was not.
'';
}
];
Expand Down
18 changes: 17 additions & 1 deletion nixarr/jellyfin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@
in
with lib; {
options.nixarr.jellyfin = {
enable = mkEnableOption "the Jellyfin service.";
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not to enable the Jellyfin service.
**Required options:** [`nixarr.enable`](#nixarr.enable)
'';
};

stateDir = mkOption {
type = types.path;
Expand Down Expand Up @@ -143,6 +152,13 @@ in
nixarr.vpn.enable option to be set, but it was not.
'';
}
{
assertion = cfg.enable -> nixarr.enable;
message = ''
The nixarr.jellyfin.enable option requires the nixarr.enable
option to be set, but it was not.
'';
}
{
assertion = !(cfg.vpn.enable && cfg.expose.https.enable);
message = ''
Expand Down
18 changes: 17 additions & 1 deletion nixarr/lidarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ with lib; let
defaultPort = 8686;
in {
options.nixarr.lidarr = {
enable = mkEnableOption "the Lidarr service.";
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not to enable the Lidarr service.
**Required options:** [`nixarr.enable`](#nixarr.enable)
'';
};

stateDir = mkOption {
type = types.path;
Expand Down Expand Up @@ -52,6 +61,13 @@ in {

config = mkIf cfg.enable {
assertions = [
{
assertion = cfg.enable -> nixarr.enable;
message = ''
The nixarr.lidarr.enable option requires the nixarr.enable option
to be set, but it was not.
'';
}
{
assertion = cfg.vpn.enable -> nixarr.vpn.enable;
message = ''
Expand Down
8 changes: 3 additions & 5 deletions nixarr/nixarr.nix
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ in {
fix-permissions
];

# TODO: wtf to do about openports
vpnnamespaces.wg = mkIf cfg.vpn.enable {
enable = true;
openVPNPorts = optional cfg.vpn.vpnTestService.enable {
Expand Down Expand Up @@ -301,6 +300,9 @@ in {
''
cd "$(mktemp -d)"
# DNS information
dig google.com
# Print resolv.conf
echo "/etc/resolv.conf contains:"
cat /etc/resolv.conf
Expand Down Expand Up @@ -329,10 +331,6 @@ in {
);
};
in "${vpn-test}/bin/vpn-test";

bindsTo = ["[email protected]"];
requires = ["network-online.target"];
after = ["wg.service"];
};
};
}
11 changes: 10 additions & 1 deletion nixarr/openssh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ in {
default = false;
example = true;
description = ''
**Required options:** [`nixarr.vpn.enable`](#nixarr.vpn.enable)
**Required options:**
- [`nixarr.vpn.enable`](#nixarr.vpn.enable)
- [`nixarr.enable`](#nixarr.enable)
Run the openssh service through a vpn, exposing it to the internet.
Expand Down Expand Up @@ -44,6 +46,13 @@ in {

config = mkIf cfg.expose.vpn.enable {
assertions = [
{
assertion = cfg.expose.vpn.enable -> nixarr.enable;
message = ''
The nixarr.openssh.expose.vpn.enable option requires the
nixarr.enable option to be set, but it was not.
'';
}
{
assertion = cfg.expose.vpn.enable -> nixarr.vpn.enable;
message = ''
Expand Down
18 changes: 17 additions & 1 deletion nixarr/prowlarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ in {
];

options.nixarr.prowlarr = {
enable = mkEnableOption "the Prowlarr service.";
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not to enable the Prowlarr service.
**Required options:** [`nixarr.enable`](#nixarr.enable)
'';
};

stateDir = mkOption {
type = types.path;
Expand Down Expand Up @@ -57,6 +66,13 @@ in {

config = mkIf cfg.enable {
assertions = [
{
assertion = cfg.enable -> nixarr.enable;
message = ''
The nixarr.prowlarr.enable option requires the
nixarr.enable option to be set, but it was not.
'';
}
{
assertion = cfg.vpn.enable -> nixarr.vpn.enable;
message = ''
Expand Down
18 changes: 17 additions & 1 deletion nixarr/radarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ with lib; let
nixarr = config.nixarr;
in {
options.nixarr.radarr = {
enable = mkEnableOption "Enable the Radarr service.";
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not to enable the Radarr service.
**Required options:** [`nixarr.enable`](#nixarr.enable)
'';
};

stateDir = mkOption {
type = types.path;
Expand Down Expand Up @@ -53,6 +62,13 @@ in {

config = mkIf cfg.enable {
assertions = [
{
assertion = cfg.enable -> nixarr.enable;
message = ''
The nixarr.radarr.enable option requires the
nixarr.enable option to be set, but it was not.
'';
}
{
assertion = cfg.vpn.enable -> nixarr.vpn.enable;
message = ''
Expand Down
Loading

0 comments on commit e62ea54

Please sign in to comment.