helix: host photos.sealight.xyz

This commit is contained in:
Anish Lakhwara 2025-02-23 20:09:55 -08:00
parent c6d64984bf
commit a305adaa46
24 changed files with 240 additions and 88 deletions

View file

@ -270,16 +270,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720042825, "lastModified": 1736373539,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.05", "ref": "release-24.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -354,16 +354,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1723938990, "lastModified": 1738277201,
"narHash": "sha256-9tUadhnZQbWIiYVXH8ncfGXGvkNq3Hag4RCBEMUk7MI=", "narHash": "sha256-6L+WXKCw5mqnUIExvqkD99pJQ41xgyCk6z/H9snClwk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c42fcfbdfeae23e68fc520f9182dde9f38ad1890", "rev": "666e1b3f09c267afd66addebe80fb05a5ef2b554",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.05", "ref": "nixos-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -534,11 +534,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1723637854, "lastModified": 1738410390,
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", "rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,7 +3,7 @@
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
@ -11,7 +11,7 @@
# ngipkgs-local.url = "path:/home/anish/usr/ngipkgs"; # ngipkgs-local.url = "path:/home/anish/usr/ngipkgs";
# Home manager # Home manager
home-manager.url = "github:nix-community/home-manager/release-24.05"; home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware"; hardware.url = "github:nixos/nixos-hardware";
@ -78,17 +78,18 @@
nixpkgsFor = forAllSystems (system: nixpkgsFor = forAllSystems (system:
import nixpkgs { import nixpkgs {
inherit system; inherit system;
config.allowUnfreePredicate = pkg: config = {
builtins.elem (nixpkgs.lib.getName pkg) [ permittedInsecurePackages = [
"ripcord" "olm-3.2.16"
"vcv-rack"
"SunVox"
"renoise"
]; ];
# config.permittedInsecurePackages = [ allowUnfreePredicate = pkg:
# "python3.10-django-3.1.14" # Needed for archivebox deployments on curve builtins.elem (nixpkgs.lib.getName pkg) [
# # Check when archive box updates it's dependeny "ripcord"
# ]; "vcv-rack"
"SunVox"
"renoise"
];
};
overlays = [ overlays = [
rust-overlay.overlays.default rust-overlay.overlays.default
tidalcycles.overlays.default tidalcycles.overlays.default
@ -269,7 +270,7 @@
}; };
}; };
checks = builtins.mapAttrs # checks = builtins.mapAttrs
(system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; # (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
}; };
} }

View file

@ -4,6 +4,7 @@
../profiles/cli ../profiles/cli
../profiles/direnv ../profiles/direnv
../profiles/git ../profiles/git
# ../profiles/tmux
]; ];
home.stateVersion = "22.05"; home.stateVersion = "22.05";
} }

View file

