From 4aa9f5a464cdae597c1d99c4ba409e898cb41f1a Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 20 Jan 2025 22:35:40 -0500 Subject: [PATCH] initial refactoring --- modules/common/applications/1password.nix | 41 --- modules/common/applications/alacritty.nix | 107 ------- modules/common/applications/discord.nix | 34 --- modules/common/applications/firefox.nix | 203 ------------- modules/common/applications/kitty.nix | 118 -------- modules/common/applications/media.nix | 67 ---- modules/common/applications/obsidian.nix | 28 -- modules/common/applications/qbittorrent.nix | 25 -- modules/common/applications/slack.nix | 26 -- modules/common/applications/wezterm.nix | 286 ------------------ modules/common/applications/yt-dlp.nix | 38 --- modules/common/mail/aerc.nix | 220 -------------- modules/common/mail/default.nix | 139 --------- modules/common/mail/himalaya.nix | 26 -- modules/common/mail/system.nix | 35 --- modules/common/shell/atuin.nix | 39 --- modules/common/shell/direnv.nix | 36 --- modules/common/shell/git.nix | 195 ------------ modules/common/shell/jujutsu.nix | 18 -- modules/darwin/fish.nix | 10 - modules/darwin/hammerspoon.nix | 43 --- modules/darwin/networking.nix | 17 -- modules/darwin/system.nix | 222 -------------- modules/darwin/utilities.nix | 8 - modules/nixos/applications/calendar.nix | 37 --- modules/nixos/applications/calibre.nix | 29 -- modules/nixos/applications/default.nix | 9 - modules/nixos/applications/nautilus.nix | 55 ---- modules/nixos/gaming/chiaki.nix | 14 - modules/nixos/graphical/dunst.nix | 29 -- modules/nixos/graphical/picom.nix | 57 ---- modules/nixos/graphical/polybar.nix | 235 -------------- .../nmasur/presets/programs/1password.nix | 43 +++ .../modules/nmasur/presets/programs/aerc.nix | 223 ++++++++++++++ .../nmasur/presets/programs/alacritty.nix | 100 ++++++ .../modules/nmasur/presets/programs/atuin.nix | 40 +++ .../modules/nmasur/presets/programs/bash.nix | 28 ++ .../modules/nmasur/presets/programs/bat.nix | 24 ++ .../nmasur/presets/programs/calibre.nix | 22 ++ .../nmasur/presets/programs}/default.nix | 5 +- .../nmasur/presets/programs/direnv.nix | 27 ++ .../nmasur/presets/programs/discord.nix | 28 ++ .../modules/nmasur/presets/programs/fd.nix | 20 ++ .../nmasur/presets/programs/firefox.nix | 202 +++++++++++++ .../nmasur/presets/programs/fish-darwin.nix | 25 ++ .../modules/nmasur/presets/programs/fish.nix | 152 ++++++++++ .../modules/nmasur/presets/programs}/fzf.nix | 17 +- .../modules/nmasur/presets/programs/git.nix | 188 ++++++++++++ .../nmasur/presets/programs}/github.nix | 16 +- .../nmasur/presets/programs/himalaya.nix | 33 ++ .../nmasur/presets/programs/jujutsu.nix | 27 ++ .../modules/nmasur/presets/programs/k9s.nix | 155 ++++++++++ .../modules/nmasur/presets/programs/kitty.nix | 104 +++++++ .../nmasur/presets/programs/kubectl.nix | 33 ++ .../modules/nmasur/presets/programs/mpv.nix | 35 +++ .../nmasur/presets/programs/nautilus.nix | 38 +++ .../presets/programs/nixpkgs-darwin.nix | 13 +- .../nmasur/presets/programs}/nixpkgs.nix | 19 +- .../modules/nmasur/presets/programs/noti.nix | 24 ++ .../modules/nmasur/presets/programs/nsxiv.nix | 35 +++ .../nmasur/presets/programs/prettyping.nix | 26 ++ .../nmasur/presets/programs/ripgrep.nix | 33 ++ .../nmasur/presets/programs}/starship.nix | 10 +- .../nmasur/presets/programs/weather.nix | 26 ++ .../nmasur/presets/programs/wezterm.nix | 267 ++++++++++++++++ .../nmasur/presets/programs/yt-dlp.nix | 33 ++ .../nmasur/presets/programs/zathura.nix | 36 +++ .../modules/nmasur/presets/services/dunst.nix | 37 +++ .../modules/nmasur/presets/services/msmtp.nix | 39 +++ .../modules/nmasur/presets/services/picom.nix | 61 ++++ .../nmasur/presets/services/polybar.nix | 237 +++++++++++++++ .../modules/nmasur/presets/programs/fish.nix | 26 ++ .../nmasur/presets/programs/homebrew.nix | 48 +++ .../modules/nmasur/presets/services/dock.nix | 58 ++++ .../nmasur/presets/services/finder.nix | 68 +++++ .../nmasur/presets/services/hammerspoon.nix | 49 +++ .../nmasur/presets/services/menubar.nix | 52 ++++ .../nmasur/presets/services/nix-daemon.nix | 24 ++ .../nmasur/presets/services/settings.nix | 111 +++++++ .../modules/nmasur/presets/services/user.nix | 26 ++ .../nmasur/presets/programs/calendar.nix | 33 ++ .../presets/programs}/dwarf-fortress.nix | 10 +- .../nmasur/presets/programs/nautilus.nix | 24 ++ .../nmasur/presets/programs}/steam.nix | 10 +- .../nmasur/presets/programs/template.nix | 18 ++ .../nmasur/presets/services/actualbudget.nix | 74 +++++ .../presets/services/audiobookshelf.nix | 47 +++ .../modules/nmasur/presets/services/caddy.nix | 227 ++++++++++++++ .../nmasur/presets/services/empty-trash.nix | 25 ++ 89 files changed, 3388 insertions(+), 2469 deletions(-) delete mode 100644 modules/common/applications/1password.nix delete mode 100644 modules/common/applications/alacritty.nix delete mode 100644 modules/common/applications/discord.nix delete mode 100644 modules/common/applications/firefox.nix delete mode 100644 modules/common/applications/kitty.nix delete mode 100644 modules/common/applications/media.nix delete mode 100644 modules/common/applications/obsidian.nix delete mode 100644 modules/common/applications/qbittorrent.nix delete mode 100644 modules/common/applications/slack.nix delete mode 100644 modules/common/applications/wezterm.nix delete mode 100644 modules/common/applications/yt-dlp.nix delete mode 100644 modules/common/mail/aerc.nix delete mode 100644 modules/common/mail/default.nix delete mode 100644 modules/common/mail/himalaya.nix delete mode 100644 modules/common/mail/system.nix delete mode 100644 modules/common/shell/atuin.nix delete mode 100644 modules/common/shell/direnv.nix delete mode 100644 modules/common/shell/git.nix delete mode 100644 modules/common/shell/jujutsu.nix delete mode 100644 modules/darwin/fish.nix delete mode 100644 modules/darwin/hammerspoon.nix delete mode 100644 modules/darwin/networking.nix delete mode 100644 modules/darwin/system.nix delete mode 100644 modules/nixos/applications/calendar.nix delete mode 100644 modules/nixos/applications/calibre.nix delete mode 100644 modules/nixos/applications/default.nix delete mode 100644 modules/nixos/applications/nautilus.nix delete mode 100644 modules/nixos/gaming/chiaki.nix delete mode 100644 modules/nixos/graphical/dunst.nix delete mode 100644 modules/nixos/graphical/picom.nix delete mode 100644 modules/nixos/graphical/polybar.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/1password.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/aerc.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/alacritty.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/atuin.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/bash.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/bat.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/calibre.nix rename {modules/common/applications => platforms/home-manager/modules/nmasur/presets/programs}/default.nix (75%) create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/direnv.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/discord.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/fd.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/firefox.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/fish-darwin.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/fish.nix rename {modules/common/shell => platforms/home-manager/modules/nmasur/presets/programs}/fzf.nix (84%) create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/git.nix rename {modules/common/shell => platforms/home-manager/modules/nmasur/presets/programs}/github.nix (88%) create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/himalaya.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/k9s.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/kitty.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/kubectl.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/mpv.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/nautilus.nix rename modules/darwin/nixpkgs.nix => platforms/home-manager/modules/nmasur/presets/programs/nixpkgs-darwin.nix (77%) rename {modules/common/shell => platforms/home-manager/modules/nmasur/presets/programs}/nixpkgs.nix (90%) create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/noti.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/nsxiv.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/prettyping.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/ripgrep.nix rename {modules/common/shell => platforms/home-manager/modules/nmasur/presets/programs}/starship.nix (89%) create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/weather.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/wezterm.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/yt-dlp.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/programs/zathura.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/services/dunst.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/services/msmtp.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/services/picom.nix create mode 100644 platforms/home-manager/modules/nmasur/presets/services/polybar.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/programs/fish.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/programs/homebrew.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/dock.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/finder.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/hammerspoon.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/menubar.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/nix-daemon.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/settings.nix create mode 100644 platforms/nix-darwin/modules/nmasur/presets/services/user.nix create mode 100644 platforms/nixos/modules/nmasur/presets/programs/calendar.nix rename {modules/nixos/gaming => platforms/nixos/modules/nmasur/presets/programs}/dwarf-fortress.nix (80%) create mode 100644 platforms/nixos/modules/nmasur/presets/programs/nautilus.nix rename {modules/nixos/gaming => platforms/nixos/modules/nmasur/presets/programs}/steam.nix (81%) create mode 100644 platforms/nixos/modules/nmasur/presets/programs/template.nix create mode 100644 platforms/nixos/modules/nmasur/presets/services/actualbudget.nix create mode 100644 platforms/nixos/modules/nmasur/presets/services/audiobookshelf.nix create mode 100644 platforms/nixos/modules/nmasur/presets/services/caddy.nix create mode 100644 platforms/nixos/modules/nmasur/presets/services/empty-trash.nix diff --git a/modules/common/applications/1password.nix b/modules/common/applications/1password.nix deleted file mode 100644 index fd6b2e0..0000000 --- a/modules/common/applications/1password.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - _1password = { - enable = lib.mkEnableOption { - description = "Enable 1Password."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config._1password.enable) { - unfreePackages = [ - "1password" - "_1password-gui" - "1password-cli" - ]; - home-manager.users.${config.user} = { - home.packages = [ - pkgs._1password-cli - ] ++ (if pkgs.stdenv.isLinux then [ pkgs._1password-gui ] else [ ]); - }; - - # https://1password.community/discussion/135462/firefox-extension-does-not-connect-to-linux-app - # On Mac, does not apply: https://1password.community/discussion/142794/app-and-browser-integration - # However, the button doesn't work either: - # https://1password.community/discussion/140735/extending-support-for-trusted-web-browsers - environment.etc."1password/custom_allowed_browsers".text = '' - ${ - config.home-manager.users.${config.user}.programs.firefox.package - }/Applications/Firefox.app/Contents/MacOS/firefox - firefox - ''; - }; -} diff --git a/modules/common/applications/alacritty.nix b/modules/common/applications/alacritty.nix deleted file mode 100644 index 9641f49..0000000 --- a/modules/common/applications/alacritty.nix +++ /dev/null @@ -1,107 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - alacritty = { - enable = lib.mkEnableOption { - description = "Enable Alacritty."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.alacritty.enable) { - home-manager.users.${config.user} = { - xsession.windowManager.i3.config.terminal = "alacritty"; - programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty"; - programs.alacritty = { - enable = true; - settings = { - window = { - dimensions = { - columns = 85; - lines = 30; - }; - padding = { - x = 20; - y = 20; - }; - opacity = 1.0; - }; - scrolling.history = 10000; - font = { - size = 14.0; - }; - key_bindings = [ - # Used for word completion in fish_user_key_bindings - { - key = "Return"; - mods = "Shift"; - chars = "\\x1F"; - } - # Used for searching nixpkgs in fish_user_key_bindings - { - key = "N"; - mods = "Control|Shift"; - chars = "\\x11F"; - } - { - key = "H"; - mods = "Control|Shift"; - mode = "~Vi"; - action = "ToggleViMode"; - } - { - key = "Return"; - mode = "Vi"; - action = "ToggleViMode"; - } - # Used to enable $ keybind in Vi mode - { - key = 5; # Scancode for key4 - mods = "Shift"; - mode = "Vi|~Search"; - action = "Last"; - } - ]; - colors = { - primary = { - background = config.theme.colors.base00; - foreground = config.theme.colors.base05; - }; - cursor = { - text = "#1d2021"; - cursor = config.theme.colors.base05; - }; - normal = { - black = "#1d2021"; - red = config.theme.colors.base08; - green = config.theme.colors.base0B; - yellow = config.theme.colors.base0A; - blue = config.theme.colors.base0D; - magenta = config.theme.colors.base0E; - cyan = config.theme.colors.base0C; - white = config.theme.colors.base05; - }; - bright = { - black = config.theme.colors.base03; - red = config.theme.colors.base09; - green = config.theme.colors.base01; - yellow = config.theme.colors.base02; - blue = config.theme.colors.base04; - magenta = config.theme.colors.base06; - cyan = config.theme.colors.base0F; - white = config.theme.colors.base07; - }; - }; - draw_bold_text_with_bright_colors = false; - }; - }; - }; - }; -} diff --git a/modules/common/applications/discord.nix b/modules/common/applications/discord.nix deleted file mode 100644 index d4978b6..0000000 --- a/modules/common/applications/discord.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - discord = { - enable = lib.mkEnableOption { - description = "Enable Discord."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.discord.enable) { - unfreePackages = [ "discord" ]; - environment.systemPackages = [ pkgs.discord ]; - home-manager.users.${config.user} = { - xdg.configFile."discord/settings.json".text = '' - { - "BACKGROUND_COLOR": "#202225", - "IS_MAXIMIZED": false, - "IS_MINIMIZED": false, - "OPEN_ON_STARTUP": false, - "MINIMIZE_TO_TRAY": false, - "SKIP_HOST_UPDATE": true - } - ''; - }; - }; -} diff --git a/modules/common/applications/firefox.nix b/modules/common/applications/firefox.nix deleted file mode 100644 index 0bfc4c3..0000000 --- a/modules/common/applications/firefox.nix +++ /dev/null @@ -1,203 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -{ - - options = { - firefox = { - enable = lib.mkEnableOption { - description = "Enable Firefox."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.firefox.enable) { - - unfreePackages = [ - (lib.mkIf config._1password.enable "onepassword-password-manager") - "okta-browser-plugin" - ]; - - home-manager.users.${config.user} = { - - programs.firefox = { - enable = true; - package = if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox; - profiles.default = { - id = 0; - name = "default"; - isDefault = true; - # https://nur.nix-community.org/repos/rycee/ - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - (lib.mkIf config._1password.enable onepassword-password-manager) - darkreader - don-t-fuck-with-paste - facebook-container - markdownload - multi-account-containers - okta-browser-plugin - reddit-enhancement-suite - return-youtube-dislikes - sponsorblock - ublock-origin - ublacklist - vimium - ]; - settings = { - "app.update.auto" = false; - "browser.aboutConfig.showWarning" = false; - "browser.warnOnQuit" = false; - "browser.quitShortcut.disabled" = if pkgs.stdenv.isLinux then true else false; - "browser.theme.dark-private-windows" = true; - "browser.toolbars.bookmarks.visibility" = false; - "browser.startup.page" = 3; # Restore previous session - "browser.newtabpage.enabled" = false; # Make new tabs blank - "trailhead.firstrun.didSeeAboutWelcome" = true; # Disable welcome splash - "dom.forms.autocomplete.formautofill" = false; # Disable autofill - "extensions.formautofill.creditCards.enabled" = false; # Disable credit cards - "dom.payments.defaults.saveAddress" = false; # Disable address save - "general.autoScroll" = true; # Drag middle-mouse to scroll - "services.sync.prefs.sync.general.autoScroll" = false; # Prevent disabling autoscroll - "extensions.pocket.enabled" = false; - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Allow userChrome.css - "layout.css.color-mix.enabled" = true; - "ui.systemUsesDarkTheme" = if config.theme.dark == true then 1 else 0; - "media.ffmpeg.vaapi.enabled" = true; # Enable hardware video acceleration - "cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups - "devtools.command-button-screenshot.enabled" = true; # Scrolling screenshot of entire page - "svg.context-properties.content.enabled" = true; # Sidebery styling - "browser.tabs.hoverPreview.enabled" = false; # Disable tab previews - "browser.tabs.hoverPreview.showThumbnails" = false; # Disable tab previews - }; - userChrome = '' - :root { - --focus-outline-color: ${config.theme.colors.base04} !important; - --toolbar-color: ${config.theme.colors.base07} !important; - --tab-min-height: 30px !important; - } - /* Background of tab bar */ - .toolbar-items { - background-color: ${config.theme.colors.base00} !important; - } - /* Extra tab bar sides on macOS */ - .titlebar-spacer { - background-color: ${config.theme.colors.base00} !important; - } - .titlebar-buttonbox-container { - background-color: ${config.theme.colors.base00} !important; - } - #tabbrowser-tabs { - border-inline-start: 0 !important; - } - /* Private Browsing indicator on macOS */ - #private-browsing-indicator-with-label { - background-color: ${config.theme.colors.base00} !important; - margin-inline: 0 !important; - padding-inline: 7px; - } - /* Tabs themselves */ - .tabbrowser-tab .tab-stack { - border-radius: 5px 5px 0 0; - overflow: hidden; - background-color: ${config.theme.colors.base00}; - color: ${config.theme.colors.base06} !important; - } - .tab-content { - border-bottom: 2px solid color-mix(in srgb, var(--identity-tab-color) 40%, transparent); - border-radius: 5px 5px 0 0; - background-color: ${config.theme.colors.base00}; - color: ${config.theme.colors.base06} !important; - } - .tab-content[selected] { - border-bottom: 2px solid color-mix(in srgb, var(--identity-tab-color) 25%, transparent); - background-color: ${config.theme.colors.base01} !important; - color: ${config.theme.colors.base07} !important; - } - /* Below tab bar */ - #nav-bar { - background: ${config.theme.colors.base01} !important; - } - /* URL bar in nav bar */ - #urlbar[focused=true] { - color: ${config.theme.colors.base07} !important; - background: ${config.theme.colors.base02} !important; - caret-color: ${config.theme.colors.base05} !important; - } - #urlbar:not([focused=true]) { - color: ${config.theme.colors.base04} !important; - background: ${config.theme.colors.base02} !important; - } - #urlbar ::-moz-selection { - color: ${config.theme.colors.base07} !important; - background: ${config.theme.colors.base02} !important; - } - #urlbar-input-container { - border: 1px solid ${config.theme.colors.base01} !important; - } - #urlbar-background { - background: ${config.theme.colors.base01} !important; - } - /* Text in URL bar */ - #urlbar-input, #urlbar-scheme, .searchbar-textbox { - color: ${config.theme.colors.base07} !important; - } - ''; - userContent = '' - @-moz-document url-prefix(about:blank) { - * { - background-color:${config.theme.colors.base01} !important; - } - } - ''; - - extraConfig = ""; - }; - }; - - # Mimic nixpkgs package environment for read-only profiles.ini management - # From: https://github.com/booxter/home-manager/commit/dd1602e306fec366280f5953c5e1b553e3d9672a - home.sessionVariables = { - MOZ_LEGACY_PROFILES = 1; - MOZ_ALLOW_DOWNGRADE = 1; - }; - - # launchd.user.envVariables = config.home-manager.users.${config.user}.home.sessionVariables; - - xdg.mimeApps = { - associations.added = { - "text/html" = [ "firefox.desktop" ]; - }; - defaultApplications = { - "text/html" = [ "firefox.desktop" ]; - }; - associations.removed = { - "text/html" = [ "wine-extension-htm.desktop" ]; - }; - - }; - - xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux { - "${ - config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier - }+Shift+b" = "exec ${ - # Don't name the script `firefox` or it will affect grep - builtins.toString ( - pkgs.writeShellScript "focus-ff.sh" '' - count=$(ps aux | grep -c firefox) - if [ "$count" -eq 1 ]; then - i3-msg "exec --no-startup-id firefox" - sleep 0.5 - fi - i3-msg "[class=firefox] focus" - '' - ) - }"; - }; - }; - }; -} diff --git a/modules/common/applications/kitty.nix b/modules/common/applications/kitty.nix deleted file mode 100644 index bca9503..0000000 --- a/modules/common/applications/kitty.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - kitty = { - enable = lib.mkEnableOption { - description = "Enable Kitty."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.kitty.enable) { - - # Set the Rofi-Systemd terminal for viewing logs - # Using optionalAttrs because only available in NixOS - environment = - { } - // lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) { - sessionVariables.ROFI_SYSTEMD_TERM = lib.mkDefault "${pkgs.kitty}/bin/kitty"; - }; - - home-manager.users.${config.user} = { - - # Set the i3 terminal - xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty"; - - # Set the Rofi terminal for running programs - programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux (lib.mkDefault "${pkgs.kitty}/bin/kitty"); - - # Display images in the terminal - programs.fish.interactiveShellInit = # fish - '' - if test "$TERM" = "xterm-kitty" - alias icat="kitty +kitten icat" - alias ssh="kitty +kitten ssh" - end - ''; - - programs.kitty = { - enable = true; - environment = { }; - extraConfig = ""; - font.size = 14; - keybindings = { - # Use shift+enter to complete text suggestions in fish - "shift+enter" = "send_text all \\x1F"; - - # Easy fullscreen toggle (for macOS) - "super+f" = "toggle_fullscreen"; - }; - settings = { - - # Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache) - background = config.theme.colors.base00; - foreground = config.theme.colors.base05; - selection_background = config.theme.colors.base05; - selection_foreground = config.theme.colors.base00; - url_color = config.theme.colors.base04; - cursor = config.theme.colors.base05; - active_border_color = config.theme.colors.base03; - inactive_border_color = config.theme.colors.base01; - active_tab_background = config.theme.colors.base00; - active_tab_foreground = config.theme.colors.base05; - inactive_tab_background = config.theme.colors.base01; - inactive_tab_foreground = config.theme.colors.base04; - tab_bar_background = config.theme.colors.base01; - - # normal - color0 = config.theme.colors.base00; - color1 = config.theme.colors.base08; - color2 = config.theme.colors.base0B; - color3 = config.theme.colors.base0A; - color4 = config.theme.colors.base0D; - color5 = config.theme.colors.base0E; - color6 = config.theme.colors.base0C; - color7 = config.theme.colors.base05; - - # bright - color8 = config.theme.colors.base03; - color9 = config.theme.colors.base08; - color10 = config.theme.colors.base0B; - color11 = config.theme.colors.base0A; - color12 = config.theme.colors.base0D; - color13 = config.theme.colors.base0E; - color14 = config.theme.colors.base0C; - color15 = config.theme.colors.base07; - - # extended base16 colors - color16 = config.theme.colors.base09; - color17 = config.theme.colors.base0F; - color18 = config.theme.colors.base01; - color19 = config.theme.colors.base02; - color20 = config.theme.colors.base04; - color21 = config.theme.colors.base06; - - # Scrollback - scrollback_lines = 10000; - scrollback_pager_history_size = 300; # MB - - # Window - window_padding_width = 6; - - tab_bar_edge = "top"; - tab_bar_style = "slant"; - - # Disable audio - enable_audio_bell = false; - }; - }; - }; - }; -} diff --git a/modules/common/applications/media.nix b/modules/common/applications/media.nix deleted file mode 100644 index 8d819ae..0000000 --- a/modules/common/applications/media.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - media = { - enable = lib.mkEnableOption { - description = "Enable media programs."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.media.enable) { - home-manager.users.${config.user} = { - home.packages = with pkgs; [ - nsxiv # Image viewer - mupdf # PDF viewer - zathura # PDF viewer - ]; - - # Video player - programs.mpv = { - enable = true; - bindings = { }; - config = { - image-display-duration = 2; # For cycling through images - hwdec = "auto-safe"; # Attempt to use GPU decoding for video - }; - scripts = [ - - # Automatically load playlist entries before and after current file - pkgs.mpvScripts.autoload - - # Delete current file after quitting - pkgs.mpvScripts.mpv-delete-file - ]; - }; - - # Set default programs for opening PDFs and other media - xdg.mimeApps = { - associations.added = { - "application/pdf" = [ "pwmt.zathura-cb.desktop" ]; - "image/jpeg" = [ "nsxiv.desktop" ]; - "image/png" = [ "nsxiv.desktop" ]; - "image/*" = [ "nsxiv.desktop" ]; - }; - associations.removed = { - "application/pdf" = [ - "mupdf.desktop" - "wine-extension-pdf.desktop" - ]; - }; - defaultApplications = { - "application/pdf" = [ "pwmt.zathura-cb.desktop" ]; - "image/jpeg" = [ "nsxiv.desktop" ]; - "image/png" = [ "nsxiv.desktop" ]; - "image/*" = [ "nsxiv.desktop" ]; - }; - }; - }; - }; -} diff --git a/modules/common/applications/obsidian.nix b/modules/common/applications/obsidian.nix deleted file mode 100644 index b9dde4a..0000000 --- a/modules/common/applications/obsidian.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - obsidian = { - enable = lib.mkEnableOption { - description = "Enable Obsidian."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.obsidian.enable) { - unfreePackages = [ "obsidian" ]; - home-manager.users.${config.user} = { - home.packages = with pkgs; [ obsidian ]; - }; - - # Broken on 2023-12-11 - # https://forum.obsidian.md/t/electron-25-is-now-eol-please-upgrade-to-a-newer-version/72878/8 - insecurePackages = [ "electron-25.9.0" ]; - }; -} diff --git a/modules/common/applications/qbittorrent.nix b/modules/common/applications/qbittorrent.nix deleted file mode 100644 index 1f9adc7..0000000 --- a/modules/common/applications/qbittorrent.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - qbittorrent = { - enable = lib.mkEnableOption { - description = "Enable qBittorrent."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.qbittorrent.enable) { - - home-manager.users.${config.user} = { - - home.packages = with pkgs; [ qbittorrent ]; - }; - }; -} diff --git a/modules/common/applications/slack.nix b/modules/common/applications/slack.nix deleted file mode 100644 index 3c3f449..0000000 --- a/modules/common/applications/slack.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - slack = { - enable = lib.mkEnableOption { - description = "Enable Slack."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.slack.enable) { - unfreePackages = [ "slack" ]; - home-manager.users.${config.user} = { - home.packages = with pkgs; [ slack ]; - }; - }; - - # Theme string: #1D2122,#665C54,#8EC07C,#BDAE93 -} diff --git a/modules/common/applications/wezterm.nix b/modules/common/applications/wezterm.nix deleted file mode 100644 index 051f1e5..0000000 --- a/modules/common/applications/wezterm.nix +++ /dev/null @@ -1,286 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - wezterm = { - enable = lib.mkEnableOption { - description = "Enable WezTerm terminal."; - default = false; - }; - }; - }; - - config = - let - font = config.home-manager.users.${config.user}.programs.kitty.font.name; - in - lib.mkIf (config.gui.enable && config.wezterm.enable) { - - # Set the Rofi-Systemd terminal for viewing logs - # Using optionalAttrs because only available in NixOS - environment = - { } - // lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) { - sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.wezterm}/bin/wezterm"; - }; - - terminal = "${pkgs.wezterm}/bin/wezterm"; - terminalLaunchCommand = "${config.terminal} start --"; - - home-manager.users.${config.user} = { - - # Set the i3 terminal - xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "wezterm"; - - # Display images in the terminal - programs.fish.shellAliases = { - icat = lib.mkForce "wezterm imgcat"; - }; - - programs.wezterm = { - enable = true; - colorSchemes = { - myTheme = { - background = config.theme.colors.base00; - foreground = config.theme.colors.base05; - cursor_bg = config.theme.colors.base05; - cursor_fg = config.theme.colors.base00; - cursor_border = config.theme.colors.base05; - selection_bg = config.theme.colors.base05; - selection_fg = config.theme.colors.base00; - scrollbar_thumb = config.theme.colors.base03; - ansi = [ - config.theme.colors.base01 # black - config.theme.colors.base0F # maroon - config.theme.colors.base0B # green - config.theme.colors.base0A # olive - config.theme.colors.base0D # navy - config.theme.colors.base0E # purple - config.theme.colors.base0C # teal - config.theme.colors.base06 # silver - ]; - brights = [ - config.theme.colors.base03 # grey - config.theme.colors.base08 # red - config.theme.colors.base0B # lime - config.theme.colors.base0A # yellow - config.theme.colors.base0D # blue - config.theme.colors.base0E # fuchsia - config.theme.colors.base0C # aqua - config.theme.colors.base07 # white - ]; - compose_cursor = config.theme.colors.base09; # orange - copy_mode_active_highlight_bg = { - Color = config.theme.colors.base03; - }; - copy_mode_active_highlight_fg = { - Color = config.theme.colors.base07; - }; - copy_mode_inactive_highlight_bg = { - Color = config.theme.colors.base02; - }; - copy_mode_inactive_highlight_fg = { - Color = config.theme.colors.base06; - }; - quick_select_label_bg = { - Color = config.theme.colors.base02; - }; - quick_select_label_fg = { - Color = config.theme.colors.base06; - }; - quick_select_match_bg = { - Color = config.theme.colors.base03; - }; - quick_select_match_fg = { - Color = config.theme.colors.base07; - }; - }; - }; - extraConfig = '' - local wezterm = require("wezterm") - local config = wezterm.config_builder() - config.check_for_updates = false - config.color_scheme = "myTheme" - - -- Scrollback - config.scrollback_lines = 10000 - - -- Window - config.window_padding = { - left = 10, - right = 10, - top = 10, - bottom = 12, - } - - config.font = wezterm.font('${font}', { weight = 'Bold'}) - config.font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"} - - -- Fix color blocks instead of text - config.front_end = "WebGpu" - - -- Tab Bar - config.hide_tab_bar_if_only_one_tab = true - config.window_frame = { - font = wezterm.font('${font}', { weight = 'Bold'}), - font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"}, - } - - config.colors = { - tab_bar = { - active_tab = { - bg_color = '${config.theme.colors.base00}', - fg_color = '${config.theme.colors.base04}', - }, - }, - } - - -- Disable audio - config.audible_bell = "Disabled" - - config.initial_rows = 80 - config.initial_cols = 200 - - config.unix_domains = { - { - name = 'unix', - }, - } - - -- This causes `wezterm` to act as though it was started as - -- `wezterm connect unix` by default, connecting to the unix - -- domain on startup. - -- If you prefer to connect manually, leave out this line. - config.default_gui_startup_args = { 'connect', 'unix' } - - config.leader = { - key = 'a', - mods = 'CTRL', - timeout_milliseconds = 2000, - } - - config.keys = { - -- Attach to muxer - { - key = 'a', - mods = 'LEADER', - action = wezterm.action.AttachDomain 'unix', - }, - - -- Detach from muxer - { - key = 'd', - mods = 'LEADER', - action = wezterm.action.DetachDomain { DomainName = 'unix' }, - }, - -- sends completion string for fish autosuggestions - { - key = 'Enter', - mods = 'SHIFT', - action = wezterm.action.SendString '\x1F' - }, - -- ctrl-shift-h was "hide" - { - key = 'H', - mods = 'SHIFT|CTRL', - action = wezterm.action.DisableDefaultAssignment - }, - -- alt-enter was "fullscreen" - { - key = 'Enter', - mods = 'ALT', - action = wezterm.action.DisableDefaultAssignment - }, - -- make super-f "fullscreen" - { - key = 'f', - mods = 'SUPER', - action = wezterm.action.ToggleFullScreen - }, - -- super-t open new tab in new dir - { - key = 't', - mods = ${if pkgs.stdenv.isDarwin then "'SUPER'" else "'ALT'"}, - action = wezterm.action.SpawnCommandInNewTab { - cwd = wezterm.home_dir, - }, - }, - -- shift-super-t open new tab in same dir - { - key = 't', - mods = 'SUPER|SHIFT', - action = wezterm.action.SpawnTab 'CurrentPaneDomain' - }, - -- project switcher - { - key = 'P', - mods = 'SUPER', - action = wezterm.action_callback(function(window, pane) - local choices = {} - - wezterm.log_info "working?" - - function scandir(directory) - local i, t, popen = 0, {}, io.popen - local pfile = popen('${pkgs.fd}/bin/fd --search-path "'..directory..'" --type directory --exact-depth 2 | ${pkgs.proximity-sort}/bin/proximity-sort "'..os.getenv("HOME").."/dev/work"..'"') - for filename in pfile:lines() do - i = i + 1 - t[i] = filename - end - pfile:close() - return t - end - - for _, v in pairs(scandir(os.getenv("HOME").."/dev")) do - table.insert(choices, { label = v }) - end - - window:perform_action( - wezterm.action.InputSelector { - action = wezterm.action_callback(function(window, pane, id, label) - if not id and not label then - wezterm.log_info "cancelled" - else - window:perform_action( - wezterm.action.SpawnCommandInNewTab { - cwd = label, - }, - pane - ) - end - end), - fuzzy = true, - title = "Select Project", - choices = choices, - }, - pane - ) - end), - }, - } - - -- print the workspace name at the upper right - wezterm.on("update-right-status", function(window, pane) - window:set_right_status(window:active_workspace()) - end) - -- load plugin - local workspace_switcher = wezterm.plugin.require("https://github.com/MLFlexer/smart_workspace_switcher.wezterm") - -- set path to zoxide - workspace_switcher.zoxide_path = "${pkgs.zoxide}/bin/zoxide" - -- keymaps - table.insert(config.keys, { key = "s", mods = "CTRL|SHIFT", action = workspace_switcher.switch_workspace() }) - -- table.insert(config.keys, { key = "t", mods = "CTRL|SHIFT", action = wezterm.action.ShowLauncherArgs({ flags = "FUZZY|WORKSPACES" }) }) - table.insert(config.keys, { key = "[", mods = "CTRL|SHIFT", action = wezterm.action.SwitchWorkspaceRelative(1) }) - table.insert(config.keys, { key = "]", mods = "CTRL|SHIFT", action = wezterm.action.SwitchWorkspaceRelative(-1) }) - - return config - ''; - }; - }; - }; -} diff --git a/modules/common/applications/yt-dlp.nix b/modules/common/applications/yt-dlp.nix deleted file mode 100644 index 553c43d..0000000 --- a/modules/common/applications/yt-dlp.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - yt-dlp = { - enable = lib.mkEnableOption { - description = "Enable YouTube downloader."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.yt-dlp.enable) { - home-manager.users.${config.user} = { - programs.yt-dlp = { - enable = true; - extraConfig = ""; - settings = { - no-continue = true; # Always re-download each fragment - no-overwrites = true; # Don't overwrite existing files - download-archive = "archive.log"; # Log of archives - embed-metadata = true; - embed-thumbnail = true; - embed-subs = true; - sub-langs = "en.*"; - concurrent-fragments = 4; # Parallel download chunks - }; - }; - - programs.fish.shellAbbrs.yt = "yt-dlp"; - }; - }; -} diff --git a/modules/common/mail/aerc.nix b/modules/common/mail/aerc.nix deleted file mode 100644 index e41a3ed..0000000 --- a/modules/common/mail/aerc.nix +++ /dev/null @@ -1,220 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options.mail.aerc.enable = lib.mkEnableOption "Aerc email."; - - config = lib.mkIf config.mail.aerc.enable { - - home-manager.users.${config.user} = { - - home.packages = with pkgs; [ - w3m # Render HTML - dante # Socksify for rendering HTML - ]; - - programs.aerc = { - enable = true; - extraBinds = { - # Binds are of the form = - # To use '=' in a key sequence, substitute it with "Eq": "" - # If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit - global = { - "" = ":prev-tab"; - "" = ":next-tab "; - "" = ":term"; - "?" = ":help keys"; - }; - - messages = { - q = ":quit"; - - j = ":next "; - "" = ":next"; - "" = ":next 50%"; - "" = ":next 100%"; - "" = ":next 100%"; - - k = ":prev "; - "" = ":prev"; - "" = ":prev 50%"; - "" = ":prev 100%"; - "" = ":prev 100%"; - g = ":select 0 "; - G = ":select -1"; - - J = ":next-folder "; - K = ":prev-folder"; - H = ":collapse-folder"; - L = ":expand-folder"; - - v = ":mark -t"; - V = ":mark -v"; - - T = ":toggle-threads"; - - "" = ":view"; - d = ":prompt 'Really delete this message?' 'delete-message'"; - D = ":move Trash"; - A = ":archive flat"; - - C = ":compose"; - - rr = ":reply -a"; - rq = ":reply -aq"; - Rr = ":reply"; - Rq = ":reply -q"; - - c = ":cf"; - "$" = ":term"; - "!" = ":term"; - "|" = ":pipe"; - - "/" = ":search-a"; - "\\" = ":filter "; - n = ":next-result"; - N = ":prev-result"; - "" = ":clear"; - }; - - "messages:folder=Drafts" = { - "" = ":recall"; - }; - - view = { - "/" = ":toggle-key-passthrough /"; - q = ":close"; - O = ":open"; - S = ":save"; - "|" = ":pipe"; - D = ":move Trash"; - A = ":archive flat"; - - "" = ":open-link "; - - f = ":forward "; - rr = ":reply -a"; - rq = ":reply -aq"; - Rr = ":reply"; - Rq = ":reply -q"; - - H = ":toggle-headers"; - "" = ":prev-part"; - "" = ":next-part"; - J = ":next "; - K = ":prev"; - }; - - "view::passthrough" = { - "$noinherit" = "true"; - "$ex" = ""; - "" = ":toggle-key-passthrough"; - }; - - compose = { - # Keybindings used when the embedded terminal is not selected in the compose - # view - "$noinherit" = "true"; - "$ex" = ""; - "" = ":prev-field"; - "" = ":next-field"; - "" = ":switch-account -p"; - "" = ":switch-account -n"; - "" = ":next-field"; - "" = ":prev-tab"; - "" = ":next-tab"; - }; - - "compose::editor" = { - # Keybindings used when the embedded terminal is selected in the compose view - "$noinherit" = "true"; - "$ex" = ""; - "" = ":prev-field"; - "" = ":next-field"; - "" = ":prev-tab"; - "" = ":next-tab"; - }; - - "compose::review" = { - # Keybindings used when reviewing a message to be sent - y = ":send "; - n = ":abort"; - p = ":postpone"; - q = ":choose -o d discard abort -o p postpone postpone"; - e = ":edit"; - a = ":attach"; - d = ":detach"; - }; - - terminal = { - "$noinherit" = "true"; - "$ex" = ""; - "" = ":prev-tab"; - "" = ":next-tab"; - }; - }; - extraConfig = { - general = { - unsafe-accounts-conf = true; - # log-file = "~/.cache/aerc.log"; - # log-level = "debug"; - }; - viewer = { - pager = "${pkgs.less}/bin/less -R"; - }; - filters = { - "text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize"; - "text/calendar" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar"; - "text/html" = - "${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante - # "text/*" = - # ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "''; - "message/delivery-status" = "${pkgs.aerc}/libexec/aerc/filters/colorize"; - "message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize"; - "application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh"; - "application/pdf" = "${pkgs.zathura}/bin/zathura -"; - "audio/*" = "${pkgs.mpv}/bin/mpv -"; - "image/*" = "${pkgs.feh}/bin/feh -"; - }; - }; - }; - accounts.email.accounts.home.aerc = { - enable = true; - extraAccounts = { - check-mail = "5m"; - check-mail-cmd = "${pkgs.isync}/bin/mbsync -a"; - check-mail-timeout = "15s"; - }; - }; - - xdg.desktopEntries.aerc = lib.mkIf (pkgs.stdenv.isLinux && config.gui.enable) { - name = "aerc"; - exec = "${config.terminalLaunchCommand} 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 ${ - # Don't name the script `aerc` or it will affect grep - builtins.toString ( - pkgs.writeShellScript "focus-mail.sh" '' - count=$(ps aux | grep -c aerc) - if [ "$count" -eq 1 ]; then - i3-msg "exec --no-startup-id ${config.terminal} start --class aerc -- aerc" - sleep 0.25 - fi - i3-msg "[class=aerc] focus" - '' - ) - }"; - }; - - programs.fish.shellAbbrs = { - ae = "aerc"; - }; - }; - }; -} diff --git a/modules/common/mail/default.nix b/modules/common/mail/default.nix deleted file mode 100644 index bb05316..0000000 --- a/modules/common/mail/default.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - imports = [ - ./himalaya.nix - ./aerc.nix - ./system.nix - ]; - - options = { - mail.enable = lib.mkEnableOption "Mail service."; - mail.user = lib.mkOption { - type = lib.types.str; - description = "User name for the email address."; - default = config.user; - }; - mail.server = lib.mkOption { - 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 { - - home-manager.users.${config.user} = { - programs.mbsync = { - enable = true; - }; - - # Automatically check for mail and keep files synced locally - services.mbsync = lib.mkIf pkgs.stdenv.isLinux { - enable = true; - frequency = "*:0/5"; - postExec = "${pkgs.notmuch}/bin/notmuch new"; - }; - - # Used to watch for new mail and trigger sync - services.imapnotify.enable = pkgs.stdenv.isLinux; - - # Allows sending email from CLI/sendmail - programs.msmtp.enable = true; - - # Better local mail search - programs.notmuch = { - enable = true; - new.ignore = [ - ".mbsyncstate.lock" - ".mbsyncstate.journal" - ".mbsyncstate.new" - ]; - }; - - accounts.email = { - - # Where email files are stored - maildirBasePath = "${config.homePath}/mail"; - - accounts = { - home = - let - address = "${config.mail.user}@${config.mail.server}"; - in - { - userName = address; - realName = config.fullName; - primary = true; - inherit address; - aliases = map (user: "${user}@${config.mail.server}") [ - "me" - "hey" - "admin" - ]; - - # Options for contact completion - alot = { }; - - imap = { - host = config.mail.imapHost; - port = 993; - tls.enable = true; - }; - - # Watch for mail and run notifications or sync - imapnotify = { - enable = true; - boxes = [ "Inbox" ]; - onNotify = "${pkgs.isync}/bin/mbsync -a"; - onNotifyPost = - lib.mkIf config.home-manager.users.${config.user}.services.dunst.enable - "${pkgs.libnotify}/bin/notify-send 'New mail arrived'"; - }; - - # Name of the directory in maildir for this account - maildir = { - path = "main"; - }; - - # Bi-directional syncing options for local files - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - remove = "both"; - patterns = [ "*" ]; - extraConfig.channel = { - CopyArrivalDate = "yes"; # Sync time of original message - }; - }; - - # Enable indexing - notmuch.enable = true; - - # Used to login and send and receive emails - passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ~/.ssh/id_ed25519 ${pkgs.writeText "mailpass.age" (builtins.readFile ../../../private/mailpass.age)}"; - - smtp = { - host = config.mail.smtpHost; - port = 465; - tls.enable = true; - }; - }; - }; - }; - }; - }; -} diff --git a/modules/common/mail/himalaya.nix b/modules/common/mail/himalaya.nix deleted file mode 100644 index c3f1d98..0000000 --- a/modules/common/mail/himalaya.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, ... }: -{ - - options.mail.himalaya.enable = lib.mkEnableOption "Himalaya email."; - - config = lib.mkIf config.mail.himalaya.enable { - - home-manager.users.${config.user} = { - - programs.himalaya = { - enable = true; - }; - accounts.email.accounts.home.himalaya = { - enable = true; - settings = { - downloads-dir = config.userDirs.download; - smtp-insecure = true; - }; - }; - - programs.fish.shellAbbrs = { - hi = "himalaya"; - }; - }; - }; -} diff --git a/modules/common/mail/system.nix b/modules/common/mail/system.nix deleted file mode 100644 index aab3d69..0000000 --- a/modules/common/mail/system.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - config = lib.mkIf (config.mail.enable || config.server) { - - home-manager.users.${config.user} = { - - programs.msmtp.enable = true; - - # The system user for sending automatic notifications - accounts.email.accounts.system = - let - address = "system@${config.mail.server}"; - in - { - userName = address; - realName = "NixOS System"; - primary = !config.mail.enable; # Only primary if mail not enabled - inherit address; - passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${pkgs.writeText "mailpass-system.age" (builtins.readFile ../../../private/mailpass-system.age)}"; - msmtp.enable = true; - smtp = { - host = config.mail.smtpHost; - port = 465; - tls.enable = true; - }; - }; - }; - }; -} diff --git a/modules/common/shell/atuin.nix b/modules/common/shell/atuin.nix deleted file mode 100644 index 07b8de9..0000000 --- a/modules/common/shell/atuin.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ config, lib, ... }: -{ - - # Shell history sync - - options.atuin.enable = lib.mkEnableOption "Atuin"; - - config = { - - home-manager.users.${config.user} = lib.mkIf config.atuin.enable { - - programs.atuin = { - enable = true; - flags = [ - "--disable-up-arrow" - "--disable-ctrl-r" - ]; - settings = { - auto_sync = true; - update_check = false; - sync_address = "https://api.atuin.sh"; - search_mode = "fuzzy"; - filter_mode = "host"; # global, host, session, directory - search_mode_shell_up_key_binding = "fuzzy"; - filter_mode_shell_up_key_binding = "session"; - style = "compact"; # or auto,full - show_help = true; - history_filter = [ ]; - secrets_filter = true; - enter_accept = false; - keymap_mode = "vim-normal"; - }; - }; - }; - - # Give root user the same setup - home-manager.users.root.programs.atuin = config.home-manager.users.${config.user}.programs.atuin; - }; -} diff --git a/modules/common/shell/direnv.nix b/modules/common/shell/direnv.nix deleted file mode 100644 index 9a62b45..0000000 --- a/modules/common/shell/direnv.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, ... }: -{ - - # Enables quickly entering Nix shells when changing directories - home-manager.users.${config.user}.programs.direnv = { - enable = true; - nix-direnv.enable = true; - config = { - whitelist = { - prefix = [ config.dotfilesPath ]; - }; - }; - }; - - # programs.direnv.direnvrcExtra = '' - # layout_postgres() { - # export PGDATA="$(direnv_layout_dir)/postgres" - # export PGHOST="$PGDATA" - # - # if [[ ! -d "PGDATA" ]]; then - # initdb - # cat >> "$PGDATA/postgres.conf" <<- EOF - # listen_addresses = ''' - # unix_socket_directories = '$PGHOST' - # EOF - # echo "CREATE DATABASE $USER;" | postgres --single -E postgres - # fi - # } - # ''; - - # Prevent garbage collection - nix.extraOptions = '' - keep-outputs = true - keep-derivations = true - ''; -} diff --git a/modules/common/shell/git.nix b/modules/common/shell/git.nix deleted file mode 100644 index 4957986..0000000 --- a/modules/common/shell/git.nix +++ /dev/null @@ -1,195 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: - -let - home-packages = config.home-manager.users.${config.user}.home.packages; -in -{ - - options = { - gitName = lib.mkOption { - type = lib.types.str; - description = "Name to use for git commits"; - }; - gitEmail = lib.mkOption { - type = lib.types.str; - description = "Email to use for git commits"; - }; - }; - - config = { - - home-manager.users.root.programs.git = { - enable = true; - extraConfig.safe.directory = config.dotfilesPath; - }; - - home-manager.users.${config.user} = { - programs.git = { - enable = true; - userName = config.gitName; - userEmail = config.gitEmail; - extraConfig = { - core.pager = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight | less -F"; - interactive.difffilter = "${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight"; - pager = { - branch = "false"; - }; - safe = { - directory = config.dotfilesPath; - }; - pull = { - ff = "only"; - }; - push = { - autoSetupRemote = "true"; - }; - init = { - defaultBranch = "master"; - }; - rebase = { - autosquash = "true"; - }; - gpg = { - format = "ssh"; - ssh.allowedSignersFile = "~/.config/git/allowed-signers"; - }; - # commit.gpgsign = true; - # tag.gpgsign = true; - }; - ignores = [ - ".direnv/**" - "result" - ]; - includes = [ - { - path = "~/.config/git/personal"; - condition = "gitdir:~/dev/personal/"; - } - ]; - }; - - # Personal git config - # TODO: fix with variables - xdg.configFile."git/personal".text = '' - [user] - name = "${config.fullName}" - email = "7386960+nmasur@users.noreply.github.com" - signingkey = ~/.ssh/id_ed25519 - [commit] - gpgsign = true - [tag] - gpgsign = true - ''; - - xdg.configFile."git/allowed-signers".text = '' - 7386960+nmasur@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s - ''; - - programs.fish.shellAbbrs = { - g = "git"; - gs = "git status"; - gd = "git diff"; - gds = "git diff --staged"; - gdp = "git diff HEAD^"; - ga = "git add"; - gaa = "git add -A"; - gac = "git commit -am"; - gc = "git commit -m"; - gca = "git commit --amend --no-edit"; - gcae = "git commit --amend"; - gu = "git pull"; - gp = "git push"; - gl = "git log --graph --decorate --oneline -20"; - gll = "git log --graph --decorate --oneline"; - gco = "git checkout"; - gcom = ''git switch (git symbolic-ref refs/remotes/origin/HEAD | cut -d"/" -f4)''; - gcob = "git switch -c"; - gb = "git branch"; - gpd = "git push origin -d"; - gbd = "git branch -d"; - gbD = "git branch -D"; - gdd = { - position = "anywhere"; - setCursor = true; - expansion = "BRANCH=% git push origin -d $BRANCH and git branch -d $BRANCH"; - }; - gr = "git reset"; - grh = "git reset --hard"; - gm = "git merge"; - gcp = "git cherry-pick"; - cdg = "cd (git rev-parse --show-toplevel)"; - }; - - # Required for fish commands - home.packages = with pkgs; [ - fish - fzf - bat - ]; - - programs.fish.functions = - lib.mkIf (builtins.elem pkgs.fzf home-packages && builtins.elem pkgs.bat home-packages) - { - git = { - body = builtins.readFile ./fish/functions/git.fish; - }; - git-add-fuzzy = { - body = builtins.readFile ./fish/functions/git-add-fuzzy.fish; - }; - git-fuzzy-branch = { - argumentNames = "header"; - body = builtins.readFile ./fish/functions/git-fuzzy-branch.fish; - }; - git-checkout-fuzzy = { - body = '' - set branch (git-fuzzy-branch "checkout branch...") - and git checkout $branch - ''; - }; - git-delete-fuzzy = { - body = '' - set branch (git-fuzzy-branch "delete branch...") - and git branch -d $branch - ''; - }; - git-force-delete-fuzzy = { - body = '' - set branch (git-fuzzy-branch "force delete branch...") - and git branch -D $branch - ''; - }; - git-delete-both = { - argumentNames = "branch"; - body = '' - git push origin -d $branch - git branch -d $branch - ''; - }; - git-merge-fuzzy = { - body = '' - set branch (git-fuzzy-branch "merge from...") - and git merge $branch - ''; - }; - git-show-fuzzy = { - body = builtins.readFile ./fish/functions/git-show-fuzzy.fish; - }; - git-commits = { - body = builtins.readFile ./fish/functions/git-commits.fish; - }; - git-history = { - body = builtins.readFile ./fish/functions/git-history.fish; - }; - uncommitted = { - description = "Find uncommitted git repos"; - body = builtins.readFile ./fish/functions/uncommitted.fish; - }; - }; - }; - }; -} diff --git a/modules/common/shell/jujutsu.nix b/modules/common/shell/jujutsu.nix deleted file mode 100644 index 52948ad..0000000 --- a/modules/common/shell/jujutsu.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, ... }: -{ - - config = { - - home-manager.users.${config.user}.programs.jujutsu = { - enable = true; - - # https://github.com/martinvonz/jj/blob/main/docs/config.md - settings = { - user = { - name = config.home-manager.users.${config.user}.programs.git.userName; - email = config.home-manager.users.${config.user}.programs.git.userEmail; - }; - }; - }; - }; -} diff --git a/modules/darwin/fish.nix b/modules/darwin/fish.nix deleted file mode 100644 index 2d87722..0000000 --- a/modules/darwin/fish.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: -{ - - config = { - - # MacOS-specific settings for Fish - programs.fish.useBabelfish = true; - programs.fish.babelfishPackage = pkgs.babelfish; - }; -} diff --git a/modules/darwin/hammerspoon.nix b/modules/darwin/hammerspoon.nix deleted file mode 100644 index 59a33c4..0000000 --- a/modules/darwin/hammerspoon.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - # Hammerspoon - MacOS custom automation scripting - - config = lib.mkIf pkgs.stdenv.isDarwin { - - home-manager.users.${config.user} = { - xdg.configFile."hammerspoon/init.lua".source = ./hammerspoon/init.lua; - xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source = ./hammerspoon/Spoons/ControlEscape.spoon; - xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source = ./hammerspoon/Spoons/DismissAlerts.spoon; - xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source = pkgs.substituteAll { - src = ./hammerspoon/Spoons/Launcher.spoon/init.lua; - firefox = "${pkgs.firefox-bin}/Applications/Firefox.app"; - discord = "${pkgs.discord}/Applications/Discord.app"; - wezterm = "${pkgs.wezterm}/Applications/WezTerm.app"; - obsidian = "${pkgs.obsidian}/Applications/Obsidian.app"; - slack = "${pkgs.slack}/Applications/Slack.app"; - }; - xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = ./hammerspoon/Spoons/MoveWindow.spoon; - - home.activation.reloadHammerspoon = - config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ] - '' - $DRY_RUN_CMD /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs -c "hs.reload()" - $DRY_RUN_CMD sleep 1 - $DRY_RUN_CMD /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs -c "hs.console.clearConsole()" - ''; - }; - - homebrew.casks = [ "hammerspoon" ]; - - system.activationScripts.postUserActivation.text = '' - defaults write org.hammerspoon.Hammerspoon MJConfigFile "${config.homePath}/.config/hammerspoon/init.lua" - sudo killall Dock - ''; - }; -} diff --git a/modules/darwin/networking.nix b/modules/darwin/networking.nix deleted file mode 100644 index 3a4949e..0000000 --- a/modules/darwin/networking.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - # config = lib.mkIf pkgs.stdenv.isDarwin { - # networking = { - # computerName = config.networking.hostName; - # # Adjust if necessary - # # hostName = ""; - # }; - # }; - # } -} diff --git a/modules/darwin/system.nix b/modules/darwin/system.nix deleted file mode 100644 index b8019f2..0000000 --- a/modules/darwin/system.nix +++ /dev/null @@ -1,222 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - terminal = lib.mkOption { - type = lib.types.nullOr lib.types.str; - description = "Path to executable for terminal emulator program."; - default = null; - }; - terminalLaunchCommand = lib.mkOption { - type = lib.types.nullOr lib.types.str; - description = "Command for using the terminal to launch a new window with a program."; - default = null; - }; - }; - - config = lib.mkIf pkgs.stdenv.isDarwin { - - services.nix-daemon.enable = true; - - # This setting only applies to Darwin, different on NixOS - nix.gc.interval = { - Hour = 12; - Minute = 15; - Day = 1; - }; - - environment.shells = [ pkgs.fish ]; - - security.pam.enableSudoTouchIdAuth = true; - - system = { - - stateVersion = 5; - - keyboard = { - remapCapsLockToControl = true; - enableKeyMapping = true; # Allows for skhd - }; - - defaults = { - NSGlobalDomain = { - - # Set to dark mode - AppleInterfaceStyle = "Dark"; - - # Don't change from dark to light automatically - # AppleInterfaceSwitchesAutomatically = false; - - # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) - AppleKeyboardUIMode = 3; - - # Only hide menu bar in fullscreen - _HIHideMenuBar = false; - - # Expand save panel by default - NSNavPanelExpandedStateForSaveMode = true; - - # Expand print panel by default - PMPrintingExpandedStateForPrint = true; - - # Replace press-and-hold with key repeat - ApplePressAndHoldEnabled = false; - - # Set a fast key repeat rate - KeyRepeat = 2; - - # Shorten delay before key repeat begins - InitialKeyRepeat = 12; - - # Save to local disk by default, not iCloud - NSDocumentSaveNewDocumentsToCloud = false; - - # Disable autocorrect capitalization - NSAutomaticCapitalizationEnabled = false; - - # Disable autocorrect smart dashes - NSAutomaticDashSubstitutionEnabled = false; - - # Disable autocorrect adding periods - NSAutomaticPeriodSubstitutionEnabled = false; - - # Disable autocorrect smart quotation marks - NSAutomaticQuoteSubstitutionEnabled = false; - - # Disable autocorrect spellcheck - NSAutomaticSpellingCorrectionEnabled = false; - }; - - dock = { - # Automatically show and hide the dock - autohide = true; - - # Add translucency in dock for hidden applications - showhidden = true; - - # Enable spring loading on all dock items - enable-spring-load-actions-on-all-items = true; - - # Highlight hover effect in dock stack grid view - mouse-over-hilite-stack = true; - - mineffect = "genie"; - orientation = "bottom"; - show-recents = false; - tilesize = 44; - - persistent-apps = [ - "/Applications/1Password.app" - "${pkgs.slack}/Applications/Slack.app" - "/System/Applications/Calendar.app" - "${pkgs.firefox-bin}/Applications/Firefox.app" - "/System/Applications/Messages.app" - "/System/Applications/Mail.app" - "/Applications/zoom.us.app" - "${pkgs.discord}/Applications/Discord.app" - "${pkgs.obsidian}/Applications/Obsidian.app" - "${pkgs.wezterm}/Applications/WezTerm.app" - ]; - }; - - finder = { - - # Default Finder window set to column view - FXPreferredViewStyle = "clmv"; - - # Finder search in current folder by default - FXDefaultSearchScope = "SCcf"; - - # Disable warning when changing file extension - FXEnableExtensionChangeWarning = false; - - # Allow quitting of Finder application - QuitMenuItem = true; - }; - - # Disable "Are you sure you want to open" dialog - LaunchServices.LSQuarantine = false; - - # Disable trackpad tap to click - trackpad.Clicking = false; - - # Where to save screenshots - screencapture.location = "~/Downloads"; - - # Show seconds on the clock - menuExtraClock.ShowSeconds = true; - - CustomUserPreferences = { - # Disable disk image verification - "com.apple.frameworks.diskimages" = { - skip-verify = true; - skip-verify-locked = true; - skip-verify-remote = true; - }; - # Avoid creating .DS_Store files on network or USB volumes - "com.apple.desktopservices" = { - DSDontWriteNetworkStores = true; - DSDontWriteUSBStores = true; - }; - "com.apple.dock" = { - magnification = true; - largesize = 48; - }; - # Require password immediately after screen saver begins - "com.apple.screensaver" = { - askForPassword = 1; - askForPasswordDelay = 0; - }; - "com.apple.finder" = { - # Disable the warning before emptying the Trash - WarnOnEmptyTrash = false; - - # Finder search in current folder by default - FXDefaultSearchScope = "SCcf"; - - # Default Finder window set to column view - FXPreferredViewStyle = "clmv"; - }; - "leits.MeetingBar" = { - eventTimeFormat = ''"show"''; - eventTitleFormat = ''"none"''; - eventTitleIconFormat = ''"iconCalendar"''; - slackBrowser = ''{"deletable":true,"arguments":"","name":"Slack","path":""}''; - zoomBrowser = ''{"deletable":true,"arguments":"","name":"Zoom","path":""}''; - teamsBrowser = ''{"deletable":true,"arguments":"","name":"Teams","path":""}''; - KeyboardShortcuts_joinEventShortcut = ''{"carbonModifiers":6400,"carbonKeyCode":38}''; - timeFormat = ''"12-hour"''; - }; - }; - - CustomSystemPreferences = { - - }; - }; - - # Settings that don't have an option in nix-darwin - activationScripts.postActivation.text = '' - echo "Allow apps from anywhere" - SPCTL=$(spctl --status) - if ! [ "$SPCTL" = "assessments disabled" ]; then - sudo spctl --master-disable - fi - ''; - - # User-level settings - activationScripts.postUserActivation.text = '' - echo "Show the ~/Library folder" - chflags nohidden ~/Library - - echo "Reduce Menu Bar padding" - defaults write -globalDomain NSStatusItemSelectionPadding -int 6 - defaults write -globalDomain NSStatusItemSpacing -int 6 - ''; - }; - }; -} diff --git a/modules/darwin/utilities.nix b/modules/darwin/utilities.nix index 664f427..3f4494c 100644 --- a/modules/darwin/utilities.nix +++ b/modules/darwin/utilities.nix @@ -60,13 +60,5 @@ }) ]; - programs.fish.shellAbbrs = { - # Add noti for ghpr in Darwin - ghpr = lib.mkForce "gh pr create && sleep 3 && noti gh run watch"; - grw = lib.mkForce "noti gh run watch"; - - # Shortcut to edit hosts file - hosts = "sudo nvim /etc/hosts"; - }; }; } diff --git a/modules/nixos/applications/calendar.nix b/modules/nixos/applications/calendar.nix deleted file mode 100644 index 85b38de..0000000 --- a/modules/nixos/applications/calendar.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - calendar = { - enable = lib.mkEnableOption { - description = "Enable calendar."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.calendar.enable) { - home-manager.users.${config.user} = { - - accounts.calendar.accounts.default = { - basePath = "other/calendars"; # Where to save calendars in ~ directory - name = "personal"; - local.type = "filesystem"; - primary = true; - remote = { - passwordCommand = [ "" ]; - type = "caldav"; - url = "https://${config.hostnames.content}/remote.php/dav/principals/users/${config.user}"; - userName = config.user; - }; - }; - - home.packages = with pkgs; [ gnome-calendar ]; - }; - }; -} diff --git a/modules/nixos/applications/calibre.nix b/modules/nixos/applications/calibre.nix deleted file mode 100644 index b8f44d8..0000000 --- a/modules/nixos/applications/calibre.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - calibre = { - enable = lib.mkEnableOption { - description = "Enable Calibre."; - default = false; - }; - }; - }; - - config = lib.mkIf (config.gui.enable && config.calibre.enable) { - home-manager.users.${config.user} = { - home.packages = with pkgs; [ calibre ]; - # home.sessionVariables = { CALIBRE_USE_DARK_PALETTE = 1; }; - }; - - # Forces Calibre to use dark mode - environment.sessionVariables = { - CALIBRE_USE_DARK_PALETTE = "1"; - }; - }; -} diff --git a/modules/nixos/applications/default.nix b/modules/nixos/applications/default.nix deleted file mode 100644 index 6bb0454..0000000 --- a/modules/nixos/applications/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - - imports = [ - ./calendar.nix - ./calibre.nix - ./nautilus.nix - ]; -} diff --git a/modules/nixos/applications/nautilus.nix b/modules/nixos/applications/nautilus.nix deleted file mode 100644 index 6b2ff8a..0000000 --- a/modules/nixos/applications/nautilus.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options = { - nautilus = { - enable = lib.mkEnableOption { - description = "Enable Nautilus file manager."; - default = false; - }; - }; - }; - - # Install Nautilus file manager - config = lib.mkIf (config.gui.enable && config.nautilus.enable) { - - # Quick preview with spacebar - services.gnome.sushi.enable = true; - environment.systemPackages = [ pkgs.nautilus ]; - - home-manager.users.${config.user} = { - - # Quick button for launching nautilus - xsession.windowManager.i3.config.keybindings = { - "${ - config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier - }+n" = "exec --no-startup-id ${pkgs.nautilus}/bin/nautilus"; - }; - - # Generates a QR code and previews it with sushi - programs.fish.functions = { - qr = { - body = "${pkgs.qrencode}/bin/qrencode $argv[1] -o /tmp/qr.png | ${pkgs.sushi}/bin/sushi /tmp/qr.png"; - }; - }; - - # Set Nautilus as default for opening directories - xdg.mimeApps = { - associations.added."inode/directory" = [ "org.gnome.Nautilus.desktop" ]; - defaultApplications."inode/directory" = lib.mkBefore [ "org.gnome.Nautilus.desktop" ]; - }; - }; - - # Delete Trash files older than 1 week - systemd.user.services.empty-trash = { - description = "Empty Trash on a regular basis"; - wantedBy = [ "default.target" ]; - script = "${pkgs.trash-cli}/bin/trash-empty 7"; - }; - }; -} diff --git a/modules/nixos/gaming/chiaki.nix b/modules/nixos/gaming/chiaki.nix deleted file mode 100644 index 6a30a5c..0000000 --- a/modules/nixos/gaming/chiaki.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - options.gaming.chiaki.enable = lib.mkEnableOption "Chiaki PlayStation remote play client."; - - config = lib.mkIf config.gaming.chiaki.enable { - environment.systemPackages = with pkgs; [ chiaki ]; - }; -} diff --git a/modules/nixos/graphical/dunst.nix b/modules/nixos/graphical/dunst.nix deleted file mode 100644 index 8926d48..0000000 --- a/modules/nixos/graphical/dunst.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, ... }: - -{ - - config = { - - home-manager.users.${config.user}.services.dunst = { - enable = false; - settings = { - global = { - width = 300; - height = 200; - offset = "30x50"; - origin = "top-right"; - transparency = 0; - padding = 20; - horizontal_padding = 20; - frame_color = config.theme.colors.base03; - }; - - urgency_normal = { - background = config.theme.colors.base00; - foreground = config.theme.colors.base05; - timeout = 10; - }; - }; - }; - }; -} diff --git a/modules/nixos/graphical/picom.nix b/modules/nixos/graphical/picom.nix deleted file mode 100644 index 062fa53..0000000 --- a/modules/nixos/graphical/picom.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) { - home-manager.users.${config.user} = { - - services.picom = { - enable = true; - backend = "glx"; - settings = { - blur = false; - blurExclude = [ ]; - inactiveDim = "0.05"; - noDNDShadow = false; - noDockShadow = false; - # shadow-radius = 20 - # ''; - # shadow-radius = 20 - # corner-radius = 10 - # blur-size = 20 - # rounded-corners-exclude = [ - # "window_type = 'dock'", - # "class_g = 'i3-frame'" - # ] - # ''; - }; - fade = false; - inactiveOpacity = 1.0; - menuOpacity = 1.0; - opacityRules = [ - "0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'" # Hide tabbed windows - ]; - shadow = false; - shadowExclude = [ ]; - shadowOffsets = [ - (-10) - (-10) - ]; - shadowOpacity = 0.5; - vSync = true; - }; - - xsession.windowManager.i3.config.startup = [ - { - command = "systemctl --user restart picom"; - always = true; - notification = false; - } - ]; - }; - }; -} diff --git a/modules/nixos/graphical/polybar.nix b/modules/nixos/graphical/polybar.nix deleted file mode 100644 index 22446cf..0000000 --- a/modules/nixos/graphical/polybar.nix +++ /dev/null @@ -1,235 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - - config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) { - - toggleBarCommand = "polybar-msg cmd toggle"; - - home-manager.users.${config.user} = { - - services.polybar = { - enable = true; - package = pkgs.polybar.override { - pulseSupport = true; - githubSupport = true; - i3Support = true; - }; - script = "polybar &"; - config = { - "bar/main" = { - bottom = false; - width = "100%"; - height = "22pt"; - radius = 0; - # offset-y = -5; - # offset-y = "5%"; - # dpi = 96; - background = config.theme.colors.base01; - foreground = config.theme.colors.base05; - line-size = "3pt"; - border-top-size = 0; - border-right-size = 0; - border-left-size = 0; - border-bottom-size = "4pt"; - border-color = config.theme.colors.base00; - padding-left = 2; - padding-right = 2; - module-margin = 1; - modules-left = "i3"; - modules-center = "xwindow"; - modules-right = "mailcount network pulseaudio date power"; - cursor-click = "pointer"; - cursor-scroll = "ns-resize"; - enable-ipc = true; - tray-position = "right"; - # wm-restack = "generic"; - # wm-restack = "bspwm"; - # wm-restack = "i3"; - # override-redirect = true; - }; - "module/i3" = - let - padding = 2; - in - { - type = "internal/i3"; - pin-workspaces = false; - show-urgent = true; - strip-wsnumbers = true; - index-sort = true; - enable-click = true; - wrapping-scroll = true; - fuzzy-match = true; - format = " "; - label-focused = "%name%"; - label-focused-foreground = config.theme.colors.base01; - label-focused-background = config.theme.colors.base05; - label-focused-underline = config.theme.colors.base03; - label-focused-padding = padding; - label-unfocused = "%name%"; - label-unfocused-padding = padding; - label-visible = "%name%"; - label-visible-underline = config.theme.colors.base01; - label-visible-padding = padding; - label-urgent = "%name%"; - label-urgent-foreground = config.theme.colors.base00; - label-urgent-background = config.theme.colors.base08; - label-urgent-underline = config.theme.colors.base0F; - label-urgent-padding = padding; - }; - "module/xworkspaces" = { - type = "internal/xworkspaces"; - label-active = "%name%"; - label-active-background = config.theme.colors.base05; - label-active-foreground = config.theme.colors.base01; - label-active-underline = config.theme.colors.base03; - label-active-padding = 1; - label-occupied = "%name%"; - label-occupied-padding = 1; - label-urgent = "%name%"; - label-urgent-background = config.theme.colors.base08; - label-urgent-padding = 1; - label-empty = "%name%"; - label-empty-foreground = config.theme.colors.base06; - label-empty-padding = 1; - }; - "module/xwindow" = { - type = "internal/xwindow"; - label = "%title:0:60:...%"; - }; - # "module/filesystem" = { - # type = "internal/fs"; - # interval = 25; - # mount-0 = "/"; - # label-mounted = "%{F#F0C674}%mountpoint%%{F-} %percentage_used%%"; - # label-unmounted = "%mountpoint% not mounted"; - # label-unmounted-foreground = colors.disabled; - # }; - "module/mailcount" = { - type = "custom/script"; - interval = 10; - format = "