mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 20:40:14 +00:00
Compare commits
7 Commits
unfree-pre
...
f219ce45c8
Author | SHA1 | Date | |
---|---|---|---|
f219ce45c8 | |||
5002c881f7 | |||
5859377802 | |||
e6dbed2e17 | |||
86076f0844 | |||
2aea76c0e3 | |||
42a5ad40de |
@ -111,6 +111,8 @@
|
||||
gitName = fullName;
|
||||
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
||||
mail.server = "noahmasur.com";
|
||||
mail.imapHost = "imap.purelymail.com";
|
||||
mail.smtpHost = "smtp.purelymail.com";
|
||||
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,6 @@ nixpkgs.lib.nixosSystem {
|
||||
./hardware-configuration.nix
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
(removeAttrs globals [ "mail.server" ])
|
||||
wsl.nixosModules.wsl
|
||||
home-manager.nixosModules.home-manager
|
||||
disko.nixosModules.disko
|
||||
@ -42,6 +41,7 @@ nixpkgs.lib.nixosSystem {
|
||||
streamServer = "stream.masu.rs";
|
||||
nextcloudServer = "cloud.masu.rs";
|
||||
bookServer = "books.masu.rs";
|
||||
arrServer = "download.masu.rs";
|
||||
samba.enable = true;
|
||||
|
||||
backup.s3 = {
|
||||
|
@ -12,12 +12,19 @@
|
||||
config = lib.mkIf (config.gui.enable && config.media.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [
|
||||
mpv # Video viewer
|
||||
sxiv # Image viewer
|
||||
mupdf # PDF viewer
|
||||
zathura # PDF viewer
|
||||
];
|
||||
|
||||
# Video player
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
bindings = { };
|
||||
config = { image-display-duration = 2; };
|
||||
scripts = [ pkgs.mpvScripts.autoload ];
|
||||
};
|
||||
|
||||
# Set default for opening PDFs
|
||||
xdg.mimeApps = {
|
||||
associations.added = {
|
||||
|
@ -181,6 +181,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
xdg.desktopEntries.aerc = lib.mkIf pkgs.stdenv.isLinux {
|
||||
name = "aerc";
|
||||
exec = "kitty aerc %u";
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs = { ae = "aerc"; };
|
||||
|
||||
};
|
||||
|
@ -10,9 +10,17 @@
|
||||
default = config.user;
|
||||
};
|
||||
mail.server = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server name for the email address.";
|
||||
};
|
||||
mail.imapHost = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server host for IMAP (reading mail).";
|
||||
};
|
||||
mail.smtpHost = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server host for SMTP (sending mail).";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mail.enable {
|
||||
@ -42,7 +50,7 @@
|
||||
folders = { };
|
||||
getmail = { };
|
||||
imap = {
|
||||
host = "imap.purelymail.com";
|
||||
host = config.mail.imapHost;
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
@ -55,9 +63,9 @@
|
||||
maildir = { path = "main"; };
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "maildir";
|
||||
expunge = "none";
|
||||
remove = "none";
|
||||
create = "both";
|
||||
expunge = "both";
|
||||
remove = "both";
|
||||
patterns = [ "*" ];
|
||||
extraConfig.channel = {
|
||||
CopyArrivalDate = "yes"; # Sync time of original message
|
||||
@ -70,7 +78,7 @@
|
||||
builtins.toString ../../../private/mailpass.age
|
||||
}";
|
||||
smtp = {
|
||||
host = "smtp.purelymail.com";
|
||||
host = config.mail.smtpHost;
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
|
20
modules/common/shell/bash/default.nix
Normal file
20
modules/common/shell/bash/default.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = {
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
shellAliases =
|
||||
config.home-manager.users.${config.user}.programs.fish.shellAliases;
|
||||
initExtra = "";
|
||||
profileExtra = "";
|
||||
};
|
||||
|
||||
programs.starship.enableBashIntegration = false;
|
||||
programs.zoxide.enableBashIntegration = true;
|
||||
programs.fzf.enableBashIntegration = true;
|
||||
|
||||
};
|
||||
};
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./bash
|
||||
./charm.nix
|
||||
./direnv.nix
|
||||
./fish
|
||||
|
@ -76,7 +76,6 @@
|
||||
set -g fish_cursor_replace_one underscore
|
||||
'';
|
||||
loginShellInit = "";
|
||||
shellAliases = { };
|
||||
shellAbbrs = {
|
||||
|
||||
# Directory aliases
|
||||
|
@ -10,8 +10,8 @@ in {
|
||||
config = lib.mkIf config.gaming.legendary.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
legendary-gl
|
||||
rare # GUI for Legendary (not working)
|
||||
wineWowPackages.stable # 32-bit and 64-bit wineWowPackages, see https://nixos.wiki/wiki/Wine
|
||||
heroic # GUI launcher
|
||||
];
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
69
modules/nixos/services/arr.nix
Normal file
69
modules/nixos/services/arr.nix
Normal file
@ -0,0 +1,69 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options = {
|
||||
arrServer = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Hostname for arr services";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.arrServer != null) {
|
||||
|
||||
services.sonarr.enable = true;
|
||||
services.radarr.enable = true;
|
||||
services.bazarr.enable = true;
|
||||
services.prowlarr.enable = true;
|
||||
|
||||
# Requires updating the base_url config value in each service
|
||||
# If you try to rewrite the URL, the service won't redirect properly
|
||||
caddy.routes = [
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/sonarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:8989"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/radarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:7878"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/prowlarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:9696"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/bazarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:6767"; }];
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -24,6 +24,16 @@
|
||||
listen = [ ":443" ];
|
||||
routes = config.caddy.routes;
|
||||
errors.routes = config.caddy.blocks;
|
||||
# logs = { }; # Uncomment to collect access logs
|
||||
};
|
||||
logging.logs.main = {
|
||||
encoder = { format = "console"; };
|
||||
writer = {
|
||||
output = "file";
|
||||
filename = "${config.services.caddy.logDir}/caddy.log";
|
||||
roll = true;
|
||||
};
|
||||
level = "INFO";
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
{ ... }: {
|
||||
|
||||
imports = [
|
||||
./arr.nix
|
||||
./backups.nix
|
||||
./caddy.nix
|
||||
./calibre.nix
|
||||
|
@ -41,7 +41,9 @@
|
||||
};
|
||||
|
||||
# Create reverse proxy for web UI
|
||||
caddy.routes = [{
|
||||
caddy.routes = lib.mkAfter [{
|
||||
group =
|
||||
lib.mkIf (config.arrServer == config.transmissionServer) "download";
|
||||
match = [{ host = [ config.transmissionServer ]; }];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
|
Reference in New Issue
Block a user