Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mastodon #3

Merged
merged 58 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4ef04e3
try to fix podman mastodon net script
henrikvtcodes Jan 23, 2025
97198d9
remove containers for now
henrikvtcodes Jan 23, 2025
0483902
re-enable postgres and redis db's
henrikvtcodes Jan 23, 2025
94e9c6c
remove container user thing to test
henrikvtcodes Jan 23, 2025
a3c3fad
reactivate all containers; remove "mastodon" system user
henrikvtcodes Jan 23, 2025
07421c1
forgot to include activerecord encryption vars
henrikvtcodes Jan 23, 2025
e0a7441
ensure migrations are enabled
henrikvtcodes Jan 23, 2025
dbf7def
demo values
henrikvtcodes Jan 23, 2025
6e1a462
add migrate container
henrikvtcodes Jan 23, 2025
0c99bb8
ensure proper restart policy for migrate container
henrikvtcodes Jan 23, 2025
08fb941
remove web, streaming, and sidekiq containers for now
henrikvtcodes Jan 23, 2025
12e86fb
rename volumes & ensure they are created
henrikvtcodes Jan 23, 2025
be1badc
add podman group to user henrikvt
henrikvtcodes Jan 23, 2025
51fde6f
we out here
henrikvtcodes Jan 23, 2025
a291b98
try enabling all mastodon services again
henrikvtcodes Jan 23, 2025
4b03e20
fun packages
henrikvtcodes Jan 28, 2025
825475c
please please please - dooont prove me (idk how the rest goes)
henrikvtcodes Jan 28, 2025
2173883
i should've looked at the nix store file sooner
henrikvtcodes Jan 28, 2025
c136b57
remove alias for `less`
henrikvtcodes Jan 28, 2025
7c1e8fb
please work
henrikvtcodes Jan 28, 2025
3fe8d55
ghostty keybinds
henrikvtcodes Jan 28, 2025
c619f16
enable ghostty config file on mac
henrikvtcodes Jan 28, 2025
90afe72
try some more path stuff
henrikvtcodes Jan 28, 2025
3b6714a
format
henrikvtcodes Jan 28, 2025
c7fe468
test this???
henrikvtcodes Jan 28, 2025
be8a32b
add extra shell init for fnm
henrikvtcodes Jan 28, 2025
96f90ab
fundamental misunderstanding
henrikvtcodes Jan 28, 2025
59a7f27
install yt-dlp via nix-darwin
henrikvtcodes Jan 28, 2025
a4cfe2f
add utility alias for getting github repo ssh url
henrikvtcodes Jan 29, 2025
13a6e7e
another idea
henrikvtcodes Jan 29, 2025
1827821
add pnpm alias
henrikvtcodes Jan 29, 2025
c050bdf
stuff
henrikvtcodes Jan 29, 2025
fbbf4d9
more attempts at the jetbrains cli thing
henrikvtcodes Jan 29, 2025
c7ff750
add rbenv to mac config
henrikvtcodes Jan 29, 2025
107b65c
do rbenv via brew instead, set up shell stuff
henrikvtcodes Jan 29, 2025
d44ba54
add cloudflare wrangler cli
henrikvtcodes Jan 29, 2025
0eec7a2
add pipes screensaver
henrikvtcodes Jan 31, 2025
81af79c
add search domains to macos
henrikvtcodes Feb 1, 2025
88a4eab
knownNetworkServices config
henrikvtcodes Feb 1, 2025
aa6a98e
Squash merge main into mastodon
henrikvtcodes Feb 1, 2025
36e6e4f
i want ncurses hehehehehe
henrikvtcodes Feb 2, 2025
33367a2
remove knownNetworkService
henrikvtcodes Feb 2, 2025
debacde
add unstable nixpkgs and update woodpecker on barnegat
henrikvtcodes Feb 3, 2025
7f3ad15
remove port binding on mastodon-migrate container
henrikvtcodes Feb 3, 2025
5f3c9d0
mastodon deploy works! no working interface yet
henrikvtcodes Feb 3, 2025
08393ec
fix port binding in mastodon containers lol
henrikvtcodes Feb 3, 2025
4c263e6
it works!!! (reduce logging and add shell alias for mastodon container)
henrikvtcodes Feb 3, 2025
a7116d5
try out the glitch fork
henrikvtcodes Feb 3, 2025
863ffce
attempt to fix some mastodon performance things
henrikvtcodes Feb 4, 2025
5dacfb9
disable traefik debug logging
henrikvtcodes Feb 4, 2025
06af8ce
fix service dependencies
henrikvtcodes Feb 4, 2025
ea5c481
make the mastodon-prepare container a oneshot service that does not s…
henrikvtcodes Feb 4, 2025
f8754cd
better performance tuning opts
henrikvtcodes Feb 4, 2025
bba6c4c
options for selectively enabling elasticsearch
henrikvtcodes Feb 4, 2025
30175fc
optimal performance stuff
henrikvtcodes Feb 4, 2025
26c8b84
merge with main
henrikvtcodes Feb 4, 2025
430147a
Merge branch 'main' into mastodon
henrikvtcodes Feb 4, 2025
419e182
remove weird error for now
henrikvtcodes Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions flake.lock

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