@ -53,7 +53,7 @@
less less
gdb gdb
xxd xxd
taskwarrior taskwarrior2
gnupg gnupg
syncthing syncthing
dijo dijo
@ -61,7 +61,6 @@
fontconfig fontconfig
pandoc pandoc
taskwarrior-tui taskwarrior-tui
python3Packages.howdoi
vimwiki-cli vimwiki-cli
(pkgs.writeScriptBin "jq-repl" '' (pkgs.writeScriptBin "jq-repl" ''

View file

@ -22,7 +22,7 @@ in
paper-icon-theme paper-icon-theme
papirus-icon-theme papirus-icon-theme
libsForQt5.qtstyleplugin-kvantum libsForQt5.qtstyleplugin-kvantum
qt5ct libsForQt5.qt5ct
gtk-engine-murrine gtk-engine-murrine
gtk_engines gtk_engines
maim maim

View file

@ -866,7 +866,7 @@ in
zls zls
gopls gopls
gcc gcc
nodePackages_latest.pyright pyright
shellcheck shellcheck
proselint proselint
statix statix

View file

@ -0,0 +1,3 @@
{
home.file.".tmux.confg".source = ./tmux.conf
}

View file

@ -0,0 +1,59 @@
set -g base-index 1
setw -g pane-base-index 1
# https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
# Mouse works as expected
set-option -g mouse on
# easy-to-remember split pane commands
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# don't rename windows automatically
set-option -g allow-rename off
# DESIGN TWEAKS
# don't do anything when a 'bell' rings
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# clock mode
setw -g clock-mode-colour yellow
# copy mode
setw -g mode-style 'fg=black bg=green bold'
# panes
set -g pane-border-style 'fg=green'
set -g pane-active-border-style 'fg=yellow'
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'fg=green'
set -g status-left ''
set -g status-left-length 10
set -g status-right-style 'fg=black bg=yellow'
set -g status-right '%Y-%m-%d %H:%M '
set -g status-right-length 50
setw -g window-status-current-style 'fg=black bg=green'
setw -g window-status-current-format ' #I #W #F '
setw -g window-status-style 'fg=green bg=black'
setw -g window-status-format ' #I #[fg=white]#W #[fg=yellow]#F '
setw -g window-status-bell-style 'fg=yellow bg=green bold'
# messages
set -g message-style 'fg=yellow bg=green bold'

View file

@ -88,7 +88,6 @@
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ]; networking.firewall.allowedTCPPorts = [ 22 ];
sound.enable = false;
programs.gnupg.agent.enable = true; programs.gnupg.agent.enable = true;
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses; programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses;

View file

@ -9,7 +9,7 @@
# ../profiles/monitoring # ../profiles/monitoring
../profiles/nfs ../profiles/nfs
../profiles/gonic ../profiles/gonic
# ../profiles/headphones # TODO broken on 23.11, see: https://github.com/rembo10/headphones/issues/3320 ../profiles/headphones
../profiles/radicale ../profiles/radicale
# ../profiles/seafile # waiting for https://github.com/NixOS/nixpkgs/pull/249523 to be merged # ../profiles/seafile # waiting for https://github.com/NixOS/nixpkgs/pull/249523 to be merged
../profiles/syncthing ../profiles/syncthing
@ -23,8 +23,10 @@
# ../profiles/woodpecker-agent # ../profiles/woodpecker-agent
# ../profiles/jellyfin # ../profiles/jellyfin
../profiles/ulogger-server ../profiles/ulogger-server
../profiles/photoprism # Replace with immich ../profiles/immich
../profiles/jacket
../profiles/gpodder ../profiles/gpodder
../profiles/transmission
#../profiles/postgres_upgrade_script #../profiles/postgres_upgrade_script
]; ];
@ -32,7 +34,7 @@
age.secrets.borg-password.file = "${self}/secrets/borg-password.age"; age.secrets.borg-password.file = "${self}/secrets/borg-password.age";
services.postgresqlBackup = { services.postgresqlBackup = {
enable = true; enable = true;
databases = [ "wallabag" "photoprism" "ulogger" ]; databases = [ "wallabag" "immich" "ulogger" ];
location = "/var/backup/postgresql"; location = "/var/backup/postgresql";
}; };
mossnet.backup = { mossnet.backup = {
@ -52,24 +54,6 @@
# seafile # seafile
}; };
services.transmission = {
enable = true;
settings = {
rpc.bind-address = "0.0.0.0";
download-dir = "/mnt/two/new-music";
};
};
services.nginx.virtualHosts."transmission.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
extraConfig = ''
proxy_pass http://localhost:9091/;
proxy_set_header X-Forwarded-Host $host;
'';
};
};
services.nginx.virtualHosts."mast.mossnet.lan" = { services.nginx.virtualHosts."mast.mossnet.lan" = {
enableACME = false; enableACME = false;

View file

@ -34,7 +34,5 @@
# keyMap = "us"; # keyMap = "us";
# }; # };
sound.enable = true;
services.libinput.enable = true; services.libinput.enable = true;
} }

View file

