mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 20:40:14 +00:00
Compare commits
9 Commits
unfree-pre
...
64590c539b
Author | SHA1 | Date | |
---|---|---|---|
64590c539b | |||
78b364afd7 | |||
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 = {
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
config = lib.mkIf
|
||||
(config.gui.enable && config._1password.enable && pkgs.stdenv.isLinux) {
|
||||
unfreePackages = with pkgs; [ _1password _1password-gui ];
|
||||
unfreePackages = [ "1password" "_1password-gui" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ _1password-gui ];
|
||||
};
|
||||
|
@ -10,7 +10,7 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
||||
unfreePackages = [ pkgs.discord ];
|
||||
unfreePackages = [ "discord" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ discord ];
|
||||
xdg.configFile."discord/settings.json".text = ''
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.firefox.enable) {
|
||||
|
||||
unfreePackages = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
(lib.mkIf config._1password.enable onepassword-password-manager)
|
||||
okta-browser-plugin
|
||||
unfreePackages = [
|
||||
(lib.mkIf config._1password.enable "onepassword-password-manager")
|
||||
"okta-browser-plugin"
|
||||
];
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
@ -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 = {
|
||||
|
@ -10,7 +10,7 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.obsidian.enable) {
|
||||
unfreePackages = [ pkgs.obsidian ];
|
||||
unfreePackages = [ "obsidian" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ obsidian ];
|
||||
};
|
||||
|
@ -10,7 +10,7 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.slack.enable) {
|
||||
unfreePackages = [ pkgs.slack ];
|
||||
unfreePackages = [ "slack" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ slack ];
|
||||
};
|
||||
|
@ -68,7 +68,7 @@
|
||||
description = "Link to dotfiles repository.";
|
||||
};
|
||||
unfreePackages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "List of unfree packages to allow.";
|
||||
default = [ ];
|
||||
};
|
||||
@ -113,10 +113,8 @@
|
||||
|
||||
# Allow specified unfree packages (identified elsewhere)
|
||||
# Retrieves package object based on string name
|
||||
# Idea: https://discourse.nixos.org/t/how-to-use-packages-directly-in-allowunfreepredicate/22455/6
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (pkg.name or (builtins.parseDrvName pkg.pname).name)
|
||||
(map lib.getName config.unfreePackages);
|
||||
builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
||||
|
@ -181,6 +181,17 @@
|
||||
};
|
||||
};
|
||||
|
||||
xdg.desktopEntries.aerc = lib.mkIf pkgs.stdenv.isLinux {
|
||||
name = "aerc";
|
||||
exec = "kitty aerc %u";
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings =
|
||||
lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+e" = "exec --no-startup-id kitty aerc";
|
||||
};
|
||||
|
||||
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
|
||||
|
@ -18,21 +18,22 @@ in {
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
unzip # Extract zips
|
||||
age # Encryption
|
||||
bc # Calculator
|
||||
dig # DNS lookup
|
||||
fd # find
|
||||
htop # Show system processes
|
||||
inetutils # Includes telnet, whois
|
||||
jq # JSON manipulation
|
||||
lf # File viewer
|
||||
qrencode # Generate qr codes
|
||||
rsync # Copy folders
|
||||
ripgrep # grep
|
||||
fd # find
|
||||
sd # sed
|
||||
jq # JSON manipulation
|
||||
tealdeer # Cheatsheets
|
||||
tree # View directory hierarchy
|
||||
htop # Show system processes
|
||||
qrencode # Generate qr codes
|
||||
vimv-rs # Batch rename files
|
||||
dig # DNS lookup
|
||||
lf # File viewer
|
||||
inetutils # Includes telnet, whois
|
||||
age # Encryption
|
||||
unzip # Extract zips
|
||||
];
|
||||
|
||||
programs.zoxide.enable = true; # Shortcut jump command
|
||||
|
@ -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} = {
|
||||
|
@ -14,7 +14,7 @@ in {
|
||||
|
||||
config = lib.mkIf config.gaming.minecraft-server.enable {
|
||||
|
||||
unfreePackages = [ pkgs.minecraft-server ];
|
||||
unfreePackages = [ "minecraft-server" ];
|
||||
|
||||
services.minecraft-server = {
|
||||
enable = true;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
config = lib.mkIf (config.gaming.steam.enable && pkgs.stdenv.isLinux) {
|
||||
hardware.steam-hardware.enable = true;
|
||||
unfreePackages = with pkgs; [ steam steamcmd steam-run ];
|
||||
unfreePackages = [ "steam" "steam-original" "steamcmd" "steam-run" ];
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
|
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