19 changes: 14 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
description = "nix configuration for my servers + other stuff";

inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-24.11";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";

nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";

darwin = {
url = "github:LnL7/nix-darwin/nix-darwin-24.11";
Expand Down Expand Up @@ -56,6 +56,7 @@
nil-lsp,
home-manager,
nix-homebrew,
nixpkgs-unstable,
...
} @ inputs: let
lib = nixpkgs.lib // home-manager.lib;
Expand All @@ -74,6 +75,12 @@
inherit system;
});

importUnstable = system:
import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};

deployPkgs = forEachSupportedSystem (
{
pkgs,
Expand Down Expand Up @@ -137,11 +144,12 @@

# Config for my servers
nixosConfigurations = {
ashokan = lib.nixosSystem {
ashokan = lib.nixosSystem rec {
system = "aarch64-linux";

specialArgs = {
inherit inputs;
unstable = importUnstable system;
};

modules = [
Expand All @@ -160,11 +168,12 @@
./home/henrikvt
];
};
barnegat = lib.nixosSystem {
barnegat = lib.nixosSystem rec {
system = "x86_64-linux";

specialArgs = {
inherit inputs;
pkgs-unstable = importUnstable system;
};

modules = [
Expand Down
4 changes: 3 additions & 1 deletion home/henrikvt/ghostty.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ shell-integration = zsh
theme = catppuccin-mocha
window-inherit-working-directory = true
working-directory = home
term = xterm-256color
keybind = cmd+r=reload_config
term = xterm-256color
keybind = cmd+q=quit
keybind = cmd+w=close_surface
9 changes: 6 additions & 3 deletions home/henrikvt/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@
magic-wormhole
glab
python3
nyancat
moon-buggy
sl
cowsay
];

shellAliases = {
cat = "${pkgs.bat}/bin/bat -p";
less = "${pkgs.bat}/bin/bat --style plain";
lzg = "${pkgs.lazygit}/bin/lazygit";
};

sessionVariables = {
EDITOR = "nvim";
# VISUAL = "nvim";
};
};

Expand Down Expand Up @@ -94,7 +96,8 @@
];
};

profileExtra = builtins.readFile ./.zprofile.zsh;
profileExtra = builtins.readFile ./zprofile.zsh;
initExtra = builtins.readFile ./zshrc.zsh;
};

# Prompt
Expand Down
11 changes: 11 additions & 0 deletions home/henrikvt/.zprofile.zsh → home/henrikvt/zprofile.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@ alias ptop='ceiling_divide $LINES 4; clear_rows $ceiling_result'
alias pmid='ceiling_divide $LINES 2; clear_rows $ceiling_result'
# Clear 3/4th
alias pdown='ceiling_divide $((3*LINES)) 4; clear_rows $ceiling_result'

# Get the git ssh url of a github repo using gh cli
if command -v "gh" &> /dev/null; then
function ghurl() {
gh repo view --json sshUrl --jq .sshUrl $1 | cat
}
fi

if command -v "rbenv" &> /dev/null; then
eval "$(rbenv init -)"
fi
4 changes: 4 additions & 0 deletions home/henrikvt/zshrc.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# If fnm is present (ie running `fnm` returns 0), eval it
if command -v "fnm" &> /dev/null; then
eval "$(fnm env)"
fi
3 changes: 3 additions & 0 deletions machines/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ in {

home.henrikvt.enable = true;

# Show hidden files in Finder always
system.defaults.finder.AppleShowAllFiles = true;

# Force the nix daemon to run
services.nix-daemon.enable = lib.mkForce true;
}
51 changes: 38 additions & 13 deletions machines/darwin/pepacton/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,36 @@
qrcp
ninvaders
statix
yt-dlp
wrangler
pipes
];
};

environment.shellAliases = {
rebuild = "darwin-rebuild switch --flake /Users/henrikvt/Desktop/Code/projects/nixmachines#pepacton && omz reload";
# ghostty = "$GHOSTTY_BIN_DIR/ghostty";
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
ytdl = "ytdlp";
home = "cd ~";
nvm = "fnm";
};