@ -21,7 +21,6 @@
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
sound.enable = false;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
# This value determines the NixOS release with which your system is to be # This value determines the NixOS release with which your system is to be

View file

@ -30,6 +30,22 @@
privateKeyFile = "/run/agenix/helix-wg"; privateKeyFile = "/run/agenix/helix-wg";
}; };
# Reverse proxy for immich
services.nginx.virtualHosts."photos.sealight.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
extraConfig = ''
proxy_pass http://10.0.69.4:8567;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
'';
};
};
services.postgresql.package = pkgs.postgresql_15; services.postgresql.package = pkgs.postgresql_15;
services.postgresqlBackup = { services.postgresqlBackup = {
# TODO needs working wireguard to box # TODO needs working wireguard to box

View file

@ -19,8 +19,6 @@
# networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
sound.enable = false;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
# This value determines the NixOS release with which your system is to be # This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database # compatible, in order to avoid breaking some software such as database

View file

@ -60,7 +60,7 @@ in {
#unstable.sublime-music #unstable.sublime-music
# olm-3.2.16 is now insecure # olm-3.2.16 is now insecure
# some reason I can't set insecure packages that will be respected # some reason I can't set insecure packages that will be respected
nheko # nheko
unstable.signal-desktop unstable.signal-desktop
unstable.tuba unstable.tuba
unstable.newsflash unstable.newsflash

View file

@ -4,7 +4,6 @@
enable = true; enable = true;
host = "0.0.0.0"; host = "0.0.0.0";
port = 8181; port = 8181;
package = "${pkgs.unstable.headphones}";
user = "headphones"; user = "headphones";
group = "audio"; group = "audio";
dataDir = "/data/music"; dataDir = "/data/music";

View file

@ -0,0 +1,23 @@
{ ... }:
{
services.immich = {
enable = true;
database = {
enable = true;
};
host = "0.0.0.0";
port = 8567;
mediaLocation = "/data/photos";
externalDomain = "https://photos.sealight.xyz";
};
services.nginx.virtualHosts."photos.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
extraConfig = ''
proxy_pass http://127.0.0.1:8567/;
'';
};
};
}

View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
{
services.jackett = {
enable = true;
host = "0.0.0.0";
port = 8011;
user = "jackett";
group = "transmission";
};
services.nginx.virtualHosts."jackett.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
extraConfig = ''
proxy_pass http://127.0.0.1:8011/;
'';
};
};
services.lidarr = {
enable = true;
host = "0.0.0.0";
port = 8012;
user = "lidarr";
group = "transmission";
};
services.nginx.virtualHosts."lidarr.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
extraConfig = ''
proxy_pass http://127.0.0.1:8012/;
'';
};
};
}

View file

@ -19,34 +19,34 @@
homeserverURL = "https://sealight.xyz/"; homeserverURL = "https://sealight.xyz/";
homeserverDomain = "sealight.xyz"; homeserverDomain = "sealight.xyz";
services = { services = {
whatsapp = { # whatsapp = {
port = 29183; # port = 29183;
format = "mautrix-go"; # format = "mautrix-go";
package = pkgs.mautrix-whatsapp; # package = pkgs.mautrix-whatsapp;
}; # };
discord = { # discord = {
port = 29188; # port = 29188;
format = "mautrix-go"; # format = "mautrix-go";
package = pkgs.my-mautrix-discord; # package = pkgs.unstable.mautrix-discord;
}; # };
signal = { # signal = {
port = 29184; # port = 29184;
format = "mautrix-python"; # format = "mautrix-python";
package = pkgs.unstable.mautrix-signal; # package = pkgs.unstable.mautrix-signal;
serviceConfig = { # serviceConfig = {
StateDirectory = [ "matrix-as-signal" "signald" ]; # StateDirectory = [ "matrix-as-signal" "signald" ];
SupplementaryGroups = [ "signald" ]; # SupplementaryGroups = [ "signald" ];
TimeoutStopSec = 1; # work around the service ignoring SIGTERM, see https://gitlab.com/coffeetables/nix-matrix-appservices/-/issues/12 # TimeoutStopSec = 1; # work around the service ignoring SIGTERM, see https://gitlab.com/coffeetables/nix-matrix-appservices/-/issues/12
User = lib.mkForce config.services.signald.user; # User = lib.mkForce config.services.signald.user;
Group = lib.mkForce config.services.signald.group; # Group = lib.mkForce config.services.signald.group;
}; # };
settings.signal = { # settings.signal = {
socket_path = config.services.signald.socketPath; # socket_path = config.services.signald.socketPath;
outgoing_attachment_dir = "/var/lib/signald/tmp"; # outgoing_attachment_dir = "/var/lib/signald/tmp";
}; # };
}; # };
}; };
}; };
} }

