Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 55a68c21da | |||
| 5e6167ece8 | |||
| d6ef606632 | |||
| 39f73ef2f2 | |||
| 01015c19b9 | |||
| b91fcb6500 | |||
| f00ab5b5ae | |||
| 690b2e2deb | |||
| fd605c040b | |||
| fbba1d3436 | |||
| 60b00f946b | |||
| 8e5b7440a1 | |||
| 735f424315 | |||
| b665d7cffe | |||
| 660426df1f | |||
| 92543dc702 | |||
| ae246349e1 | |||
| 9eb0949e60 |
26 changed files with 337 additions and 173 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
description = "NixOS Configurations";
|
description = "Nettika's NixOS Configs";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{ ... }: {
|
|
||||||
imports = [ ./matrix.nix ./gandicloud.nix ];
|
|
||||||
|
|
||||||
networking.hostName = "apogee";
|
|
||||||
|
|
||||||
services.postgresql.enable = true;
|
|
||||||
|
|
||||||
promptSymbol = "🔭";
|
|
||||||
}
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
# This is the configuration required to run NixOS on GandiCloud.
|
|
||||||
{ lib, modulesPath, ... }: {
|
|
||||||
imports = [ (modulesPath + "/virtualisation/openstack-config.nix") ];
|
|
||||||
config = {
|
|
||||||
boot.initrd.kernelModules = [
|
|
||||||
"xen-blkfront"
|
|
||||||
"xen-tpmfront"
|
|
||||||
"xen-kbdfront"
|
|
||||||
"xen-fbfront"
|
|
||||||
"xen-netfront"
|
|
||||||
"xen-pcifront"
|
|
||||||
"xen-scsifront"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Show debug kernel message on boot then reduce loglevel once booted
|
|
||||||
boot.consoleLogLevel = 7;
|
|
||||||
boot.kernel.sysctl."kernel.printk" = "4 4 1 7";
|
|
||||||
|
|
||||||
# For "openstack console log show"
|
|
||||||
boot.kernelParams = [ "console=ttyS0" ];
|
|
||||||
systemd.services."serial-getty@ttyS0" = {
|
|
||||||
enable = true;
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig.Restart = "always";
|
|
||||||
};
|
|
||||||
|
|
||||||
# The device exposed by Xen
|
|
||||||
boot.loader.grub.device = lib.mkForce "/dev/xvda";
|
|
||||||
|
|
||||||
# This is to get a prompt via the "openstack console url show" command
|
|
||||||
systemd.services."getty@tty1" = {
|
|
||||||
enable = lib.mkForce true;
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig.Restart = "always";
|
|
||||||
};
|
|
||||||
|
|
||||||
# This is required to get an IPv6 address on our infrastructure
|
|
||||||
networking.tempAddresses = "disabled";
|
|
||||||
|
|
||||||
nix.extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
|
|
||||||
system.stateVersion = "24.11";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
let domain = "leaf.ninja";
|
|
||||||
in {
|
|
||||||
age.secrets.synapse-secrets-config.file =
|
|
||||||
./secrets/synapse-secrets-config.age;
|
|
||||||
|
|
||||||
services.matrix-synapse = {
|
|
||||||
enable = true;
|
|
||||||
extraConfigFiles = [ config.age.secrets.synapse-secrets-config.path ];
|
|
||||||
settings = {
|
|
||||||
server_name = domain;
|
|
||||||
database_type = "psycopg2";
|
|
||||||
database_args.database = "matrix-synapse";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
8448 # Matrix federation
|
|
||||||
];
|
|
||||||
|
|
||||||
services.caddy = {
|
|
||||||
enable = true;
|
|
||||||
virtualHosts."matrix.${domain}".extraConfig = ''
|
|
||||||
reverse_proxy /_matrix/* localhost:8008
|
|
||||||
reverse_proxy /_synapse/client/* localhost:8008
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
age-encryption.org/v1
|
|
||||||
-> ssh-ed25519 f+PJrQ 2Gd75cRZviUH5xYRTC+6oKAT5/FfpY2zfMJVYwVlcCs
|
|
||||||
eA4B5qHSoPujIgcpBl4UOT8ovvdiTUb16Yk/lHNJJKo
|
|
||||||
--- 58bdTWl7z2skdVACACl/aAt76ciYkJOjnvDyendgKpQ
|
|
||||||
Q¼³¿‡vð¨ÖÑ=·VU&÷‡ÿLd°<¸#³¥Ëh~yð"«kvõ1I<31>ƒz?»›’U“……üåH
|
|
||||||
rÑYIm½¤lÒÈhÓû&<26>ðÁªPqžK>Œsž;տɅuX7·¥Îó©¿z<C2BF>-¦(êȬ
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
{ nixosModules, modulesPath, lib, pkgs, ... }: {
|
{ modulesPath, nixosModules, agenix, lib, pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
"${modulesPath}/virtualisation/amazon-image.nix"
|
"${modulesPath}/virtualisation/amazon-image.nix"
|
||||||
|
nixosModules.nano
|
||||||
nixosModules.nettika
|
nixosModules.nettika
|
||||||
nixosModules.promptmoji
|
nixosModules.promptmoji
|
||||||
|
agenix.nixosModules.default
|
||||||
|
./forgejo.nix
|
||||||
|
./links.nix
|
||||||
|
./radicale.nix
|
||||||
|
./vaultwarden.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.loader.grub.device = lib.mkForce "/dev/nvme0n1";
|
boot.loader.grub.device = lib.mkForce "/dev/nvme0n1";
|
||||||
|
|
@ -13,23 +19,28 @@
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
options = "--delete-older-than 30d";
|
options = "--delete-older-than 30d";
|
||||||
};
|
};
|
||||||
settings.trusted-users = [ "@wheel" ];
|
settings = {
|
||||||
|
trusted-users = [ "@wheel" ];
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "astral";
|
hostName = "astral";
|
||||||
firewall.allowedTCPPorts = [ 80 443 ];
|
firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
users.defaultUserShell = pkgs.fish;
|
users.defaultUserShell = pkgs.fish;
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
environment.variables.EDITOR = "nano";
|
|
||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkgs.caddy.withPlugins {
|
||||||
|
plugins =
|
||||||
|
[ "github.com/abiosoft/caddy-exec@v0.0.0-20240914124740-521d8736cb4d" ];
|
||||||
|
hash = "sha256-ef6/x7wjKk0axjX6MfAzTTwPM2FTOTSSyI9zLLrczV0=";
|
||||||
|
};
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"astral.leaf.ninja".extraConfig = ''
|
"astral.leaf.ninja".extraConfig = ''
|
||||||
respond "astral is online"
|
respond "astral is online"
|
||||||
|
|
@ -38,32 +49,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.postgresql.enable = true;
|
||||||
|
|
||||||
programs.fish.enable = true;
|
programs.fish.enable = true;
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
lfs.enable = true;
|
|
||||||
config = {
|
|
||||||
init.defaultBranch = "master";
|
|
||||||
user = {
|
|
||||||
email = "git@nettika.cat";
|
|
||||||
name = "Nettika";
|
|
||||||
};
|
|
||||||
credential.helper = "store";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.nano = {
|
|
||||||
enable = true;
|
|
||||||
nanorc = ''
|
|
||||||
set autoindent
|
|
||||||
set linenumbers
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
documentation.man.generateCaches = false;
|
documentation.man.generateCaches = false;
|
||||||
|
|
||||||
promptSymbol = "✴️";
|
promptSymbol = "👻";
|
||||||
|
|
||||||
time.timeZone = "America/Los_Angeles";
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|
||||||
|
|
|
||||||
38
hosts/astral/forgejo.nix
Normal file
38
hosts/astral/forgejo.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
let domain = "git.leaf.ninja";
|
||||||
|
in {
|
||||||
|
services.forgejo = {
|
||||||
|
enable = true;
|
||||||
|
database.type = "postgres";
|
||||||
|
lfs.enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
DOMAIN = domain;
|
||||||
|
ROOT_URL = "https://${domain}/";
|
||||||
|
HTTP_PORT = 3000;
|
||||||
|
};
|
||||||
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
mailer = {
|
||||||
|
ENABLED = true;
|
||||||
|
SMTP_ADDR = "smtp.migadu.com";
|
||||||
|
FROM = "forgejo@leaf.ninja";
|
||||||
|
USER = "forgejo@$leaf.ninja";
|
||||||
|
};
|
||||||
|
webhook.ALLOWED_HOST_LIST =
|
||||||
|
pkgs.lib.concatStringsSep "," [ "localhost" "::1" ];
|
||||||
|
};
|
||||||
|
secrets = {
|
||||||
|
mailer.PASSWD = config.age.secrets.forgejo-mailer-password.path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
||||||
|
reverse_proxy localhost:3000
|
||||||
|
'';
|
||||||
|
|
||||||
|
age.secrets.forgejo-mailer-password = {
|
||||||
|
file = ./secrets/forgejo-mailer-password.age;
|
||||||
|
mode = "400";
|
||||||
|
owner = "forgejo";
|
||||||
|
};
|
||||||
|
}
|
||||||
21
hosts/astral/links.nix
Normal file
21
hosts/astral/links.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
domain = "nettika.leaf.ninja";
|
||||||
|
root = "/srv/links";
|
||||||
|
in {
|
||||||
|
services.caddy.virtualHosts = {
|
||||||
|
${domain}.extraConfig = ''
|
||||||
|
root * ${root}
|
||||||
|
file_server
|
||||||
|
'';
|
||||||
|
"http://localhost:8081".extraConfig = let git = lib.getExe pkgs.git;
|
||||||
|
in ''
|
||||||
|
route {
|
||||||
|
exec {
|
||||||
|
command ${git} pull --rebase
|
||||||
|
directory ${root}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
25
hosts/astral/radicale.nix
Normal file
25
hosts/astral/radicale.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let domain = "radicale.leaf.ninja";
|
||||||
|
in {
|
||||||
|
age.secrets.radicale-htpasswd = {
|
||||||
|
file = ./secrets/radicale-htpasswd;
|
||||||
|
mode = "400";
|
||||||
|
owner = "radicale";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.radicale = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server.hosts = [ "localhost:5232" ];
|
||||||
|
auth = {
|
||||||
|
type = "htpasswd";
|
||||||
|
htpasswd_filename = config.age.secrets.radicale-htpasswd.path;
|
||||||
|
htpasswd_encryption = "plain";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
||||||
|
reverse_proxy localhost:5232
|
||||||
|
'';
|
||||||
|
}
|
||||||
7
hosts/astral/secrets/forgejo-mailer-password.age
Normal file
7
hosts/astral/secrets/forgejo-mailer-password.age
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 f+PJrQ 6h8dfxbHOBbyTK6iwzbqVpUUYJtJhg6XMAoRWDhbdT8
|
||||||
|
kZSsccA4qkiTS8wNdZphZ9cioiFbXjR4xkVZBi1j0aM
|
||||||
|
-> ssh-ed25519 nz/vnw Q+BuraNFun6RwcLPFcKcjBptgpZdddI+hQP2UVKFJmA
|
||||||
|
WJNvdIDTDBXbaXYw7gom7YQTTNrxlsP1EvTDNN5G9+0
|
||||||
|
--- a6gvFS7YixX30i1Jm04vrwzq3Xh9iXufdnZMnPPI+Mw
|
||||||
|
ÒÍÔ‡]‡¤h6µ+„2xDŸÇUŸãZºâeAzêÿ³DkÔLÇ;½†Iª ê/Œæ'®éøï4nL»T<4Ó}iãÁí _ÛÝ‹à
|
||||||
9
hosts/astral/secrets/radicale-htpasswd
Normal file
9
hosts/astral/secrets/radicale-htpasswd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 f+PJrQ pKqLrqz0R7kAzNQZ3ChRsoWa63JEN2H2KHtGguF5nSc
|
||||||
|
6Mk1qDWKx26jPdEzaVMh0vgUeVWjAGcmIPpvSU8BFNE
|
||||||
|
-> ssh-ed25519 nz/vnw 0PuVNQ97Qa6iCk4pPf34lgS1aPb4CeDB4Qclk5F24T4
|
||||||
|
OwJOYMTlTY9+Pj/BwG09z4q2/QViii710Kh3xPU5FRA
|
||||||
|
--- mSdutlC3gFq8lDjeOGqi361i+DUI1Yg6Bpl7hCfznJA
|
||||||
|
“ÜtQÆ/í rNeKeíé¸Ñ¥Äè~ˆý¾×Ÿ{_¡o
|
||||||
|
y_Ü}‹¸Ã»P*W5<57>»´õFû.ECø¡‘Z©å#;
|
||||||
|
£¢ð§Ûli…Ô§±*´Î]yT
|
||||||
BIN
hosts/astral/secrets/vaultwarden-env.age
Normal file
BIN
hosts/astral/secrets/vaultwarden-env.age
Normal file
Binary file not shown.
25
hosts/astral/vaultwarden.nix
Normal file
25
hosts/astral/vaultwarden.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let domain = "vault.leaf.ninja";
|
||||||
|
in {
|
||||||
|
services.vaultwarden = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
domain = "https://${domain}";
|
||||||
|
signupsAllowed = false;
|
||||||
|
rocketAddress = "0.0.0.0";
|
||||||
|
rocketPort = 8222;
|
||||||
|
smtpHost = "smtp.migadu.com";
|
||||||
|
smtpFrom = "vaultwarden@leaf.ninja";
|
||||||
|
smtpPort = 587;
|
||||||
|
smtpSecurity = "starttls";
|
||||||
|
smtpUsername = "vaultwarden@leaf.ninja";
|
||||||
|
};
|
||||||
|
environmentFile = config.age.secrets.vaultwarden-env.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
||||||
|
reverse_proxy localhost:8222
|
||||||
|
'';
|
||||||
|
|
||||||
|
age.secrets.vaultwarden-env.file = ./secrets/vaultwarden-env.age;
|
||||||
|
}
|
||||||
|
|
@ -1,17 +1,24 @@
|
||||||
{ self, nixpkgs, phps, agenix, ... }:
|
{ self, nixpkgs, phps, agenix }:
|
||||||
let inherit (nixpkgs.lib) nixosSystem;
|
let
|
||||||
|
baseSpecialArgs = {
|
||||||
|
inherit (self) nixosModules;
|
||||||
|
inherit agenix;
|
||||||
|
};
|
||||||
|
nixosSystem = args:
|
||||||
|
nixpkgs.lib.nixosSystem
|
||||||
|
(nixpkgs.lib.recursiveUpdate args { specialArgs = baseSpecialArgs; });
|
||||||
in {
|
in {
|
||||||
marauder = nixosSystem {
|
marauder = nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [ ./marauder ];
|
modules = [ ./marauder ];
|
||||||
specialArgs = {
|
specialArgs = { inherit phps; };
|
||||||
inherit (self) nixosModules;
|
|
||||||
inherit phps agenix;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
astral = nixosSystem {
|
astral = nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [ ./astral ];
|
modules = [ ./astral ];
|
||||||
specialArgs = { inherit (self) nixosModules; };
|
};
|
||||||
|
quasar = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [ ./quasar ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ let
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./backup.nix
|
./backup.nix
|
||||||
|
nixosModules.nano
|
||||||
nixosModules.nettika
|
nixosModules.nettika
|
||||||
nixosModules.promptmoji
|
nixosModules.promptmoji
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
|
|
@ -30,8 +31,6 @@ in {
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
environment.variables.EDITOR = "nano";
|
|
||||||
|
|
||||||
documentation.man.generateCaches = false;
|
documentation.man.generateCaches = false;
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
|
|
@ -77,6 +76,7 @@ in {
|
||||||
};
|
};
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
kernelParams = [ "amd_pstate=active" ];
|
kernelParams = [ "amd_pstate=active" ];
|
||||||
|
binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
|
|
@ -103,69 +103,74 @@ in {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Chat clients
|
# Chat clients
|
||||||
discord
|
discord
|
||||||
slack
|
cinny-desktop
|
||||||
element-desktop
|
|
||||||
telegram-desktop
|
|
||||||
signal-desktop
|
signal-desktop
|
||||||
|
slack
|
||||||
|
telegram-desktop
|
||||||
|
|
||||||
# Browsers
|
# Browsers
|
||||||
firefox
|
|
||||||
filezilla
|
filezilla
|
||||||
|
firefox
|
||||||
|
|
||||||
# Creative
|
# Creative
|
||||||
inkscape
|
bambu-studio
|
||||||
|
blender
|
||||||
gimp
|
gimp
|
||||||
|
inkscape
|
||||||
krita
|
krita
|
||||||
openscad-unstable
|
openscad-unstable
|
||||||
bambu-studio
|
|
||||||
orca-slicer
|
orca-slicer
|
||||||
|
plasticity
|
||||||
|
|
||||||
# Multimedia
|
# Multimedia
|
||||||
vlc
|
|
||||||
ffmpeg
|
|
||||||
ffcheck
|
ffcheck
|
||||||
aonsoku
|
ffmpeg
|
||||||
|
vlc
|
||||||
|
|
||||||
# Code Editors
|
# Editors
|
||||||
|
abiword
|
||||||
|
obsidian
|
||||||
vscode
|
vscode
|
||||||
arduino-ide
|
|
||||||
|
|
||||||
# Dev Tools
|
# Dev Tools
|
||||||
|
fossil
|
||||||
|
just
|
||||||
|
kondo
|
||||||
nixd
|
nixd
|
||||||
nixfmt-classic
|
nixfmt-classic
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
pyenv
|
pyenv
|
||||||
rustup
|
rustup
|
||||||
electron
|
|
||||||
uv
|
|
||||||
ruff
|
|
||||||
fossil
|
|
||||||
just
|
|
||||||
dioxus-cli
|
|
||||||
|
|
||||||
# Languages
|
# Languages
|
||||||
gcc
|
|
||||||
kotlin
|
kotlin
|
||||||
nodejs
|
nodejs
|
||||||
php
|
php
|
||||||
|
|
||||||
# Command line
|
# Command line
|
||||||
|
agenix.packages.x86_64-linux.default
|
||||||
|
backblaze-b2
|
||||||
|
dig
|
||||||
htop
|
htop
|
||||||
jq
|
jq
|
||||||
backblaze-b2
|
unzip
|
||||||
|
zip
|
||||||
|
|
||||||
# Misc
|
# Network
|
||||||
obsidian
|
|
||||||
intiface-central
|
|
||||||
prismlauncher
|
|
||||||
blender
|
|
||||||
mullvad-vpn
|
mullvad-vpn
|
||||||
qbittorrent
|
qbittorrent
|
||||||
|
|
||||||
|
# Utility Apps
|
||||||
|
baobab
|
||||||
|
gparted
|
||||||
system-config-printer
|
system-config-printer
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
gcc
|
||||||
|
intiface-central
|
||||||
openssl
|
openssl
|
||||||
pkg-config
|
pkg-config
|
||||||
agenix.packages.x86_64-linux.default
|
prismlauncher
|
||||||
abiword
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
|
|
@ -173,22 +178,15 @@ in {
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
config = {
|
config = {
|
||||||
init.defaultBranch = "master";
|
init.defaultBranch = "master";
|
||||||
|
push.autoSetupRemote = true;
|
||||||
user = {
|
user = {
|
||||||
email = "git@nettika.cat";
|
|
||||||
name = "Nettika";
|
name = "Nettika";
|
||||||
|
email = "git@nettika.cat";
|
||||||
};
|
};
|
||||||
credential.helper = "store";
|
credential.helper = "store";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nano = {
|
|
||||||
enable = true;
|
|
||||||
nanorc = ''
|
|
||||||
set autoindent
|
|
||||||
set linenumbers
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
enable = true;
|
enable = true;
|
||||||
remotePlay.openFirewall = true;
|
remotePlay.openFirewall = true;
|
||||||
|
|
@ -199,7 +197,7 @@ in {
|
||||||
|
|
||||||
programs.ssh.extraConfig = ''
|
programs.ssh.extraConfig = ''
|
||||||
Host quasar
|
Host quasar
|
||||||
HostName consortium.chat
|
HostName quasar.leaf.ninja
|
||||||
IdentityFile ~/.ssh/LightsailDefaultKey-us-west-2.pem
|
IdentityFile ~/.ssh/LightsailDefaultKey-us-west-2.pem
|
||||||
|
|
||||||
Host monolith
|
Host monolith
|
||||||
|
|
@ -208,9 +206,6 @@ in {
|
||||||
Host astral
|
Host astral
|
||||||
HostName astral.leaf.ninja
|
HostName astral.leaf.ninja
|
||||||
IdentityFile ~/.ssh/LightsailDefaultKey-us-west-2.pem
|
IdentityFile ~/.ssh/LightsailDefaultKey-us-west-2.pem
|
||||||
|
|
||||||
Host apogee
|
|
||||||
HostName 46.226.107.209
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
services.mysql = {
|
services.mysql = {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
age-encryption.org/v1
|
age-encryption.org/v1
|
||||||
-> ssh-ed25519 f+PJrQ qccE2xAzfBZ3DCRQtQDgwS1UzjlZx44oUrYjcDfMfDk
|
-> ssh-ed25519 f+PJrQ VJshLBSbF93anR9fOJ3Kwhxh1AOdvsS0hoJ86Bw9oBQ
|
||||||
I2l6xRJsdQLYB2cMo0Kfi6mVyhZsuSPFG574P8pl12Y
|
It8hELrRN+EYt9nv75lVHha+ZDUhCDNQVczDZVlDCBs
|
||||||
--- WoBlo7fqYRkiBYPoLpa3wHB8ZPCVy32a4aL5UswCHJc
|
--- xzJ/50+WOA+IWRXiAvBbJLUlsgsSztQrzbimng2QdlU
|
||||||
LŁćΚČ[¤Nî<#Ő]<5D>
ź<>üBÄ}–×fË%P„ôxK±Ű¨ţkI˝©”<§V<C2A7>ź…¶YÄ5#ĺ±đ÷ű”qEł4’®¶l—ËřFľ“8ukȨ<C48C>űÂ%Ŕ´U53yěű"Ťg\î<>©ŞZćŮC®őWĄ˛gz
|
<EFBFBD>´Ï¬jÒ<>ÿ8K7$ðwÃbԲǰ€Ì~]NBª]QÐM+cw
|
||||||
|
þþÔJ•o—Í”ÔSîØš!N¨Du¦OÈnçZnNâæÍѵV¬:ŒŸ®¬kúÝcó)|æŒJ…opÇSÎH˜«f§ùØu1šã9Çå
|
||||||
Binary file not shown.
49
hosts/quasar/default.nix
Normal file
49
hosts/quasar/default.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
{ modulesPath, nixosModules, agenix, pkgs, config, ... }: {
|
||||||
|
imports = [
|
||||||
|
"${modulesPath}/virtualisation/amazon-image.nix"
|
||||||
|
nixosModules.nano
|
||||||
|
nixosModules.nettika
|
||||||
|
nixosModules.promptmoji
|
||||||
|
agenix.nixosModules.default
|
||||||
|
./matrix.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
nix.settings = {
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
trusted-users = [ "@wheel" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
|
users.defaultUserShell = pkgs.fish;
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "quasar";
|
||||||
|
networkmanager.enable = true;
|
||||||
|
firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.htop ];
|
||||||
|
|
||||||
|
services.postgresql.enable = true;
|
||||||
|
|
||||||
|
services.caddy = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."quasar.leaf.ninja".extraConfig = ''
|
||||||
|
respond "quasar is online"
|
||||||
|
header Strict-Transport-Security: "max-age=63072000; includeSubDomains"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fish.enable = true;
|
||||||
|
|
||||||
|
promptSymbol = "🌟";
|
||||||
|
|
||||||
|
documentation.man.generateCaches = false;
|
||||||
|
|
||||||
|
time.timeZone = "America/Los_Angeles";
|
||||||
|
|
||||||
|
system.stateVersion = "24.05";
|
||||||
|
}
|
||||||
46
hosts/quasar/matrix.nix
Normal file
46
hosts/quasar/matrix.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
canonicalDomain = "consortium.chat";
|
||||||
|
delegatedDomain = "matrix.consortium.chat";
|
||||||
|
adminAppDomain = "admin.consortium.chat";
|
||||||
|
in {
|
||||||
|
age.secrets.matrix-synapse-secrets = {
|
||||||
|
file = ./secrets/matrix-synapse-secrets.yaml;
|
||||||
|
owner = "matrix-synapse";
|
||||||
|
mode = "400";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.matrix-synapse = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server_name = "consortium.chat";
|
||||||
|
database_type = "psycopg2";
|
||||||
|
database_args.database = "matrix-synapse";
|
||||||
|
};
|
||||||
|
extraConfigFiles = [ config.age.secrets.matrix-synapse-secrets.path ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts = {
|
||||||
|
${canonicalDomain}.extraConfig = let
|
||||||
|
wellknown = {
|
||||||
|
server = builtins.toJSON { "m.server" = "${delegatedDomain}:443"; };
|
||||||
|
client = builtins.toJSON {
|
||||||
|
"m.homeserver".base_url = "https://${delegatedDomain}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in ''
|
||||||
|
respond /.well-known/matrix/server `${wellknown.server}` 200
|
||||||
|
respond /.well-known/matrix/client `${wellknown.client}` 200
|
||||||
|
reverse_proxy localhost:8008
|
||||||
|
header Strict-Transport-Security "max-age=63072000; includeSubDomains"
|
||||||
|
'';
|
||||||
|
${delegatedDomain}.extraConfig = ''
|
||||||
|
reverse_proxy /_matrix/* localhost:8008
|
||||||
|
reverse_proxy /_synapse/client/* localhost:8008
|
||||||
|
'';
|
||||||
|
${adminAppDomain}.extraConfig = ''
|
||||||
|
root * ${pkgs.synapse-admin}
|
||||||
|
file_server
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
BIN
hosts/quasar/secrets/matrix-synapse-secrets.yaml
Normal file
BIN
hosts/quasar/secrets/matrix-synapse-secrets.yaml
Normal file
Binary file not shown.
6
hosts/readme.md
Normal file
6
hosts/readme.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Hosts
|
||||||
|
|
||||||
|
- [astral](astral) - VPS running miscellaneous servers
|
||||||
|
- [marauder](marauder) - My laptop
|
||||||
|
- [quasar](quasar) - VPS running the [consortium.chat](https://consortium.chat)
|
||||||
|
matrix-synapse instance
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
nano = ./nano.nix;
|
||||||
nettika = ./nettika.nix;
|
nettika = ./nettika.nix;
|
||||||
promptmoji = ./promptmoji.nix;
|
promptmoji = ./promptmoji.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
modules/nano.nix
Normal file
11
modules/nano.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ ... }: {
|
||||||
|
environment.variables.EDITOR = "nano";
|
||||||
|
|
||||||
|
programs.nano = {
|
||||||
|
enable = true;
|
||||||
|
nanorc = ''
|
||||||
|
set autoindent
|
||||||
|
set linenumbers
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
7
modules/readme.md
Normal file
7
modules/readme.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Modules
|
||||||
|
|
||||||
|
- `nano`: Base config for [nano](https://www.nano-editor.org)
|
||||||
|
- `nettika`: Base config for user "nettika"
|
||||||
|
- `promptmoji`: Fish prompt starting with an emoji to indicate which host I'm
|
||||||
|
logged into. The emoji is configured with `promptSymbol`. Ignored if
|
||||||
|
`programs.fish.enabled` is false.
|
||||||
4
readme.md
Normal file
4
readme.md
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Nettika's NixOS Configs
|
||||||
|
|
||||||
|
- [hosts](hosts) - my `nixosConfigurations`
|
||||||
|
- [modules](modules) - my `nixosModules`
|
||||||
17
secrets.nix
17
secrets.nix
|
|
@ -1,8 +1,17 @@
|
||||||
let
|
let
|
||||||
marauder.nettika =
|
marauder =
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHopty1QG8P+OfGxQ9CV0BI1IRB/q6yITzMZaZ6Zspid";
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHopty1QG8P+OfGxQ9CV0BI1IRB/q6yITzMZaZ6Zspid";
|
||||||
|
astral =
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILRJf6qsNoITXPBdiFsmZuLR0dyP/D6WYNP/RQynl3kf";
|
||||||
|
quasar =
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOoVsKoMEiA2G0WIC/6gFsNE09yhumWf4xnDuoRcD2Px";
|
||||||
in {
|
in {
|
||||||
"hosts/marauder/secrets/restic-env.age".publicKeys = [ marauder.nettika ];
|
"hosts/marauder/secrets/restic-env.age".publicKeys = [ marauder ];
|
||||||
"hosts/marauder/secrets/restic-password.age".publicKeys =
|
"hosts/marauder/secrets/restic-password.age".publicKeys = [ marauder ];
|
||||||
[ marauder.nettika ];
|
"hosts/quasar/secrets/matrix-synapse-secrets.yaml".publicKeys =
|
||||||
|
[ marauder quasar ];
|
||||||
|
"hosts/astral/secrets/vaultwarden-env.age".publicKeys = [ marauder astral ];
|
||||||
|
"hosts/astral/secrets/forgejo-mailer-password.age".publicKeys =
|
||||||
|
[ marauder astral ];
|
||||||
|
"hosts/astral/secrets/radicale-htpasswd".publicKeys = [ marauder astral ];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue