Compare commits

..

2 commits

Author SHA1 Message Date
Fabian Montero 806b00f634
add alejandra formatter 2024-08-24 01:52:56 -06:00
Fabian Montero 9b3cc59d74
fix bug in internal relative paths 2024-08-24 01:34:42 -06:00
17 changed files with 174 additions and 133 deletions

View file

@ -28,24 +28,24 @@
}; };
}; };
outputs = outputs = flakes @ {
flakes@{ self self,
, nixpkgs nixpkgs,
, unstable unstable,
, home-manager home-manager,
, impermanence impermanence,
, flake-utils flake-utils,
, vpsadminos vpsadminos,
, homepage homepage,
, conduwuit conduwuit,
, mediawikiSkinCitizen mediawikiSkinCitizen,
}: }: let
let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = importPkgs nixpkgs; pkgs = importPkgs nixpkgs;
importPkgs = flake: import flake { importPkgs = flake:
import flake {
inherit system; inherit system;
config = import ./pkgs/config nixpkgs.lib; config = import ./pkgs/config nixpkgs.lib;
@ -55,11 +55,10 @@
local = import ./pkgs; local = import ./pkgs;
in in
with pkgs.lib; { with pkgs.lib; {
formatter.${system} = pkgs.nixpkgs-fmt; formatter.${system} = pkgs.alejandra;
packages.${system} = pkgs.local; packages.${system} = pkgs.local;
overlays.default = final: prev: overlays.default = final: prev: let
let
locals = local { locals = local {
inherit final prev flakes; inherit final prev flakes;
}; };
@ -67,7 +66,8 @@
{ {
local = locals; local = locals;
unstable = importPkgs unstable; unstable = importPkgs unstable;
} // locals.override; }
// locals.override;
nixosConfigurations.vps = makeOverridable nixpkgs.lib.nixosSystem { nixosConfigurations.vps = makeOverridable nixpkgs.lib.nixosSystem {
inherit pkgs system; inherit pkgs system;
@ -80,4 +80,3 @@
}; };
}; };
} }

View file

@ -1,4 +1,8 @@
{ final, prev, flakes }: { {
final,
prev,
flakes,
}: {
homepage = flakes.homepage.packages.${final.system}.default; homepage = flakes.homepage.packages.${final.system}.default;
override = {}; override = {};

View file

@ -1,6 +1,11 @@
{ config, pkgs, lib, flakes, ... }:
with lib;
{ {
config,
pkgs,
lib,
flakes,
...
}:
with lib; {
imports = [ imports = [
flakes.vpsadminos.nixosConfigurations.container flakes.vpsadminos.nixosConfigurations.container
flakes.home-manager.nixosModules.home-manager flakes.home-manager.nixosModules.home-manager
@ -57,7 +62,7 @@ with lib;
group = "fabian"; group = "fabian";
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = ["users" "wheel" "networkmanager" "dialout" "libvirtd"]; extraGroups = ["users" "wheel" "networkmanager" "dialout" "libvirtd"];
openssh.authorizedKeys.keyFiles = [ "${flakes.self}/pki/fabian.pub" ]; openssh.authorizedKeys.keyFiles = [../pki/fabian.pub];
}; };
groups.fabian.gid = 1000; groups.fabian.gid = 1000;
}; };

View file

@ -1,6 +1,9 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
programs = { programs = {
zsh = { zsh = {
enable = true; enable = true;
@ -13,8 +16,7 @@ with lib;
}; };
neovim.enable = true; neovim.enable = true;
}; };
home.packages = with pkgs; home.packages = with pkgs; [
[
file file
htop htop
killall killall

View file

@ -1,7 +1,11 @@
{ config, pkgs, lib, flakes, ... }:
with lib;
{ {
config,
pkgs,
lib,
flakes,
...
}:
with lib; {
imports = [ imports = [
./cli.nix ./cli.nix
]; ];

View file

@ -1,8 +1,10 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
services = { services = {
nginx = { nginx = {
virtualHosts."send.posixlycorrect.com" = { virtualHosts."send.posixlycorrect.com" = {
enableACME = true; enableACME = true;
@ -14,7 +16,6 @@ with lib;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:8989"; proxyPass = "http://127.0.0.1:8989";
}; };
}; };
}; };

View file

@ -1,6 +1,11 @@
{ config, pkgs, lib, flakes, ... }:
with lib;
{ {
config,
pkgs,
lib,
flakes,
...
}:
with lib; {
imports = [ imports = [
./net.nix ./net.nix
./mediawiki.nix ./mediawiki.nix

View file

@ -1,6 +1,9 @@
{ config, lib, ... }:
with lib;
{ {
config,
lib,
...
}:
with lib; {
config = { config = {
environment.etc."fail2ban/filter.d/gitea.local".text = '' environment.etc."fail2ban/filter.d/gitea.local".text = ''
[Definition] [Definition]

View file

@ -1,9 +1,10 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
services = { services = {
nginx = { nginx = {
virtualHosts."stream.posixlycorrect.com" = { virtualHosts."stream.posixlycorrect.com" = {
enableACME = true; enableACME = true;

View file

@ -1,9 +1,10 @@
{ lib, pkgs, flakes, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
services = { services = {
nginx = { nginx = {
virtualHosts."meet.posixlycorrect.com" = { virtualHosts."meet.posixlycorrect.com" = {
enableACME = true; enableACME = true;
@ -14,7 +15,7 @@ with lib;
ssl_verify_depth 1; ssl_verify_depth 1;
ssl_verify_client on; ssl_verify_client on;
ssl_client_certificate ${flakes.self}/pki/gatekeeper_ca.pem; ssl_client_certificate ${../../pki/gatekeeper_ca.pem};
if ($ssl_client_verify != "SUCCESS") { if ($ssl_client_verify != "SUCCESS") {
return 403; return 403;
} }
@ -22,7 +23,6 @@ with lib;
}; };
}; };
jitsi-meet = { jitsi-meet = {
enable = true; enable = true;
hostName = "meet.posixlycorrect.com"; hostName = "meet.posixlycorrect.com";

View file

@ -1,6 +1,9 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
services = { services = {
nginx = { nginx = {
virtualHosts."status.posixlycorrect.com" = { virtualHosts."status.posixlycorrect.com" = {

View file

@ -1,10 +1,14 @@
{ lib, pkgs, config, flakes, ... }: {
with lib; lib,
let pkgs,
config,
flakes,
...
}:
with lib; let
subdomain = "matrix.posixlycorrect.com"; subdomain = "matrix.posixlycorrect.com";
baseUrl = "https://${subdomain}"; baseUrl = "https://${subdomain}";
in in {
{
# ver https://nixos.org/manual/nixos/stable/#module-services-matrix # ver https://nixos.org/manual/nixos/stable/#module-services-matrix
services = { services = {
matrix-conduit = { matrix-conduit = {
@ -23,8 +27,7 @@ in
}; };
}; };
nginx.virtualHosts = nginx.virtualHosts = let
let
clientConfig."m.homeserver".base_url = baseUrl; clientConfig."m.homeserver".base_url = baseUrl;
serverConfig."m.server" = "${subdomain}:443"; serverConfig."m.server" = "${subdomain}:443";
mkWellKnown = data: '' mkWellKnown = data: ''
@ -32,8 +35,7 @@ in
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON data}'; return 200 '${builtins.toJSON data}';
''; '';
in in {
{
"posixlycorrect.com" = { "posixlycorrect.com" = {
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig; locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig; locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
@ -50,10 +52,7 @@ in
''; '';
locations."/_matrix".proxyPass = "http://[::1]:6167"; locations."/_matrix".proxyPass = "http://[::1]:6167";
locations."/_synapse/client".proxyPass = "http://[::1]:6167"; locations."/_synapse/client".proxyPass = "http://[::1]:6167";
}; };
}; };
}; };
} }

View file

@ -1,6 +1,10 @@
{ lib, pkgs, flakes, ... }:
with lib;
{ {
lib,
pkgs,
flakes,
...
}:
with lib; {
services = { services = {
nginx = { nginx = {
virtualHosts."wiki.posixlycorrect.com" = { virtualHosts."wiki.posixlycorrect.com" = {

View file

@ -1,6 +1,9 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
users.groups = { users.groups = {
mailsenders = { mailsenders = {
members = ["fabian" "mediawiki"]; members = ["fabian" "mediawiki"];

View file

@ -1,6 +1,9 @@
{ lib, pkgs, ... }:
with lib;
{ {
lib,
pkgs,
...
}:
with lib; {
networking = { networking = {
nftables.enable = true; nftables.enable = true;
firewall = { firewall = {

View file

@ -1,6 +1,9 @@
{ config, lib, ... }:
with lib;
{ {
config,
lib,
...
}:
with lib; {
services = { services = {
nginx = { nginx = {
virtualHosts."vault.posixlycorrect.com" = { virtualHosts."vault.posixlycorrect.com" = {
@ -18,10 +21,12 @@ with lib;
postgresql = { postgresql = {
ensureDatabases = ["vaultwarden"]; ensureDatabases = ["vaultwarden"];
ensureUsers = [{ ensureUsers = [
{
name = "vaultwarden"; name = "vaultwarden";
ensureDBOwnership = true; ensureDBOwnership = true;
}]; }
];
}; };
vaultwarden = { vaultwarden = {