View file

@ -12,7 +12,7 @@
# Plugins # Plugins
helm helm
# surge # surge
distrho # distrho
orca-c orca-c
supercollider supercollider
dirt dirt

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
beet import -ql "$TR_TORRENT_DIR"

View file

@ -0,0 +1,33 @@
{ pkgs, ... }:
{
services.transmission = {
enable = true;
settings = {
rpc-enabled = true;
rpc-bind-address = "0.0.0.0";
rpc-whitelist-enabled = false;
script-torrent-done-enabled = true;
# Normally, I would write this into the homedir with home-manager
# And explictly set the dir to be the output of the home-manager location
# But this seems better, if it'll work?
script-torrent-done-filename = pkgs.writeShellScript "beet-import.sh" ''
#!/usr/bin/env bash
beet import -ql "$TR_TORRENT_DIR"
'';
rpc-url = "/transmission/rpc/";
download-dir = "/mnt/two/new-music";
};
};
services.nginx.virtualHosts."transmission.mossnet.lan" = {
enableACME = false;
forceSSL = false;
locations."/" = {
extraConfig = ''
proxy_pass http://localhost:9091/;
proxy_set_header X-Forwarded-Host $host;
'';
};
};
}

View file

@ -6,11 +6,11 @@
tic-80 = pkgs.callPackage ./tic-80.nix { }; tic-80 = pkgs.callPackage ./tic-80.nix { };
fennel-ls = pkgs.callPackage ./fennel-ls.nix { }; fennel-ls = pkgs.callPackage ./fennel-ls.nix { };
# kobopatch = pkgs.callPackage ./kobopatch.nix { }; # kobopatch = pkgs.callPackage ./kobopatch.nix { };
my-mautrix-discord = pkgs.callPackage ./mautrix-discord.nix { }; # Handled by matrix-appservices input # my-mautrix-discord = pkgs.callPackage ./mautrix-discord.nix { }; # Handled by matrix-appservices input
ulogger-server = pkgs.callPackage ./ulogger.nix { }; ulogger-server = pkgs.callPackage ./ulogger.nix { };
# Wallabag is now an overlay # Wallabag is now an overlay
# TODO: we still use the patch from this folder though # TODO: we still use the patch from this folder though
my-wallabag = pkgs.callPackage ./wallabag.nix { }; my-wallabag = pkgs.callPackage ./wallabag.nix { };
mautrix-slack = pkgs.callPackage ./mautrix-slack.nix { }; # mautrix-slack = pkgs.callPackage ./mautrix-slack.nix { };
gpodder2go = pkgs.callPackage ./gpodder2go.nix { }; gpodder2go = pkgs.callPackage ./gpodder2go.nix { };
} }

View file

@ -33,7 +33,7 @@ pkgs.stdenv.mkDerivation rec {
mesa_glu mesa_glu
mesa_glu mesa_glu
freeglut freeglut
] ++ lib.optional stdenv.isLinux alsaLib; ] ++ lib.optional stdenv.isLinux alsa-lib;
configurePhase = '' configurePhase = ''
echo [DIRECTORY] $(pwd) echo [DIRECTORY] $(pwd)