smallest change

This commit is contained in:
zack 2025-03-22 16:03:07 -04:00
parent 4cca1dc327
commit 9c83ba6849
No known key found for this signature in database
GPG key ID: EE8A2B709E2401D1
77 changed files with 36828 additions and 1516 deletions

View file

@ -17,11 +17,11 @@ in {
config = mkIf cfg.enable {
services.swaync = {
enable = true;
style = ''
style = lib.mkForce ''
* {
all: unset;
font-size: 14px;
font-family: "Cantarell";
font-family: "Adwaita Sans", "JetBrains Mono Nerd Font";
transition: 200ms;
}
@ -290,16 +290,16 @@ in {
border: 1px solid #6e738d;
}
.widget-mpris .widget-mpris-player {
.widget-mpris .widget-mpris-player .widget-mpd {
background: #363a4f;
padding: 7px;
}
.widget-mpris .widget-mpris-title {
.widget-mpris .widget-mpris-title .widget-mpd .widget-mpd-title {
font-size: 1.2rem;
}
.widget-mpris .widget-mpris-subtitle {
.widget-mpris .widget-mpris-subtitle .widget-mpd .widget-mpd-subtitle {
font-size: 0.8rem;
}
@ -419,6 +419,7 @@ in {
#tray,
#memory,
#window,
#mpd
#mpris {
padding: 0.3rem 0.6rem;
margin: 0.4rem 0.25rem;
@ -518,6 +519,32 @@ in {
exec = "spotifatius monitor";
};
mpd = {
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {title}";
"format-disconnected" = "Disconnected ";
"format-stopped" = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
"interval" = 10;
"consume-icons" = {
"on" = " ";
};
"random-icons" = {
"off" = "<span color=\"#f53c3c\"></span> ";
"on" = " ";
};
"repeat-icons" = {
"on" = " ";
};
"single-icons" = {
"on" = "1 ";
};
"state-icons" = {
"paused" = "";
"playing" = "";
};
"tooltip-format" = "MPD (connected)";
"tooltip-format-disconnected" = "";
};
mpris = {
player = "spotify";
"dynamic-order" = ["artist" "title"];

View file

@ -0,0 +1,37 @@
{
options,
config,
lib,
...
}:
with lib;
with lib.custom; let
cfg = config.apps.mail.aerc;
in {
options.apps.mail.aerc = with types; {
enable = mkBoolOpt false "Enable Aerc Mail Client";
};
config = mkIf cfg.enable {
programs.aerc = {
enable = false;
package = nixos-stable.aerc;
extraConfig = {
general = {
pgp-provider = "gpg";
};
filters = {
"text/plain" = "colorize";
"text/calendar" = "calendar";
"message/delivery-status" = "colorize";
"message/rfc822" = " colorize";
"text/html" = "pandoc -f html -t plain | colorize";
};
hooks = {
"mail-received" = "notify-send \"[$AERC_ACCOUNT/$AERC_FOLDER] New mail from $AERC_FROM_NAME\" \"$AERC_SUBJECT\"";
};
};
};
};
}

View file

@ -42,6 +42,7 @@ in {
settings = {
window_padding_width = 12;
background_opacity = "0.9";
# background = "#000000";
};
};
};

View file

@ -61,9 +61,6 @@ in {
sqlite
# :lang latex & :lang org (latex previews)
texlive.combined.scheme-medium
# :lang beancount
beancount
fava
# :lang nix
age
];

View file

@ -58,6 +58,12 @@ in {
autoupdate = true;
enabled = true;
};
sendemail = {
smtpserver = "mail.zoeys.cloud";
smtpuser = "hi@zoeys.computer";
smtpencryption = "ssl";
smtpserverport = 465;
};
};
lfs.enable = true;
delta.enable = true;

View file

@ -22,8 +22,11 @@
"lazyvim.plugins.extras.lang.elixir",
"lazyvim.plugins.extras.lang.tex",
"lazyvim.plugins.extras.lang.go",
"lazyvim.plugins.extras.lang.python",
"lazyvim.plugins.extras.lang.zig",
"lazyvim.plugins.extras.lang.typescript",
"lazyvim.plugins.extras.test.core",
"lazyvim.plugins.extras.util.rest",
"lazyvim.plugins.extras.util.dot",
"lazyvim.plugins.extras.util.mini-hipatterns",
"lazyvim.plugins.extras.coding.luasnip",
@ -32,5 +35,5 @@
"news": {
"NEWS.md": "6520"
},
"version": 7
"version": 8
}

View file

@ -2,10 +2,20 @@ return {
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin-macchiato",
colorscheme = "catppuccin-mocha",
news = { lazyvim = false },
},
},
{
"drewxs/ash.nvim",
lazy = false,
priority = 1000,
},
{
"dgox16/oldworld.nvim",
lazy = false,
priority = 1000,
},
{
"snacks.nvim",
opts = {
@ -16,7 +26,7 @@ return {
preset = {
header = [[
l
l ~
f_,)
]],
@ -24,6 +34,14 @@ return {
},
},
},
-- {
-- "uZer/pywal16.nvim",
-- -- for local dev replace with:
-- -- dir = '~/your/path/pywal16.nvim',
-- config = function()
-- vim.cmd.colorscheme("pywal16")
-- end,
-- },
{
"catppuccin",
opts = {
@ -31,6 +49,13 @@ return {
integrations = {
blink_cmp = true,
},
-- color_overrides = {
-- mocha = {
-- base = "#000000",
-- mantle = "#000000",
-- crust = "#000000",
-- },
-- },
},
},
"f-person/git-blame.nvim",
@ -46,6 +71,7 @@ return {
javascriptreact = { "prettierd" },
javascript = { "prettierd" },
htmlangular = { "prettierd" },
python = { "black" },
},
},
},
@ -75,6 +101,37 @@ return {
-- whitespace = { highlight = "Whitespace", "NonText" },
-- },
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
emmet_ls = {},
slang = {
inlayHints = {
deducedTypes = true,
paramaterNames = true,
},
},
nil_ls = {
settings = {
["nil"] = {
nix = {
flake = {
autoEvalInputs = true,
nixpkgsInputName = "nixpkgs",
autoArchive = true,
},
maxMemoryMB = 4096,
},
formatting = {
command = { "nixfmt" },
},
},
},
},
},
},
},
-- lua with lazy.nvim
{
"max397574/better-escape.nvim",

View file

@ -58,8 +58,6 @@ in {
(pkgs.rust-bin.selectLatestNightlyWith
(toolchain: toolchain.default))
rust-analyzer
vscode-langservers-extracted
nodePackages.vscode-json-languageserver
nodePackages.typescript-language-server
#nodePackages.astro-language-server
nodePackages.bash-language-server
@ -92,7 +90,7 @@ in {
postgresql
mongosh
gerbera
vscode-extensions.vadimcn.vscode-lldb.adapter
# vscode-extensions.vadimcn.vscode-lldb.adapter
];
plugins = with pkgs.vimPlugins; [
lazy-nix-helper-nvim

View file

@ -14,10 +14,17 @@ in {
};
config = mkIf cfg.enable {
catppuccin.tmux = {
enable = true;
# extraConfig = ''
# set -g @catppuccin_window_status_style "basic"
# set -g @catppuccin_status_background "#000000"
# '';
};
programs.tmux = {
enable = true;
shell = "${pkgs.zsh}/bin/zsh";
catppuccin.enable = true;
historyLimit = 100000;
plugins = with pkgs; [
tmuxPlugins.sensible
@ -35,7 +42,6 @@ in {
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
set -g @catppuccin_window_status_style "basic"
set -g default-terminal "tmux-256color"
set -g allow-passthrough on

View file

@ -0,0 +1,40 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.apps.video.mpv;
in {
options.apps.video.mpv = with types; {
enable = mkBoolOpt false "Enable MPV video player";
};
config = mkIf cfg.enable {
catppuccin.mpv.enable = false;
home.packages = with pkgs; [open-in-mpv];
programs.mpv = {
enable = true;
config = {
profile = "main";
background-color = "#000000";
};
scripts = with pkgs.mpvScripts; [uosc sponsorblock thumbfast quality-menu];
profiles = {
main = {
vo = "gpu-next";
};
"protocol.dvd" = {
profile-desc = "profile for dvd:// streams";
alang = "en";
};
};
};
};
}

View file

@ -1,259 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.apps.web.firefox;
in {
options.apps.web.firefox = with types; {
enable = mkBoolOpt false "Enable or disable firefox";
setDefault = mkBoolOpt false "Set Firefox as default browser";
};
config = mkIf cfg.enable {
xdg.mimeApps.defaultApplications = mkIf cfg.setDefault {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"image/png" = "feh.desktop";
};
programs.firefox = let
lock-false = {
Value = false;
Status = "locked";
};
lock-true = {
Value = true;
Status = "locked";
};
in {
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
extraPolicies = {
DisableTelemetry = true;
Preferences = {
"app.normandy.api_url" = {
Value = "";
Status = "locked";
};
"app.normandy.enabled" = lock-false;
"app.shield.optoutstudies.enabled" = lock-false;
"app.update.auto" = lock-false;
"beacon.enabled" = lock-false;
"breakpad.reportURL" = {
Value = "";
Status = "locked";
};
"browser.aboutConfig.showWarning" = lock-false;
"browser.cache.offline.enable" = lock-false;
"browser.crashReports.unsubmittedCheck.autoSubmit" = lock-false;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = lock-false;
"browser.crashReports.unsubmittedCheck.enabled" = lock-false;
"browser.disableResetPrompt" = lock-true;
"browser.newtab.preload" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false;
"browser.newtabpage.enhanced" = lock-false;
"browser.newtabpage.introShown" = lock-true;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.safebrowsing.appRepURL" = {
Value = "";
Status = "locked";
};
"browser.safebrowsing.blockedURIs.enabled" = lock-false;
"browser.safebrowsing.downloads.enabled" = lock-false;
"browser.safebrowsing.downloads.remote.enabled" = lock-false;
"browser.safebrowsing.downloads.remote.url" = {
Value = "";
Status = "locked";
};
"browser.safebrowsing.enabled" = lock-false;
"browser.safebrowsing.malware.enabled" = lock-false;
"browser.safebrowsing.phishing.enabled" = lock-false;
"browser.selfsupport.url" = {
Value = "";
Status = "locked";
};
"browser.send_pings" = lock-false;
"browser.sessionstore.privacy_level" = {
Value = 0;
Status = "locked";
};
"browser.shell.checkDefaultBrowser" = lock-false;
"browser.startup.homepage_override.mstone" = {
Value = "ignore";
Status = "locked";
};
"browser.tabs.crashReporting.sendReport" = lock-false;
"browser.urlbar.groupLabels.enabled" = lock-false;
"browser.urlbar.quicksuggest.enabled" = lock-false;
"browser.urlbar.speculativeConnect.enabled" = lock-false;
"browser.urlbar.trimURLs" = lock-false;
"browser.urlbar.suggest.quicksuggest.sponsored" = lock-false;
"datareporting.healthreport.service.enabled" = lock-false;
"datareporting.healthreport.uploadEnabled" = lock-false;
"datareporting.policy.dataSubmissionEnabled" = lock-false;
"device.sensors.ambientLight.enabled" = lock-false;
"device.sensors.enabled" = lock-false;
"device.sensors.motion.enabled" = lock-false;
"device.sensors.orientation.enabled" = lock-false;
"device.sensors.proximity.enabled" = lock-false;
"dom.battery.enabled" = lock-false;
"dom.event.clipboardevents.enabled" = lock-false;
"dom.webaudio.enabled" = lock-false;
"experiments.activeExperiment" = lock-false;
"experiments.enabled" = lock-false;
"experiments.manifest.uri" = {
Value = "";
Status = "locked";
};
"experiments.supported" = lock-false;
"extensions.ClearURLs@kevinr.whiteList" = {
Value = "";
Status = "locked";
};
"extensions.Decentraleyes@ThomasRientjes.whiteList" = {
Value = "";
Status = "locked";
};
"extensions.FirefoxMulti-AccountContainers@mozilla.whiteList" = {
Value = "";
Status = "locked";
};
"extensions.TemporaryContainers@stoically.whiteList" = {
Value = "";
Status = "locked";
};
"extensions.autoDisableScopes" = 14;
"extensions.getAddons.cache.enabled" = lock-false;
"extensions.getAddons.showPane" = lock-false;
"extensions.greasemonkey.stats.optedin" = lock-false;
"extensions.greasemonkey.stats.url" = {
Value = "";
Status = "locked";
};
"extensions.pocket.enabled" = lock-false;
"extensions.shield-recipe-client.api_url" = {
Value = "";
Status = "locked";
};
"extensions.shield-recipe-client.enabled" = lock-false;
"extensions.webservice.discoverURL" = {
Value = "";
Status = "locked";
};
"media.autoplay.default" = {
Value = 0;
Status = "locked";
};
"media.autoplay.enabled" = lock-true;
"media.eme.enabled" = lock-false;
"media.gmp-widevinecdm.enabled" = lock-false;
"media.navigator.enabled" = lock-false;
"media.peerconnection.enabled" = lock-false;
"media.video_stats.enabled" = lock-false;
"network.IDN_show_punycode" = lock-true;
"network.allow-experiments" = lock-false;
"network.captive-portal-service.enabled" = lock-false;
"network.cookie.cookieBehavior" = {
Value = 1;
Status = "locked";
};
"network.dns.disablePrefetch" = lock-true;
"network.dns.disablePrefetchFromHTTPS" = lock-true;
"network.http.referer.spoofSource" = lock-true;
"network.http.speculative-parallel-limit" = {
Value = 0;
Status = "locked";
};
"network.predictor.enable-prefetch" = lock-false;
"network.predictor.enabled" = lock-false;
"network.prefetch-next" = lock-false;
"network.trr.mode" = {
Value = 5;
Status = "locked";
};
"privacy.donottrackheader.enabled" = lock-true;
"privacy.donottrackheader.value" = {
Value = 1;
Status = "locked";
};
"privacy.firstparty.isolate" = lock-true;
"privacy.query_stripping" = lock-true;
"privacy.trackingprotection.cryptomining.enabled" = lock-true;
"privacy.trackingprotection.enabled" = lock-true;
"privacy.trackingprotection.fingerprinting.enabled" = lock-true;
"privacy.trackingprotection.pbmode.enabled" = lock-true;
"privacy.usercontext.about_newtab_segregation.enabled" = lock-true;
"security.ssl.disable_session_identifiers" = lock-true;
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = lock-false;
"signon.autofillForms" = lock-false;
"toolkit.telemetry.archive.enabled" = lock-false;
"toolkit.telemetry.bhrPing.enabled" = lock-false;
"toolkit.telemetry.cachedClientID" = {
Value = "";
Status = "locked";
};
"toolkit.telemetry.enabled" = lock-false;
"toolkit.telemetry.firstShutdownPing.enabled" = lock-false;
"toolkit.telemetry.hybridContent.enabled" = lock-false;
"toolkit.telemetry.newProfilePing.enabled" = lock-false;
"toolkit.telemetry.prompted" = {
Value = 2;
Status = "locked";
};
"toolkit.telemetry.rejected" = lock-true;
"toolkit.telemetry.reportingpolicy.firstRun" = lock-false;
"toolkit.telemetry.server" = {
Value = "";
Status = "locked";
};
"toolkit.telemetry.shutdownPingSender.enabled" = lock-false;
"toolkit.telemetry.unified" = lock-false;
"toolkit.telemetry.unifiedIsOptIn" = lock-false;
"toolkit.telemetry.updatePing.enabled" = lock-false;
"webgl.renderer-string-override" = {
Value = " ";
Status = "locked";
};
"webgl.vendor-string-override" = {
Value = " ";
Status = "locked";
};
};
ExtensionSettings = with builtins; let
extension = shortId: uuid: {
name = uuid;
value = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "normal_installed";
};
};
in
listToAttrs [
(extension "ublock-origin" "uBlock0@raymondhill.net")
(extension "privacy-badger17" "jid1-MnnxcxisBPnSXQ@jetpack")
(extension "1password-x-password-manager" "{d634138d-c276-4fc8-924b-40a0ea21d284}")
(extension "firefox-color" "FirefoxColor@mozilla.com")
(extension "multi-account-containers" "@testpilot-containers")
(extension "temporary-containers" "{c607c8df-14a7-4f28-894f-29e8722976af}")
(extension "styl-us" "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}")
(extension "betterttv" "firefox@betterttv.net")
(extension "decentraleyes" "jid1-BoFifL9Vbdl2zQ@jetpack")
(extension "canvasblocker" "CanvasBlocker@kkapsner.de")
(extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}")
(extension "mtab" "contact@maxhu.dev")
];
};
};
};
};
}

View file

@ -9,9 +9,9 @@ with lib.custom; let
cfg = config.apps.web.librewolf;
in {
options.apps.web.librewolf = with types; {
enable = mkBoolOpt false "Enable librewolf";
enable = mkBoolOpt false "Enable or disable librewolf";
setDefault = mkBoolOpt false "Set Librewolf to default";
setDefault = mkBoolOpt false "Set Librewolf as default browser";
};
config = mkIf cfg.enable {
@ -19,17 +19,233 @@ in {
"text/html" = "librewolf.desktop";
"x-scheme-handler/http" = "librewolf.desktop";
"x-scheme-handler/https" = "librewolf.desktop";
"image/png" = "feh.desktop";
};
programs.librewolf = {
enable = true;
settings = {
"webgl.disabled" = false;
"privacy.resistFingerprinting" = false;
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.cookies" = false;
"network.cookie.lifetimePolicy" = 0;
profiles.${config.home.username} = {
id = 0;
isDefault = true;
search = {
default = "SearXNG";
engines = {
"NixOS Options" = {
urls = [
{
template = "https://search.nixos.org/options?query={searchTerms}";
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@nixos"];
};
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages?query={searchTerms}";
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@nixpkgs"];
};
"OpenStreetMap" = {
urls = [
{
template = "https://www.openstreetmap.org/search?query={searchTerms}";
}
];
iconUpdateURL = "https://www.openstreetmap.org/favicon.ico";
definedAliases = ["@openstreetmap" "@osm"];
};
"SearXNG" = {
urls = [
{
template = "https://search.zoeys.computer/searx/search?q={searchTerms}";
}
];
iconUpdateURL = "https://search.zoeys.computer/searx/static/themes/simple/img/favicon.svg";
definedAliases = ["@searx"];
};
"docs.rs" = {
urls = [
{
template = "https://docs.rs/releases/search?query={searchTerms}";
}
];
iconUpdateURL = "https://docs.rs/-/static/favicon.ico";
definedAliases = ["@docs"];
};
"crates.io" = {
urls = [
{
template = "https://crates.io/search?q={searchTerms}";
}
];
iconUpdateURL = "https://crates.io/assets/cargo.png";
definedAliases = ["@crates"];
};
};
force = true; # Required to prevent search engine symlink being overwritten. See https://github.com/nix-community/home-manager/issues/3698
};
};
policies = {
DisableTelemetry = true;
Preferences = {
"app.normandy.api_url" = "";
"app.normandy.enabled" = false;
"app.shield.optoutstudies.enabled" = false;
"app.update.auto" = false;
"beacon.enabled" = false;
"breakpad.reportURL" = "";
"browser.aboutConfig.showWarning" = false;
"browser.cache.offline.enable" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
"browser.crashReports.unsubmittedCheck.enabled" = false;
"browser.disableResetPrompt" = true;
"browser.newtab.preload" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.enhanced" = false;
"browser.newtabpage.introShown" = true;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.newtabpage.activity-stream.system.showSponsored" = false;
"browser.safebrowsing.appRepURL" = "";
"browser.safebrowsing.blockedURIs.enabled" = false;
"browser.safebrowsing.downloads.enabled" = false;
"browser.safebrowsing.downloads.remote.enabled" = false;
"browser.safebrowsing.downloads.remote.url" = "";
"browser.safebrowsing.enabled" = false;
"browser.safebrowsing.malware.enabled" = false;
"browser.safebrowsing.phishing.enabled" = false;
"browser.selfsupport.url" = "";
"browser.send_pings" = false;
"browser.sessionstore.privacy_level" = 0;
"browser.shell.checkDefaultBrowser" = false;
"browser.startup.homepage_override.mstone" = "";
"browser.tabs.crashReporting.sendReport" = false;
"browser.urlbar.groupLabels.enabled" = false;
"browser.urlbar.quicksuggest.enabled" = false;
"browser.urlbar.speculativeConnect.enabled" = false;
"browser.urlbar.trimURLs" = false;
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
"datareporting.healthreport.service.enabled" = false;
"datareporting.healthreport.uploadEnabled" = false;
"datareporting.policy.dataSubmissionEnabled" = false;
"device.sensors.ambientLight.enabled" = false;
"device.sensors.enabled" = false;
"device.sensors.motion.enabled" = false;
"device.sensors.orientation.enabled" = false;
"device.sensors.proximity.enabled" = false;
"dom.battery.enabled" = false;
"dom.event.clipboardevents.enabled" = false;
"dom.webaudio.enabled" = false;
"experiments.activeExperiment" = false;
"experiments.enabled" = false;
"experiments.manifest.uri" = "";
"experiments.supported" = false;
"extensions.ClearURLs@kevinr.whiteList" = "";
"extensions.Decentraleyes@ThomasRientjes.whiteList" = "";
"extensions.FirefoxMulti-AccountContainers@mozilla.whiteList" = "";
"extensions.TemporaryContainers@stoically.whiteList" = "";
"extensions.autoDisableScopes" = 14;
"extensions.getAddons.cache.enabled" = false;
"extensions.getAddons.showPane" = false;
"extensions.greasemonkey.stats.optedin" = false;
"extensions.greasemonkey.stats.url" = "";
"extensions.pocket.enabled" = false;
"extensions.shield-recipe-client.api_url" = "";
"extensions.shield-recipe-client.enabled" = false;
"extensions.webservice.discoverURL" = "";
"media.autoplay.default" = 0;
"media.autoplay.enabled" = true;
"media.eme.enabled" = false;
"media.gmp-widevinecdm.enabled" = false;
"media.navigator.enabled" = false;
"media.peerconnection.enabled" = false;
"media.video_stats.enabled" = false;
"network.IDN_show_punycode" = true;
"network.allow-experiments" = false;
"network.captive-portal-service.enabled" = false;
"network.cookie.cookieBehavior" = 1;
"network.dns.disablePrefetch" = true;
"network.dns.disablePrefetchFromHTTPS" = true;
"network.http.referer.spoofSource" = true;
"network.http.speculative-parallel-limit" = "";
"network.predictor.enable-prefetch" = false;
"network.predictor.enabled" = false;
"network.prefetch-next" = false;
"network.trr.mode" = "";
"privacy.donottrackheader.enabled" = true;
"privacy.donottrackheader.value" = "";
"privacy.firstparty.isolate" = true;
"privacy.query_stripping" = true;
"privacy.trackingprotection.cryptomining.enabled" = true;
"privacy.trackingprotection.enabled" = true;
"privacy.trackingprotection.fingerprinting.enabled" = true;
"privacy.trackingprotection.pbmode.enabled" = true;
"privacy.usercontext.about_newtab_segregation.enabled" = true;
"security.ssl.disable_session_identifiers" = true;
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = false;
"signon.autofillForms" = false;
"toolkit.telemetry.archive.enabled" = false;
"toolkit.telemetry.bhrPing.enabled" = false;
"toolkit.telemetry.cachedClientID" = "";
"toolkit.telemetry.enabled" = false;
"toolkit.telemetry.firstShutdownPing.enabled" = false;
"toolkit.telemetry.hybridContent.enabled" = false;
"toolkit.telemetry.newProfilePing.enabled" = false;
"toolkit.telemetry.prompted" = "";
"toolkit.telemetry.rejected" = true;
"toolkit.telemetry.reportingpolicy.firstRun" = false;
"toolkit.telemetry.server" = "";
"toolkit.telemetry.shutdownPingSender.enabled" = false;
"toolkit.telemetry.unified" = false;
"toolkit.telemetry.unifiedIsOptIn" = false;
"toolkit.telemetry.updatePing.enabled" = false;
"webgl.renderer-string-override" = " ";
"webgl.vendor-string-override" = " ";
};
ExtensionSettings = with builtins; let
extension = shortId: uuid: {
name = uuid;
value = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "normal_installed";
};
};
in
listToAttrs [
(extension "ublock-origin" "uBlock0@raymondhill.net")
(extension "privacy-badger17" "jid1-MnnxcxisBPnSXQ@jetpack")
(extension "1password-x-password-manager" "{d634138d-c276-4fc8-924b-40a0ea21d284}")
(extension "firefox-color" "FirefoxColor@mozilla.com")
(extension "multi-account-containers" "@testpilot-containers")
(extension "temporary-containers" "{c607c8df-14a7-4f28-894f-29e8722976af}")
(extension "styl-us" "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}")
(extension "betterttv" "firefox@betterttv.net")
(extension "decentraleyes" "jid1-BoFifL9Vbdl2zQ@jetpack")
(extension "canvasblocker" "CanvasBlocker@kkapsner.de")
(extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}")
(extension "mtab" "contact@maxhu.dev")
];
};
};
};

View file

@ -26,7 +26,7 @@ in {
enable = true;
font = {
name = "Cantarell";
name = "Adwaita Sans";
size = 11;
};

View file

@ -0,0 +1,28 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.programs.pywal2;
in {
options = {programs.pywal2 = {enable = mkEnableOption "pywal";};};
config = mkIf cfg.enable {
home.packages = [pkgs.pywal];
programs.zsh.initExtra = ''
# Import colorscheme from 'wal' asynchronously
# & # Run the process in the background.
# ( ) # Hide shell job control messages.
(cat ${config.xdg.cacheHome}/wal/sequences &)
'';
programs.kitty.extraConfig = ''
include ${config.xdg.cacheHome}/wal/colors-kitty.conf
'';
programs.rofi.theme."@import" = "${config.xdg.cacheHome}/wal/colors-rofi-dark.rasi";
};
}

View file

@ -1,48 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.pm-bridge;
in {
options.services.pm-bridge = with types; {
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable the Bridge.";
};
nonInteractive = mkOption {
type = types.bool;
default = false;
description = "Start Bridge entirely noninteractively";
};
logLevel = mkOption {
type = types.enum ["panic" "fatal" "error" "warn" "info" "debug" "debug-client" "debug-server"];
default = "info";
description = "The log level";
};
};
config = mkIf cfg.enable {
systemd.user.services.protonmail-bridge = {
Unit = {
Description = "Protonmail Bridge";
After = ["network.target"];
};
Service = {
Restart = "always";
ExecStart = "${lib.getExe pkgs.hydroxide} serve";
};
Install = {
WantedBy = ["default.target"];
};
};
};
}

View file

@ -44,6 +44,8 @@ in {
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
xwayland.enable = true;
# plugins = with pkgs.hyprlandPlugins; [hypr-dynamic-cursors];
systemd = {
enable = false;
enableXdgAutostart = true;
@ -52,14 +54,15 @@ in {
wayland.windowManager.hyprland.settings = with colors; {
exec-once = [
"pw-loopback -C \"alsa_input.pci-0000_0d_00.4.analog-stereo\" -P \"Scarlett Solo (3rd Gen.) Headphones / Line 1-2\""
# "pw-loopback -C \"alsa_input.pci-0000_0d_00.4.analog-stereo\" -P \"Scarlett Solo (3rd Gen.) Headphones / Line 1-2\""
# "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
# "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
"zen"
"librewolf"
"thunderbird"
"vesktop"
"spotify"
"slack"
"${lib.getExe pkgs.bash} -c '(( $(date +%u) < 6 )) && ${lib.getExe pkgs.slack}'"
"signal-desktop"
];
env = [
@ -92,10 +95,11 @@ in {
"${mod},X,exec, ags --toggle-window \"dashboard\""
"${mod},Print,exec,${lib.getExe pkgs.custom.sc}"
"${mod},Shift&Print,exec,\"${lib.getExe pkgs.grim} -g ${lib.getExe pkgs.slurp} | wl-copy\""
"${mod},S,exec,${lib.getExe pkgs.grim} -g \"$(${lib.getExe pkgs.slurp})\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"
# grim -g "$(slurp)" | wl-copy
"${modshift},O,exec,wl-ocr"
"${mod},Period,exec, tofi-emoji"
"${mod},Period,exec,rofimoji"
"${modshift},L,exec,swaylock --grace 0" # lock screen
]
@ -114,6 +118,8 @@ in {
# border thiccness
border_size = 2;
allow_tearing = true;
# active border color
"col.active_border" = "rgb(${rose})";
"col.inactive_border" = "rgb(${muted})";
@ -171,8 +177,12 @@ in {
force_zero_scaling = true;
};
ecosystem = {
no_update_news = true;
no_donation_nag = true;
};
experimental = {
hdr = false;
xx_color_management_v4 = true;
};
@ -180,7 +190,8 @@ in {
no_hardware_cursors = true;
};
monitor = ["DP-1,2560x1440@240,0x0,1" "HDMI-A-1,disable" "DP-2,disable"];
# for 10 bit color: DP-3,2560x1440@240,0x0,1,bitdepth,10,cm,hdr,sdrbrightness,1.2,sdrsaturation,1.0
monitor = ["DP-3,2560x1440@240,0x0,1" "HDMI-A-1,disable" "DP-1,disable"];
layerrule = [
"blur, ^(gtk-layer-shell)$"
@ -220,7 +231,7 @@ in {
"workspace 4, title:^(.*(Disc|WebC)ord.*)$"
"workspace 4, class:^(.*Slack.*)$"
"workspace 3, title:^(Spotify Premium)$"
"workspace 2, class:^(zen)$"
"workspace 2, class:^(librewolf)$"
"opacity 0.0 override,class:^(xwaylandvideobridge)$"
"noanim,class:^(xwaylandvideobridge)$"
"noinitialfocus,class:^(xwaylandvideobridge)$"

View file

@ -0,0 +1,27 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.work.vpn;
in {
options.work.vpn = with types; {
enable = mkBoolOpt false "Enable Work VPN Config";
};
config = mkIf cfg.enable {
xdg.configFile."vpn/work.ovpn" = {
text = ''
conifg /home/zoey/cvpn-client.ovpn
up ${pkgs.update-resolv-conf}/libexec/openvpn/update-resolv-conf
down ${pkgs.update-resolv-conf}/libexec/openvpn/update-resolv-conf
'';
recursive = true;
};
};
}

View file

@ -0,0 +1,209 @@
-- As explained on (and stolen from): https://bennett.dev/auto-link-pipewire-ports-wireplumber/
--
-- This script keeps my stereo-null-sink connected to whatever output I'm currently using.
-- I do this so Pulseaudio (and Wine) always sees a stereo output plus I can swap the output
-- without needing to reconnect everything.
-- Link two ports together
function link_port(output_port, input_port)
if not input_port or not output_port then
return nil
end
print("out", dump(output_port.properties))
print("in", dump(input_port.properties))
local link_args = {
["link.input.node"] = input_port.properties["node.id"],
["link.input.port"] = input_port.properties["object.id"],
["link.output.node"] = output_port.properties["node.id"],
["link.output.port"] = output_port.properties["object.id"],
-- -- The node never got created if it didn't have this field set to something
-- ["object.id"] = nil,
--
-- -- I was running into issues when I didn't have this set
-- ["object.linger"] = 1,
--
-- ["node.description"] = "Link created by auto_connect_ports",
}
print(dump(link_args))
local link = Link("link-factory", link_args)
link:activate(1)
print("link created", dump(link.properties))
return link
end
-- Automatically link ports together by their specific audio channels.
--
-- ┌──────────────────┐ ┌───────────────────┐
-- │ │ │ │
-- │ FL ├────────►│ AUX0 │
-- │ OUTPUT │ │ │
-- │ FR ├────────►│ AUX1 INPUT │
-- │ │ │ │
-- └──────────────────┘ │ AUX2 │
-- │ │
-- └───────────────────┘
--
-- -- Call this method inside a script in global scope
--
-- auto_connect_ports {
--
-- -- A constraint for all the required ports of the output device
-- output = Constraint { "node.name"}
--
-- -- A constraint for all the required ports of the input device
-- input = Constraint { .. }
--
-- -- A mapping of output audio channels to input audio channels
--
-- connections = {
-- ["FL"] = "AUX0"
-- ["FR"] = "AUX1"
-- }
--
-- }
function dump(o)
if type(o) == "table" then
local s = "{ "
for k, v in pairs(o) do
if type(k) ~= "number" then
k = '"' .. k .. '"'
end
s = s .. "[" .. k .. "] = " .. dump(v) .. ","
end
return s .. "} "
else
return tostring(o)
end
end
function auto_connect_ports(args)
local output_om = ObjectManager({
Interest({
type = "port",
args["output"],
Constraint({ "port.direction", "equals", "out" }),
}),
})
print("output_om", dump(output_om))
local links = {}
local input_om = ObjectManager({
Interest({
type = "port",
args["input"],
Constraint({ "port.direction", "equals", "in" }),
}),
})
print("input_om", dump(input_om))
local all_links = ObjectManager({
Interest({
type = "link",
}),
})
print("all_links", dump(all_links))
local unless = nil
if args["unless"] then
unless = ObjectManager({
Interest({
type = "port",
args["unless"],
Constraint({ "port.direction", "equals", "in" }),
}),
})
end
function _connect()
print("connecting...")
local delete_links = unless and unless:get_n_objects() > 0
if delete_links then
for _i, link in pairs(links) do
link:request_destroy()
end
links = {}
return
end
for output_name, input_names in pairs(args.connect) do
local input_names = input_names[1] == nil and { input_names } or input_names
-- for output in output_om:iterate() do
-- print(dump(output.properties))
-- end
if delete_links then
else
-- Iterate through all the output ports with the correct channel name
for output in output_om:iterate({ Constraint({ "audio.channel", "equals", output_name }) }) do
for _i, input_name in pairs(input_names) do
-- Iterate through all the input ports with the correct channel name
-- print("inp name", input_name)
-- print("output", dump(output.properties))
-- for input in input_om:iterate() do
-- print("hi")
-- -- print(dump(input.properties))
-- end
for input in input_om:iterate({ Constraint({ "audio.channel", "equals", input_name }) }) do
-- print("here2")
-- Link all the nodes
local link = link_port(output, input)
-- print("linked")
if link then
table.insert(links, link)
end
end
end
end
end
end
end
output_om:connect("object-added", _connect)
input_om:connect("object-added", _connect)
all_links:connect("object-added", _connect)
output_om:activate()
input_om:activate()
all_links:activate()
if unless then
unless:connect("object-added", _connect)
unless:connect("object-removed", _connect)
unless:activate()
end
print("dun")
end
-- Auto connect the stereo null sink to bluetooth headphones
auto_connect_ports({
input = Constraint({
"port.alias",
"matches",
"Scarlett Solo USB:playback_*",
}),
output = Constraint({ "port.alias", "matches", "ALC1220 Analog:capture_*" }),
connect = {
["FL"] = { "FL" },
["FR"] = { "FR" },
},
})

View file

@ -13,7 +13,6 @@ in {
};
config = mkIf cfg.enable {
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
@ -21,19 +20,102 @@ in {
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
wireplumber.enable = true;
jack.enable = true;
extraConfig.pipewire.adjust-sample-rate = {
"context.properties" = {
"default.clock.rate" = 44100;
"default.allowed-rates" = [44100];
};
};
# extraConfig.pipewire.adjust-sample-rate = {
# "context.properties" = {
# "default.clock.rate" = 41000;
# "default.clock.allowed-rates" = [44100];
# };
# };
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
wireplumber.enable = true;
# wireplumber.extraConfig = {
# "custom" = {
# "monitor.alsa.rules" = [
# {
# matches = [
# {
# "node.name" = "alsa_output.usb-Focusrite_Scarlett_Solo_USB_Y76P5M4160A866-00.HiFi__Line1__sink";
# }
# ];
# actions = {
# update-props = {
# "audio.format" = "S32LE";
# "audio.rate" = 192000;
# "api.alsa.period-size" = 1024;
# };
# };
# }
# {
# matches = [
# {
# "node.name" = "alsa_input.pci-0000_0d_00.4.analog-stereo";
# }
# ];
# actions = {
# update-props = {
# "audio.format" = "S32LE";
# "audio.rate" = 192000;
# "api.alsa.period-size" = 1024;
# };
# };
# }
# {
# matches = [
# {
# "node.name" = "~alsa_output.*";
# }
# ];
# actions = {
# update-props = {
# "api.alsa.period-size" = 1024;
# "api.alsa.headroom" = 8192;
# };
# };
# }
# ];
# };
#
# "99-connect-tt" = {
# "wireplumber.components" = [
# {
# name = "auto-connect-tt.lua";
# type = "script/lua";
# provides = "custom.connect-tt";
# }
# ];
#
# "wireplumber.profiles" = {
# main = {
# "custom.connect-tt" = "required";
# };
# };
# };
# };
# wireplumber.extraScripts = {
# "auto-connect-tt.lua" = builtins.readFile ./auto-connect-tt.lua;
# };
# };
#
# # PulseAudio compatibility layer configuration for 44.1kHz
# services.pipewire.extraConfig.pipewire-pulse."92-steam-config" = {
# context.modules = [
# {
# name = "libpipewire-module-protocol-pulse";
# args = {
# pulse.min.req = "32/44100";
# pulse.default.req = "32/44100";
# pulse.min.quantum = "32/44100";
# pulse.max.quantum = "8192/44100";
# };
# }
# ];
# };
#
# environment.sessionVariables = {
# PIPEWIRE_LATENCY = "1024/44100";
};
};
}

View file

@ -0,0 +1,28 @@
-- Dump all Wireplumber links
function dump(o)
if type(o) == "table" then
local s = "{ "
for k, v in pairs(o) do
if type(k) ~= "number" then
k = '"' .. k .. '"'
end
s = s .. "[" .. k .. "] = " .. dump(v) .. ",\n"
end
return s .. "} "
else
return tostring(o)
end
end
local link_om = ObjectManager({
Interest({
type = "link",
}),
})
link_om:connect("object-added", function(om, link)
print(dump(link.properties) .. "\n\n")
end)
link_om:activate()

View file

@ -0,0 +1,28 @@
-- Dump all Wireplumber ports
function dump(o)
if type(o) == "table" then
local s = "{ "
for k, v in pairs(o) do
if type(k) ~= "number" then
k = '"' .. k .. '"'
end
s = s .. "[" .. k .. "] = " .. dump(v) .. ",\n"
end
return s .. "} "
else
return tostring(o)
end
end
local port_om = ObjectManager({
Interest({
type = "port",
}),
})
port_om:connect("object-added", function(om, port)
print(dump(port.properties) .. "\n\n")
end)
port_om:activate()

View file

@ -0,0 +1,104 @@
# yoinked from https://gitlab.com/funaali/dotfiles/-/blob/3c74966cc4501c548aac0ee83cf5982510dd615c/modules/nixos/custom-opts.nix#L50, thanks!
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.hardware.march;
in {
options.hardware.march = with types; {
arch = mkOption {
type = types.nullOr types.str;
default = null;
description = "GCC -march=";
};
system = mkOption {
type = types.str;
default = "x86_64-linux";
};
enableNativeOptimizations = mkOption {
type = types.bool;
default = false;
description = "Enable -march=<arch> optimizations for all packages";
};
enableNativeOptimizationsByDefault = mkOption {
type = types.listOf types.str;
default = [];
description = ''
Architectures for which native optimizations are enabled by default.
'';
};
TCPBBRCongestionControl = mkEnableOption "TCP BBR congestion control";
cpu.vcores = mkOption {
type = types.int;
default = 0;
description = "Teh number of virtual CPU cores. Used to calculate heuristics.";
};
memory.total = mkOption {
type = types.int;
default = 0;
description = "Total amount of RAM in the system (gigabytes). Used to calculate heuristics.";
};
};
config = mkMerge [
# Enable nix to build for the system arch and its inferiors.
(mkIf (cfg.arch != null) {
# taken from https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/config/nix.nix
nix.settings.system-features = map (x: "gccarch-${x}") ((systems.architectures.inferiors.${cfg.arch} or []) ++ [cfg.arch]) ++ ["big-parallel"];
})
# Set nix cores and max jobs based on cores and installed memory.
(mkIf (cfg.cpu.vcores + cfg.memory.total > 0) (
let
minMemoryPerCore = 2;
jobsOvercommitFactor = 4;
cores = min 16 (min (cfg.cpu.vcores / 2) (cfg.memory.total / minMemoryPerCore));
max-jobs = jobsOvercommitFactor * cfg.memory.total / (cores * minMemoryPerCore);
in {
nix.settings = {
inherit cores max-jobs;
};
}
))
# Native arch optimizations
(mkIf (cfg.enableNativeOptimizations || elem cfg.arch cfg.enableNativeOptimizationsByDefault) {
assertions = [
{
message = "custom.arch can't be null when custom.enableNativeOptimizations is true!";
assertion = cfg.enableNativeOptimizations -> cfg.arch != null;
}
];
nixpkgs.hostPlatform = mkOverride 1 {
system = cfg.system;
gcc.arch = cfg.arch;
gcc.tune = cfg.arch;
};
})
# Enable TCP BBR congestion control
(mkIf cfg.TCPBBRCongestionControl {
boot.kernelModules = ["tcp_bbr"];
boot.kernel.sysctl = {
"net.core.default_qdisc" = "cake";
"net.ipv4.tcp_congestion_control" = "bbr";
};
})
# Settings if total memory is defined
(mkIf (cfg.memory.total > 0) {
services.earlyoom.freeMemThreshold = min 1 (max 5 (200 / cfg.memory.total));
})
];
}

View file

@ -48,7 +48,7 @@ in {
kmod
systemd
ripgrep
mullvad
nixos-stable.mullvad
killall
sd
];

View file

@ -37,11 +37,11 @@ in {
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
nvidiaSettings = false;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;

View file

@ -35,7 +35,20 @@ in {
services.xserver.displayManager.gdm.enable = true;
programs.uwsm.enable = true;
programs.uwsm = {
enable = true;
# waylandCompositors = {
# "mwc" = {
# prettyName = "MWC";
# binPath = "/run/current-system/sw/bin/mwc";
# comment = "previously owl";
# };
# };
};
# environment.systemPackages = [
# pkgs.custom.mwc
# ];
programs.hyprland = {
withUWSM = true;

View file

@ -0,0 +1,87 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.mail;
sec = config.age.secrets;
in {
options.services.mail = with types; {
enable = mkBoolOpt false "Enable Simple Nixos Mailserver";
};
config = mkIf cfg.enable {
age.secrets = {
webmaster-pw = {
file = ./sec/webmaster-pw.age;
};
zoeycomputer-pw = {
file = ./sec/zoey-zoeycomputer-pw.age;
};
zmio-pw = {
file = ./sec/zmio-pw.age;
};
zach-pw.file = ./sec/zach-pw.age;
emily-pw.file = ./sec/emily-piccat.age;
};
mailserver = {
enable = true;
fqdn = "mail.zoeys.email";
domains = ["zoeys.email" "zoeys.cloud" "zoeys.computer" "zackmyers.io" "zacharymyers.com" "pictureofcat.com"];
loginAccounts = {
"zoey@zoeys.email" = {
hashedPasswordFile = sec.webmaster-pw.path;
aliases = ["zoey@zoeys.cloud" "postmaster@zoeys.email" "abuse@zoeys.email"];
};
"hi@zoeys.computer" = {
hashedPasswordFile = sec.zoeycomputer-pw.path;
aliases = ["spam@zoeys.computer"];
};
"me@zackmyers.io" = {
hashedPasswordFile = sec.zmio-pw.path;
aliases = ["zach@zacharymyers.com" "zack@zacharymyers.com"];
};
"gf@zackmyers.io" = {
hashedPasswordFile = sec.emily-pw.path;
aliases = ["emily@pictureofcat.com"];
};
};
certificateScheme = "acme-nginx";
virusScanning = true;
};
# services.nginx = {
# virtualHosts = {
# "cal.zoeys.cloud" = {
# forceSSL = true;
# enableACME = true;
# locations."/" = {
# proxyPass = "http://localhost:5232/";
# extraConfig = ''
# proxy_set_header X-Script-Name /;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass_header Authorization;
# '';
# };
# };
# };
# };
services.roundcube = {
enable = true;
hostName = "zoeys.email";
extraConfig = ''
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
'';
};
};
}

View file

@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 CtmR6w GByJvx+LFQ6yzgAl/liuJjfzjkwZMHC+R+aKNfKNAmY
S5csNYDpwtHvIWe5W0lEiKbVnR2FcOtRU5WQW2cALAA
-> ssh-ed25519 +be3hg 68FeHprHjQxUbxJj0ERz6HOM338g12EU/BmLCDjtz3Y
ydJ94RUuxLwuk0BedBk816wLMWjgOQd3/Eb7msud3mA
--- pM8bV+881Kh2Rpizrmaa/JzzvNXtKRTRU1KyFw9qtaQ
:Ã쀬ÿxÕþ,ʅ梞ÔYk0+1ÂZÏOIq@ÛY”¼Ô¡Ö±2T³Jũޤ*Í ýù!%¹…cüýcšò<C5A1>Yq<RÕF ²ù±^Ú+éf Ý

View file

@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 CtmR6w s2FYa/CFw32d95iUrKgwFbvMtNe+17vDYLzCRJaBumA
YgQyjn/bkEN6bH7VSlrN4xT/epITxj8NnPsalOz4ndU
-> ssh-ed25519 +be3hg BkNhJbmWJHREV54OnrDzA7ep8h2ZzVtzh+Ns6Es1jQ4
eepXxHwYgVZN56nuCisQuy+PHRjz+/NrJfVdqaAAMRE
--- wyDX4yv5LbYhCvxIiK+wzndFlBs5AdV/FgNC+MRHAO8
<EFBFBD>wVX=ó|¹éì @ß3ŒÜrÇ™sWl&ón»
¿Ù¿4“T&ÁÅJ"<Ë;רGYò-Dp@1Á<31>Î@ò»º_š9µÎ‡³ÌUû×™™ )•üb"

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,168 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.services.polaris2;
settingsFormat = pkgs.formats.toml {};
in {
options = {
services.polaris2 = {
enable = lib.mkEnableOption "Polaris Music Server";
package = lib.mkPackageOption pkgs "polaris" {};
user = lib.mkOption {
type = lib.types.str;
default = "polaris";
description = "User account under which Polaris runs.";
};
group = lib.mkOption {
type = lib.types.str;
default = "polaris";
description = "Group under which Polaris is run.";
};
extraGroups = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "Polaris' auxiliary groups.";
example = lib.literalExpression ''["media" "music"]'';
};
port = lib.mkOption {
type = lib.types.port;
default = 5050;
description = ''
The port which the Polaris REST api and web UI should listen to.
Note: polaris is hardcoded to listen to the hostname "0.0.0.0".
'';
};
settings = lib.mkOption {
type = settingsFormat.type;
default = {};
description = ''
Contents for the TOML Polaris config, applied each start.
Although poorly documented, an example may be found here:
[CONFIGURATION.md](https://github.com/agersant/polaris/blob/46aed8096ee9d8702b5a98e6f3b1ff5db2bfc32a/docs/CONFIGURATION.md#format)
[test-config.toml](https://github.com/agersant/polaris/blob/46aed8096ee9d8702b5a98e6f3b1ff5db2bfc32a/test-data/config.toml)
'';
example = lib.literalExpression ''
{
settings.reindex_every_n_seconds = 7*24*60*60; # weekly, default is 1800
settings.album_art_pattern =
"(cover|front|folder)\.(jpeg|jpg|png|bmp|gif)";
mount_dirs = [
{
name = "NAS";
source = "/mnt/nas/music";
}
{
name = "Local";
source = "/home/my_user/Music";
}
];
}
'';
};
openFirewall = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Open the configured port in the firewall.
'';
};
};
};
config = lib.mkIf cfg.enable {
systemd.services.polaris = {
description = "Polaris Music Server";
after = ["network.target"];
wantedBy = ["multi-user.target"];
serviceConfig = rec {
User = cfg.user;
Group = cfg.group;
DynamicUser = true;
SupplementaryGroups = cfg.extraGroups;
StateDirectory = "polaris";
CacheDirectory = "polaris";
ExecStart = lib.escapeShellArgs (
[
"${cfg.package}/bin/polaris"
"--foreground"
"--port"
cfg.port
"--database"
"/var/lib/${StateDirectory}/db.sqlite"
"--data"
"/var/lib/${StateDirectory}/data"
"--cache"
"/var/cache/${CacheDirectory}"
]
++ lib.optionals (cfg.settings != {}) [
"--config"
(settingsFormat.generate "polaris-config.toml" cfg.settings)
]
);
Restart = "on-failure";
# Security options:
#NoNewPrivileges = true; # implied by DynamicUser
#RemoveIPC = true; # implied by DynamicUser
AmbientCapabilities = "";
CapabilityBoundingSet = "";
DeviceAllow = "";
LockPersonality = true;
#PrivateTmp = true; # implied by DynamicUser
PrivateDevices = true;
PrivateUsers = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
RestrictNamespaces = true;
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
"AF_UNIX"
];
RestrictRealtime = true;
#RestrictSUIDSGID = true; # implied by DynamicUser
SystemCallArchitectures = "native";
SystemCallErrorNumber = "EPERM";
SystemCallFilter = [
"@system-service"
"~@cpu-emulation"
"~@debug"
"~@keyring"
"~@memlock"
"~@obsolete"
"~@privileged"
"~@setuid"
];
};
};
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [cfg.port];
};
};
meta.maintainers = with lib.maintainers; [pbsds];
}

View file

@ -15,7 +15,29 @@ in {
};
config = mkIf cfg.enable {
services.mullvad-vpn.enable = cfg.mullvad;
services.mullvad-vpn = {
enable = cfg.mullvad;
package = nixos-stable.mullvad;
};
#
# # Create a specific network namespace for VPN traffic
# systemd.services.mullvad-daemon = {
# serviceConfig = {
# NetworkNamespacePath = "/run/netns/mullvad";
# };
# };
#
# # Configure transmission to use Mullvad's SOCKS5 proxy
# # Configure transmission to use the Mullvad network namespace
# systemd.services.transmission = mkIf config.services.transmission.enable {
# serviceConfig = {
# NetworkNamespacePath = "/run/netns/mullvad";
# };
# # Make sure Mullvad is running before transmission starts
# requires = ["mullvad-daemon.service"];
# after = ["mullvad-daemon.service"];
# };
services.openvpn = {
servers = {
work = {
@ -27,14 +49,21 @@ in {
systemd.services.openvpn-work.wantedBy = lib.mkForce [];
systemd.services."mullvad-daemon".postStart = let
mullvad = config.services.mullvad-vpn.package;
in
mkIf cfg.mullvad ''
while ! ${mullvad}/bin/mullvad status >/dev/null; do sleep 1; done
${mullvad}/bin/mullvad auto-connect set on
${mullvad}/bin/mullvad tunnel set ipv6 on
${mullvad}/bin/mullvad connect
'';
# # Add necessary networking tools
# environment.systemPackages = with pkgs; [
# iproute2 # for ip netns commands
# ];
#
# # Setup network namespace
# systemd.services.setup-mullvad-netns = {
# description = "Setup Mullvad Network Namespace";
# before = ["mullvad-daemon.service"];
# serviceConfig = {
# Type = "oneshot";
# RemainAfterExit = true;
# ExecStart = "${pkgs.iproute2}/bin/ip netns add mullvad";
# ExecStop = "${pkgs.iproute2}/bin/ip netns delete mullvad";
# };
# };
};
}

View file

@ -26,12 +26,22 @@ in {
recommendedOptimisation = true;
recommendedTlsSettings = true;
sslDhparam = config.security.dhparams.params.nginx.path;
virtualHosts = {
"node.nyc.zackmyers.io" = {
forceSSL = true;
enableACME = true;
};
};
appendHttpConfig = ''
limit_req_zone $binary_remote_addr zone=iso_ratelimit:10m rate=1r/m;
limit_conn_zone $binary_remote_addr zone=iso_connlimit:10m;
access_log /var/log/nginx/blocked.log combined if=$ratelimited;
map $request_uri $ratelimited {
default 0;
~\.iso$ $limit_req_status;
}
'';
};
security.acme = {
acceptTerms = true;
defaults.email = "zach@zacharymyers.com";
};
};
}

View file

@ -0,0 +1,60 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.wg;
in {
options.services.wg = with types; {
enable = mkBoolOpt false "Enable wg service(s)";
};
config = mkIf cfg.enable {
networking.nat.enable = false;
networking.nat.externalInterface = "enp5s0";
networking.nat.internalInterfaces = ["wg0"];
networking.firewall = {
allowedUDPPorts = [51820];
extraCommands = ''
# Allow WireGuard peer to access only Jellyfin
${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -s 10.100.0.2 -d 192.168.1.83 -j ACCEPT
${pkgs.iptables}/bin/iptables -A FORWARD -i wg0 -s 10.100.0.3 -d 192.168.1.83 -j ACCEPT
'';
extraStopCommands = ''
# Clean up rules when stopping
${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -s 10.100.0.2 -d 192.168.1.83 -j ACCEPT
${pkgs.iptables}/bin/iptables -D FORWARD -i wg0 -s 10.100.0.3 -d 192.168.1.83 -j ACCEPT
'';
};
networking.wireguard.interfaces = {
wg0 = {
ips = ["10.100.0.1/24"];
listenPort = 51820;
privateKeyFile = "/home/zoey/wg-keys/private";
peers = [
# List of allowed peers.
{
# Feel free to give a meaning full name
# Public key of the peer (not a file path).
publicKey = "oxcliwRzjiYda7x90lv71R/PnnPxIWSVIjSjiv2DyBQ=";
# List of IPs assigned to this peer within the tunnel subnet. Used to configure routing.
allowedIPs = ["10.100.0.2/32" "192.168.1.83/32"];
}
{
publicKey = "+lWaMyRJOmijb3pSe8iufFO3lw2VW62uCn/ckJyAUxk=";
allowedIPs = ["10.100.0.3/32" "192.168.1.83/32"];
}
];
};
};
};
}

View file

@ -27,7 +27,7 @@ in {
root = "${inputs.resume.packages.${pkgs.system}.default}";
};
extraConfig = ''
index resume.pdf;
index ZacharyMyersResume.pdf;
'';
};
};

View file

@ -75,7 +75,7 @@ in {
mkdir -p -m 0755 /nix/var/nix/profiles/per-user/root
mkdir -p -m 0700 "$HOME/.nix-defexpr"
. ${pkgs.nix}/etc/profile.d/nix-daemon.sh
${pkgs.nix}/bin/nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs # 3
${pkgs.nix}/bin/nix-channel --add https://nixos.org/channels/nixos-24.11 nixpkgs # 3
${pkgs.nix}/bin/nix-channel --update nixpkgs
${pkgs.nix}/bin/nix-env -i ${concatStringsSep " " (with pkgs; [nix cacert git openssh])}
'';

View file

@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 CtmR6w UnmasP/1wPHR+LhLwOPU8n8xmYxzSxnz3zvnIxhKngY
bHwSyrccC/4a4X1nCSVR+Vl+Oi7Y1Sd5IzZjXVmkG5s
-> ssh-ed25519 RMNffg 5EgurJJqitwKtwze+WrcNmfFolK29aW0nqLyRFShamY
YsNxchVifSo+rBnhKsGYkVCxkHGmRH0FwnpLVjHYMH8
--- 0RY2Pmkw1TKwh8hCJ55R/6IYHWZAXrKra+y82GsJWNk
®<>MÑPpÿVš9Ýc¥ÅP<Õ¨´8m<5<>{ˆÊ8ïCê^+[S”-²ªÞ^%,­ò—˜0KÛ΀çºFDOµ NbY†ts@¬ó™5§ÓE­&Us¸P7È5å]ÇmPd˜h<CB9C>„ä¿ÎŽCz

View file

@ -0,0 +1,35 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.sites.immich;
in {
options.sites.immich = with types; {
enable = mkBoolOpt false "Enable Immich Photo backup";
};
config = mkIf cfg.enable {
services.immich.enable = true;
services.immich.port = 2283;
services.nginx.virtualHosts."i.zoeys.photos" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://[::1]:${toString config.services.immich.port}";
proxyWebsockets = true;
recommendedProxySettings = true;
extraConfig = ''
client_max_body_size 50000M;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
send_timeout 600s;
'';
};
};
};
}

View file

@ -16,6 +16,22 @@ in {
services.jellyfin = {
enable = true;
openFirewall = true;
user = "zoey";
group = "users";
};
virtualisation.oci-containers = {
containers.jellyfin-vue = {
image = "ghcr.io/jellyfin/jellyfin-vue:unstable";
environment = {
"PUBLIC_JELLYFIN_API" = "http://localhost:8096";
};
ports = [
"8065:80"
];
};
};
networking.firewall.allowedTCPPorts = [8065];
};
}

View file

@ -0,0 +1,22 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.sites.mealie;
in {
options.sites.mealie = with types; {
enable = mkBoolOpt false "Enable mealie";
};
config = mkIf cfg.enable {
services.mealie = {
enable = true;
port = 9090;
listenAddress = "127.0.0.1";
};
};
}

View file

@ -38,6 +38,7 @@ in {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 1G;
'';
};
};

View file

@ -39,6 +39,18 @@ in {
locations."/".extraConfig = ''
autoindex on;
'';
locations."~* \.iso$".extraConfig = ''
limit_req zone=iso_ratelimit burst=20 nodelay;
limit_conn iso_connlimit 5;
limit_rate_after 10m;
limit_rate 500k;
if ($http_user_agent ~* "Transmission") {
access_log /var/log/nginx/blocked_transmission.log combined;
return 403;
}
'';
};
};
}

View file

@ -0,0 +1,131 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.sites.polaris;
polaris-web = pkgs.buildNpmPackage rec {
pname = "polaris-web";
version = "76";
src = pkgs.fetchFromGitHub {
owner = "agersant";
repo = "polaris-web";
rev = "build-${version}";
hash = "sha256-mGsgW6lRqCt+K2RrF2s4zhvYzH94K+GEXGUCn5ngBTY=";
};
npmDepsHash = "sha256-MVqC6mMdiqtJzAB8J8xdxO5xCwiibBasA3BvN6EiBSM=";
env.CYPRESS_INSTALL_BINARY = "0";
npmBuildScript = "build";
installPhase = ''
runHook preInstall
mkdir -p $out/share
cp -a dist $out/share/polaris-web
runHook postInstall
'';
};
polaris = pkgs.rustPlatform.buildRustPackage rec {
pname = "polaris";
version = "0.15.0";
src = pkgs.fetchFromGitHub {
owner = "agersant";
repo = "polaris";
tag = version;
hash = "sha256-uwYNyco4IY6lF+QSVEOVVhZCJ4nRkj8gsgRA0UydLHU=";
# The polaris version upstream in Cargo.lock is "0.0.0".
# We're unable to simply patch it in the patch phase due to
# rustPlatform.buildRustPackage fetching dependencies before applying patches.
# If we patch it after fetching dependencies we get an error when
# validating consistency between the final build and the prefetched deps.
postFetch = ''
# 'substituteInPlace' does not support multiline replacements?
sed -i $out/Cargo.lock -z \
-e 's/\[\[package\]\]\nname = "polaris"\nversion = "0.0.0"/[[package]]\nname = "polaris"\nversion = "'"${version}"'"/g'
'';
};
useFetchCargoVendor = true;
cargoHash = "sha256-EUUxKLLdXgNp7GWTWAkzdNHKogu4Voo8wjeFFzM9iEg=";
# Compile-time environment variables for where to find assets needed at runtime
env = {
POLARIS_WEB_DIR = "${polaris-web}/share/polaris-web";
};
preCheck = ''
# 'Err' value: Os { code: 24, kind: Uncategorized, message: "Too many open files" }
ulimit -n 4096
# to debug bumps
export RUST_BACKTRACE=1
'';
checkFlags = [
# requires network
"--skip=server::test::settings::put_settings_golden_path"
];
__darwinAllowLocalNetworking = true;
doCheck = false;
meta = with lib; {
description = "Self-host your music collection, and access it from any computer and mobile device";
longDescription = ''
Polaris is a FOSS music streaming application, designed to let you enjoy your music collection
from any computer or mobile device. Polaris works by streaming your music directly from your
own computer, without uploading it to a third-party. There are no kind of premium version.
The only requirement is that your computer stays on while it streams your music!
'';
homepage = "https://github.com/agersant/polaris";
license = licenses.mit;
maintainers = with maintainers; [pbsds];
platforms = platforms.unix;
mainProgram = "polaris";
};
};
in {
options.sites.polaris = with types; {
enable = mkBoolOpt false "Enable Music (Polaris)";
domain = mkStringOpt "music.zoeys.cloud" "The domain of the music instance";
};
config = mkIf cfg.enable {
services.polaris2 = {
enable = true;
package = polaris;
# group = "users";
# user = "zoey";
openFirewall = true;
settings = {
mount_dirs = [
{
name = "local";
source = "/home/zoey/Music/";
}
];
};
};
services.nginx.virtualHosts.${cfg.domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.polaris.port}";
};
};
};
}

View file

@ -31,53 +31,7 @@ in {
dejavu_fonts
iosevka
cantarell-fonts
# (let
# bolder = writeText "bolder.py" ''
# #!/usr/bin/env python
# # Script shamelessly stolen from: https://github.com/shytikov/pragmasevka
#
# import sys
# import fontforge
#
# if len(sys.argv) < 2:
# print("Please provide path prefix of the font to update!")
# exit()
#
# prefix = sys.argv[1]
#
# glyphs = [
# "exclam", "ampersand", "parenleft", "parenright", "asterisk", "plus",
# "comma", "hyphen", "period", "slash", "colon", "semicolon", "less",
# "equal", "greater", "question", "bracketleft", "backslash", "bracketright",
# "asciicircum", "braceleft", "bar", "braceright", "asciitilde",
# ]
#
# pairs = [
# ['regular', 'semibold'],
# ['regularItalic', 'semiboldItalic'],
# ['bold', 'black'],
# ['boldItalic', 'blackItalic'],
# ]
#
# for [recipient, donor] in pairs:
# font = f"{prefix}{recipient}.ttf"
# donor_font = f"{prefix}{donor}.ttf"
#
# target = fontforge.open(font)
# # Finding all punctuation
# target.selection.select(*glyphs)
# # and deleting it to make space
# for i in target.selection.byGlyphs:
# target.removeGlyph(i)
#
# source = fontforge.open(donor_font)
# source.selection.select(*glyphs)
# source.copy()
# target.paste()
#
# target.generate(font)
# '';
# in (iosevka.override
# (iosevka.override
# {
# set = "Custom";
# privateBuildPlan = ''
@ -90,34 +44,20 @@ in {
#
# [buildPlans.IosevkaCustom.variants]
# inherits = "ss08"
#
# [buildPlans.IosevkaCustom.widths.Normal]
# shape = 500
# menu = 5
# css = "normal"
# '';
# }))
# .overrideAttrs (oldAttrs: {
# buildInputs =
# (oldAttrs.buildInputs or [])
# ++ [
# pkgs.python3
# pkgs.python3Packages.fontforge
# ];
#
# postInstall = ''
# ${oldAttrs.postInstall or ""}
#
# echo $out
#
# cd $out/share/fonts/truetype
#
# PREFIX="IosevkaCustom-normal"
#
# python3 ${bolder} $PREFIX
# '';
# }))
# })
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
jetbrains-mono
nerd-fonts.iosevka
nerd-fonts.zed-mono
adwaita-fonts
# (nerdfonts.override {fonts = ["ZedMono" "Iosevka"];})
];
@ -127,11 +67,11 @@ in {
fontconfig = {
defaultFonts = {
monospace = [
"Pragmata Pro Mono"
# "Iosevka"
# "Pragmata Pro Mono"
"Iosevka"
"Noto Color Emoji"
];
sansSerif = ["Cantarell" "Noto Color Emoji"];
sansSerif = ["Adwaita Sans" "Noto Color Emoji"];
serif = ["Noto Serif" "Noto Color Emoji"];
emoji = ["Noto Color Emoji"];
};