Skip to content

Commit

Permalink
Merge pull request #947 from Mic92/joerg-ci
Browse files Browse the repository at this point in the history
move the wiki to a flake
  • Loading branch information
mergify[bot] authored Oct 27, 2023
2 parents 712ed75 + dc5ca6f commit 5a2292f
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 207 deletions.
48 changes: 42 additions & 6 deletions flake.lock

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

8 changes: 8 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@

flake-utils.url = "github:numtide/flake-utils";

nixos-wiki.url = "github:Mic92/nixos-wiki-infra";
nixos-wiki.inputs.nixpkgs.follows = "nixpkgs";
nixos-wiki.inputs.flake-parts.follows = "flake-parts";
nixos-wiki.inputs.treefmt-nix.follows = "treefmt-nix";
nixos-wiki.inputs.disko.follows = "disko";
nixos-wiki.inputs.sops-nix.follows = "sops-nix";
nixos-wiki.inputs.srvos.follows = "srvos";

#microvm.url = "github:astro/microvm.nix";
#microvm.inputs.nixpkgs.follows = "nixpkgs";
#microvm.inputs.flake-utils.follows = "flake-utils";
Expand Down
2 changes: 1 addition & 1 deletion home/.config/qtile/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def create_screenshot(qtile: Qtile) -> None:
),
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod], "r", lazy.spawncmd(), desc="Spawn a command using a prompt widget"),
Key([mod], "r", lazy.spawn("rofi -show run"), desc="Spawn rofi"),
Key(
[mod],
"Print",
Expand Down
1 change: 0 additions & 1 deletion nixos/eve/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
./modules/users.nix
./modules/wireguard.nix
./modules/nixos-wiki
./modules/nixos-wiki/backup.nix
./modules/zerotier.nix
#./modules/headscale.nix
#./modules/wiregrill
Expand Down
78 changes: 0 additions & 78 deletions nixos/eve/modules/nixos-wiki/backup.nix

This file was deleted.

99 changes: 4 additions & 95 deletions nixos/eve/modules/nixos-wiki/default.nix
Original file line number Diff line number Diff line change
@@ -1,101 +1,10 @@
{ config, pkgs, ... }:
let
hostname = "nixos-wiki.thalheim.io";
githubClientId = "Iv1.95ed182c83df1d22";
in
{ config, lib, ... }:
{
sops.secrets."nixos-wiki".owner = config.services.phpfpm.pools.mediawiki.user;
sops.secrets.nixos-wiki-github-client-secret.owner = config.services.phpfpm.pools.mediawiki.user;

services.mediawiki = {
enable = true;
webserver = "nginx";
database.type = "postgres";
nginx.hostName = hostname;
uploadsDir = "/var/lib/mediawiki-uploads/";
passwordFile = config.sops.secrets."nixos-wiki".path;

extensions.SyntaxHighlight_GeSHi = null; # provides <SyntaxHighlight> tags
extensions.ParserFunctions = null;
extensions.Cite = null;
extensions.VisualEditor = null;
extensions.AuthManagerOAuth = pkgs.fetchzip {
url = "https://github.com/mohe2015/AuthManagerOAuth/releases/download/v0.3.0/AuthManagerOAuth.zip";
hash = "sha256-4ev8LwuConmHzFm5cPr+ni9aYPDOHLArGoJhzdugEn4=";
}; # Github login
extensions.ConfirmEdit = null; # Combat SPAM with a simple Captcha
extensions.StopForumSpam = pkgs.fetchzip {
url = "https://extdist.wmflabs.org/dist/extensions/StopForumSpam-REL1_40-71b57ba.tar.gz";
hash = "sha256-g8v4zr11c2e4bY0BNipJ48miyAF4WTNvlSMgb/NxPBA=";
};

extraConfig = ''
#$wgDebugLogFile = "/var/log/mediawiki/debug.log";
# allow local login
$wgAuthManagerOAuthConfig = [
'github' => [
'clientId' => '${githubClientId}',
'clientSecret' => file_get_contents("${config.sops.secrets.nixos-wiki-github-client-secret.path}"),
'urlAuthorize' => 'https://github.com/login/oauth/authorize',
'urlAccessToken' => 'https://github.com/login/oauth/access_token',
'urlResourceOwnerDetails' => 'https://api.github.com/user'
],
];
# Enable account creation globally
$wgGroupPermissions['*']['createaccount'] = true;
$wgGroupPermissions['*']['autocreateaccount'] = true;
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
# Allow svg upload
$wgFileExtensions[] = 'svg';
$wgSVGConverterPath = "${pkgs.imagemagick}/bin";
# Pretty URLs
$wgUsePathInfo = true;
# cache pages with APCu
$wgMainCacheType = CACHE_ACCEL;
# TODO: nixos favicon
#$wgFavicon = "/favicon.ico";
$wgDefaultSkin = 'vector-2022';
# configure logos for vector-2022: https://www.mediawiki.org/wiki/Manual:$wgLogos
$wgLogos = [
'1x' => '/nixos.png',
'icon' => '/nixos.png',
];
# Combat SPAM with IP-Blocklists (StopForumSpam extension)
$wgEnableDnsBlacklist = true;
$wgDnsBlacklistUrls = array(
'dnsbl.dronebl.org'
);
# required for fancy VisualEditor extension
$wgGroupPermissions['user']['writeapi'] = true;
# Enable content security policy
$wgCSPHeader = true;
# Disallow framing
$wgEditPageFrameOptions = "DENY";
$wgEnableEmail = true;
$wgAllowHTMLEmail = false;
$wgEmergencyContact = "nixos-wiki-emergency@thalheim.io";
$wgPasswordSender = "nixos-wiki@thalheim.io"; # Default FROM address
$wgNoReplyAddress = "nixos-wiki-no-reply@thalheim.io"; # Default Reply-To address
'';
};

services.nixos-wiki.hostname = "nixos-wiki.thalheim.io";
services.nixos-wiki.githubClientId = "Iv1.95ed182c83df1d22";

services.nginx.virtualHosts.${config.services.mediawiki.nginx.hostName} = {
enableACME = lib.mkForce false;
useACMEHost = "thalheim.io";
forceSSL = true;
locations."=/nixos.png".alias = ./nixos.png;
};
}
Binary file removed nixos/eve/modules/nixos-wiki/nixos.png
Binary file not shown.
2 changes: 2 additions & 0 deletions nixos/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ in
inputs.buildbot-nix.nixosModules.buildbot-worker
inputs.buildbot-nix.nixosModules.buildbot-master
inputs.disko.nixosModules.disko
inputs.nixos-wiki.nixosModules.nixos-wiki
inputs.nixos-wiki.nixosModules.nixos-wiki-backup
];
};

Expand Down
1 change: 0 additions & 1 deletion sops/secrets/squid-ldap/groups/admins

This file was deleted.

1 change: 0 additions & 1 deletion sops/secrets/squid-ldap/machines/eve

This file was deleted.

24 changes: 0 additions & 24 deletions sops/secrets/squid-ldap/secret

This file was deleted.

0 comments on commit 5a2292f

Please sign in to comment.