environment = {
systemPath = ["\"/Users/henrikvt/Library/Application Support/JetBrains/Toolbox/scripts\"" "$GHOSTTY_BIN_DIR" "$HOME/.bun/bin"];
shellAliases = {
rebuild = "darwin-rebuild switch --flake /Users/henrikvt/Desktop/Code/projects/nixmachines#pepacton && omz reload";
reload = "omz reload";
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
ytdl = "yt-dlp";
home = "cd ~";
nvm = "fnm";
pn = "pnpm";
};
systemPackages = with pkgs; [ncurses];
# systemPath = ["$JETBRAINS_BIN_DIR" "$GHOSTTY_BIN_DIR" "$HOME/.bun/bin"];
variables = {
EDITOR = "nvim";
_ZO_DATA_DIR = "/Users/henrikvt/.zoxide";
_ZO_EXCLUDE_DIRS = "$HOME:$HOME/wpilib/**/*";
JETBRAINS_BIN_DIR = "\"/Users/henrikvt/Library/Application Support/JetBrains/Toolbox/scripts\"";
JETBRAINS_BIN_DIR = "$HOME/Library/Application\ Support/JetBrains/Toolbox/scripts";
FNM_COREPACK_ENABLED = "true";
FNM_RESOLVE_ENGINES = "true";
};
};

home-manager.users.henrikvt = {
home.sessionPath = ["$GHOSTTY_BIN_DIR" "$HOME/.bun/bin" "$JETBRAINS_BIN_DIR"];
programs.git.extraConfig = {
user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICM+1ip8IBO+sK8J7cOwEtA/ba+tTtPHUGYC/KW6mppU";
gpg.format = "ssh";
Expand All @@ -61,10 +68,28 @@
autoMigrate = true;
};

networking.hostName = "pepacton";
networking = {
hostName = "pepacton";
search = [
"reindeer-porgy.ts.net"
"unicycl.ing"
];
knownNetworkServices = [
"USB 10/100/1G/2.5G LAN"
"Thunderbolt Bridge"
"Wi-Fi"
"iPhone USB"
"Tailscale"
"UniFi Teleport"
"Mullvad"
];
};

# Enable GitHub TUI Dashboard (doesn't work on some systems)
home.henrikvt.ghDash = true;
home.henrikvt = {
ghDash = true;
ghostty = true;
};

nixpkgs.hostPlatform = "aarch64-darwin";
# ======================== DO NOT CHANGE THIS ========================
Expand Down
16 changes: 0 additions & 16 deletions machines/nixos/ashokan/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
secretsDir = ../../../secrets;
chownPodman = file: {
inherit file;
owner = "mastodon";
group = "podman";
mode = "0400";
};
Expand All @@ -67,21 +66,6 @@
mastodonAREncryptionEnvVars = chownPodman "${secretsDir}/mastodonAREncryptionEnvVars.age";
};

svcs.traefik = {
enable = true;
environmentFiles = [config.age.secrets.cfDnsApiToken.path];
};

svcs.mastodon = {
enable = true;
configureTraefik = true;
secretKeyBaseEnvFile = config.age.secrets.mastodonSecretKeyBase.path;
otpSecretEnvFile = config.age.secrets.mastodonOtpSecret.path;
vapidKeysEnvFile = config.age.secrets.mastodonVapidKeys.path;
smtpPasswordEnvFile = config.age.secrets.mastodonSmtpPassword.path;
activeRecordEncryptionEnvFile = config.age.secrets.mastodonAREncryptionEnvVars.path;
};

# ======================== DO NOT CHANGE THIS ========================
system.stateVersion = "23.11";
# ======================== DO NOT CHANGE THIS ========================
Expand Down
11 changes: 11 additions & 0 deletions machines/nixos/ashokan/services/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@
enable = true;
environmentFiles = [config.age.secrets.cfDnsApiToken.path];
};

svcs.mastodon = {
enable = true;
configureTraefik = true;

secretKeyBaseEnvFile = config.age.secrets.mastodonSecretKeyBase.path;
otpSecretEnvFile = config.age.secrets.mastodonOtpSecret.path;
vapidKeysEnvFile = config.age.secrets.mastodonVapidKeys.path;
smtpPasswordEnvFile = config.age.secrets.mastodonSmtpPassword.path;
activeRecordEncryptionEnvFile = config.age.secrets.mastodonAREncryptionEnvVars.path;
};
}
Loading
Loading