full rewrite, first commit
This commit is contained in:
commit
a83c37a638
24 changed files with 4358 additions and 0 deletions
24
modules/nixos/services/btrfs/default.nix
Normal file
24
modules/nixos/services/btrfs/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.${namespace};
|
||||
let
|
||||
cfg = config.${namespace}.services.btrfs;
|
||||
in
|
||||
{
|
||||
options.${namespace}.services.btrfs = {
|
||||
enable = mkBoolOpt true "BTRFS";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.btrfs.autoScrub.enable = true;
|
||||
services.fstrim.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [ btrfs-progs ];
|
||||
};
|
||||
}
|
55
modules/nixos/services/caddy/default.nix
Normal file
55
modules/nixos/services/caddy/default.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.${namespace};
|
||||
let
|
||||
cfg = config.${namespace}.services.caddy;
|
||||
in
|
||||
{
|
||||
options.${namespace}.services.caddy = {
|
||||
enable = mkEnableOption "Caddy";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
":1338" = {
|
||||
extraConfig = ''
|
||||
root * /var/lib/caddy/ente
|
||||
file_server
|
||||
'';
|
||||
};
|
||||
":8686" = {
|
||||
extraConfig = ''
|
||||
root * /var/lib/caddy/cinny
|
||||
file_server
|
||||
|
||||
@index {
|
||||
not path /index.html
|
||||
not path /public/*
|
||||
not path /assets/*
|
||||
|
||||
not path /config.json
|
||||
|
||||
not path /manifest.json
|
||||
|
||||
not path /pdf.worker.min.js
|
||||
not path /olm.wasm
|
||||
|
||||
path /*
|
||||
}
|
||||
|
||||
rewrite /*/olm.wasm /olm.wasm
|
||||
rewrite @index /index.html
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
30
modules/nixos/services/invidious/default.nix
Normal file
30
modules/nixos/services/invidious/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.${namespace};
|
||||
let
|
||||
cfg = config.${namespace}.services.invidious;
|
||||
in
|
||||
{
|
||||
options.${namespace}.services.invidious = {
|
||||
enable = mkEnableOption "Invidious";
|
||||
domain = mkOption {
|
||||
type = types.string;
|
||||
default = "localhost";
|
||||
description = "Domain to use for absolute URLs";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.invidious = {
|
||||
enable = true;
|
||||
domain = cfg.domain;
|
||||
extraSettingsFile = "/var/lib/invidious/settings.yml";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue