diff --git a/homes/common.nix b/homes/common.nix index 170211b..f4f1014 100644 --- a/homes/common.nix +++ b/homes/common.nix @@ -1,17 +1,12 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: -let - conda_init = shell: '' - eval "$(${pkgs.micromamba}/bin/micromamba shell hook --shell ${shell})" - - ''; - nd_bash_function = '' - function nd() { - mkdir -p "$1" && cd "$1" - } - - ''; - starship-config = import ./../programs/starship.nix; -in { +{ config, lib, pkgs, pkgs-unstable, ... }: { + imports = [ + ./../programs/shells.nix + ./../programs/bat.nix + ./../programs/direnv.nix + ./../programs/git.nix + ./../programs/lsd.nix + ./../programs/starship.nix + ]; home = { stateVersion = "23.11"; file = { }; @@ -80,116 +75,12 @@ in { }; }; programs = { - home-manager = { enable = true; }; - bash = { - enable = true; - initExtra = conda_init "bash" + nd_bash_function + '' - export PS1="[\[\e[32m\]\u\[\e[m\]@\[\e[33m\]\h\[\e[m\] \[\e[34m\]\W\[\e[m\]] \\$ " - ''; - }; - bat = { - enable = true; - config = { pager = "less -SRF"; }; - }; - direnv = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - }; - gh = { enable = true; }; - git = { - enable = true; - userName = "Thomas A. Christensen II"; - userEmail = "25492070+MillironX@users.noreply.github.com"; - extraConfig = { - core = { editor = "nvim"; }; - credential = { helper = "store"; }; - color = { ui = "auto"; }; - init = { defaultBranch = "master"; }; - column = { ui = "auto"; }; - branch = { sort = "-committerdate"; }; - tag = { sort = "version:refname"; }; - diff = { - algorithm = "histogram"; - colorMoved = "plain"; - mnemonicPrefix = true; - renames = true; - }; - push = { - default = "simple"; - autoSetupRemote = true; - followTages = true; - }; - fetch = { - prune = true; - pruneTags = true; - all = true; - }; - help = { autocorrect = "prompt"; }; - commit = { verbose = true; }; - rerere = { - enabled = true; - autoupdate = true; - }; - rebase = { - autoSquash = true; - autoStash = true; - updateRefs = true; - }; - merge = { conflictstyle = "zdiff3"; }; - pull = { rebase = true; }; - }; - }; - gpg = { enable = true; }; - lsd = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - }; - neovim = { - enable = true; - package = pkgs.neovim-unwrapped; - defaultEditor = true; - coc.enable = true; - plugins = with pkgs.vimPlugins; [ - mason-nvim - mason-lspconfig-nvim - nvim-lspconfig - nvim-dap - nvim-dap-ui - null-ls-nvim - nvim-lint - formatter-nvim - lspsaga-nvim - vim-slime - ]; - extraLuaConfig = '' - require("mason").setup() - ''; - }; - pandoc = { enable = true; }; - starship = starship-config { inherit lib; }; - yt-dlp = { enable = true; }; - zsh = { - enable = true; - autosuggestion.enable = true; - enableCompletion = true; - completionInit = - "autoload -U compinit && compinit; autoload -U bashcompinit && bashcompinit"; - antidote = { - enable = true; - plugins = [ - "getantidote/use-omz" - "ohmyzsh/ohmyzsh path:lib" - "ohmyzsh/ohmyzsh path:plugins/git" - "ohmyzsh/ohmyzsh path:plugins/extract" - "zsh-users/zsh-syntax-highlighting" - "zsh-users/zsh-autosuggestions" - "zsh-users/zsh-completions" - ]; - }; - initContent = conda_init "zsh" + nd_bash_function; - }; + home-manager.enable = true; + + gh.enable = true; + gpg.enable = true; + pandoc.enable = true; + yt-dlp.enable = true; }; xdg = { dataFile = { "julia/config/startup.jl".source = ./../dotfiles/startup.jl; }; diff --git a/homes/desktop.nix b/homes/desktop.nix index 5ee9eac..7c0fe48 100644 --- a/homes/desktop.nix +++ b/homes/desktop.nix @@ -1,8 +1,11 @@ -{ config, lib, pkgs, pkgs-unstable, firefox-addons, buildFirefoxXpiAddon, ... }: -let - firefox-config = import ./../programs/firefox.nix; - zed-config = import ./../programs/zed.nix; -in { +{ pkgs, ... }: { + + imports = [ + ./../programs/firefox.nix + ./../programs/zed.nix + ./../services/gpg-agent.nix + ]; + home = { packages = with pkgs; [ act @@ -29,25 +32,5 @@ in { ]; shellAliases = { code = "codium"; }; }; - programs = { - firefox = firefox-config { - inherit firefox-addons; - inherit buildFirefoxXpiAddon; - inherit lib; - inherit pkgs; - }; - zed-editor = zed-config; - }; - services = { - gpg-agent = { - enable = true; - enableBashIntegration = true; - enableSshSupport = true; - enableZshIntegration = true; - defaultCacheTtl = 604800; - maxCacheTtl = 604800; - verbose = true; - }; - syncthing = { enable = true; }; - }; + services = { syncthing.enable = true; }; } diff --git a/homes/linux-desktop.nix b/homes/linux-desktop.nix index 542acc2..94d7f7a 100644 --- a/homes/linux-desktop.nix +++ b/homes/linux-desktop.nix @@ -1,14 +1,14 @@ -{ config, lib, pkgs, pkgs-unstable, ... }: +{ config, pkgs, ... }: let home-manager-repo = "${config.xdg.configHome}/home-manager"; mkOutOfStoreSymlink = config.lib.file.mkOutOfStoreSymlink; - plasma-config = import ./../programs/plasma.nix; in { + imports = [ ./../programs/plasma.nix ]; + home = { packages = with pkgs; [ kwalletcli ]; sessionVariables = { ZED_WINDOW_DECORATIONS = "server"; }; }; - programs = { plasma = plasma-config { inherit config; }; }; services = { gpg-agent = { # Use kwallet cli, but put it in extraConfig, otherwise gpg-agent will diff --git a/programs/bat.nix b/programs/bat.nix new file mode 100644 index 0000000..1d344cd --- /dev/null +++ b/programs/bat.nix @@ -0,0 +1,6 @@ +{ ... }: { + programs.bat = { + enable = true; + config = { pager = "less -SRF"; }; + }; +} diff --git a/programs/direnv.nix b/programs/direnv.nix new file mode 100644 index 0000000..4b34305 --- /dev/null +++ b/programs/direnv.nix @@ -0,0 +1,7 @@ +{ ... }: { + programs.direnv = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; +} diff --git a/programs/firefox.nix b/programs/firefox.nix index 3709f28..89f2267 100644 --- a/programs/firefox.nix +++ b/programs/firefox.nix @@ -1,258 +1,260 @@ -{ firefox-addons, buildFirefoxXpiAddon, lib, pkgs }: { - enable = true; - package = - null; # Use native package manager/Homebrew b/c there are fewer breakages - nativeMessagingHosts = [ ]; - profileVersion = null; - profiles = { - "millironx-default" = { - id = 0; - containers = { - "Personal" = { - id = 1; - color = "blue"; - icon = "fingerprint"; - }; - "Administrator" = { - id = 2; - color = "yellow"; - icon = "briefcase"; - }; - "Kansas State CVM" = { - id = 3; - color = "purple"; - icon = "pet"; - }; - "Kansas State" = { - id = 4; - color = "pink"; - icon = "fruit"; - }; - }; - containersForce = true; - extensions.packages = with firefox-addons; [ - bitwarden - containerise - floccus - libredirect - old-reddit-redirect - plasma-integration - pwas-for-firefox - ublock-origin - user-agent-string-switcher - web-archives - zotero-connector - (buildFirefoxXpiAddon rec { - pname = "always_in_container"; - version = "1.0.7"; - addonId = "{a1e9543e-5f73-4763-b376-04e53fd12cbd}"; - url = - "https://addons.mozilla.org/firefox/downloads/file/4032840/${pname}-${version}.xpi"; - sha256 = "sha256-bLxjL2P6Sd06q98MSHYRTNigtcjGwn/C2r4ANWCqKrw="; - meta = with lib; { - homepage = "https://github.com/tiansh/always-in-container"; - description = - "Chose a container every time you try to open a page out of a container"; - license = licenses.mpl20; - platforms = platforms.all; +{ firefox-addons, buildFirefoxXpiAddon, lib, ... }: { + programs.firefox = { + enable = true; + package = + null; # Use native package manager/Homebrew b/c there are fewer breakages + nativeMessagingHosts = [ ]; + profileVersion = null; + profiles = { + "millironx-default" = { + id = 0; + containers = { + "Personal" = { + id = 1; + color = "blue"; + icon = "fingerprint"; }; - }) - (buildFirefoxXpiAddon rec { - pname = "open_with"; - version = "7.2.6"; - addonId = "openwith@darktrojan.net"; - url = - "https://addons.mozilla.org/firefox/downloads/file/3831723/${pname}-${version}.xpi"; - sha256 = "sha256-f9eGhLxg4UyVn4o5e4DRkraLWzj11SGto/GOwsJa9kg="; - meta = with lib; { - homepage = "https://darktrojan.github.io/openwith/"; - description = - "Quickly test out your web pages in Chrome, Edge, Safari, or Opera. Open With opens the current page in your other browsers with just two clicks."; - license = licenses.mpl20; - platforms = platforms.all; + "Administrator" = { + id = 2; + color = "yellow"; + icon = "briefcase"; }; - }) - ]; - search = { - default = "Milliron X Search"; - privateDefault = "Milliron X Search"; - force = true; - engines = { - "Milliron X Search" = { - urls = [ - { - rels = [ "results" ]; - type = "text/html"; - method = "GET"; - template = - "https://search.millironx.com/search?q={searchTerms}"; - } - { - rels = [ "suggestions" ]; - type = "application/x-suggestions+json"; - method = "GET"; - template = - "https://search.millironx.com/autocompleter?q={searchTerms}"; - } - ]; - icon = - "https://search.millironx.com/static/themes/simple/img/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@mxs" ]; + "Kansas State CVM" = { + id = 3; + color = "purple"; + icon = "pet"; }; - "Perplexity" = { - urls = - [{ template = "https://www.perplexity.ai/?q={searchTerms}"; }]; - icon = "https://www.perplexity.ai/favicon.ico"; - updateInterval = 7 * 24 * 60 * 60 * 1000; - definedAliases = [ "@pxt" ]; + "Kansas State" = { + id = 4; + color = "pink"; + icon = "fruit"; }; }; - }; - settings = { - "app.normandy.first_run" = false; - "app.shield.optoutstudies.enabled" = false; - "browser.contentblocking.category" = "strict"; - "browser.formfill.enable" = false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = - false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = - false; - "browser.newtabpage.activity-stream.feeds.section.topstories" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.showWeather" = false; - "browser.newtabpage.pinned" = [ - { - url = "https://millironx.com"; - label = "Home"; - baseDomain = "millironx.com"; - } - { - url = "https://nextcloud.millironx.com"; - label = "Nextcloud"; - baseDomain = "nextcloud.millironx.com"; - } - { - url = "https://code.millironx.com"; - label = "Code"; - baseDomain = "code.millironx.com"; - } - { - url = "https://video.millironx.com"; - label = "Videos"; - baseDomain = "video.millironx.com"; - } - { - url = "https://photos.millironx.com"; - label = "Photos"; - baseDomain = "photos.millironx.com"; - } - { - url = "https://vault.millironx.com"; - label = "Vault"; - baseDomain = "vault.millironx.com"; - } - { - url = "https://www.perplexity.ai/"; - label = "perplexity"; - } - { + containersForce = true; + extensions.packages = with firefox-addons; [ + bitwarden + containerise + floccus + libredirect + old-reddit-redirect + plasma-integration + pwas-for-firefox + ublock-origin + user-agent-string-switcher + web-archives + zotero-connector + (buildFirefoxXpiAddon rec { + pname = "always_in_container"; + version = "1.0.7"; + addonId = "{a1e9543e-5f73-4763-b376-04e53fd12cbd}"; url = - "https://www.vet.k-state.edu/academics/student-faculty-handbook/"; - } + "https://addons.mozilla.org/firefox/downloads/file/4032840/${pname}-${version}.xpi"; + sha256 = "sha256-bLxjL2P6Sd06q98MSHYRTNigtcjGwn/C2r4ANWCqKrw="; + meta = with lib; { + homepage = "https://github.com/tiansh/always-in-container"; + description = + "Chose a container every time you try to open a page out of a container"; + license = licenses.mpl20; + platforms = platforms.all; + }; + }) + (buildFirefoxXpiAddon rec { + pname = "open_with"; + version = "7.2.6"; + addonId = "openwith@darktrojan.net"; + url = + "https://addons.mozilla.org/firefox/downloads/file/3831723/${pname}-${version}.xpi"; + sha256 = "sha256-f9eGhLxg4UyVn4o5e4DRkraLWzj11SGto/GOwsJa9kg="; + meta = with lib; { + homepage = "https://darktrojan.github.io/openwith/"; + description = + "Quickly test out your web pages in Chrome, Edge, Safari, or Opera. Open With opens the current page in your other browsers with just two clicks."; + license = licenses.mpl20; + platforms = platforms.all; + }; + }) ]; - "browser.shopping.experience2023.active" = false; - "browser.startup.homepage_override.mstone" = "ignore"; - "browser.tabs.closeWindowWithLastTab" = false; - "browser.tabs.inTitlebar" = 0; - "browser.theme.content-theme" = 0; - "browser.theme.toolbar-theme" = 0; - "browser.toolbars.bookmarks.visibility" = "never"; - "browser.uiCustomization.state" = { - placements = { - "widget-overflow-fixed-list" = [ ]; - "unified-extensions-area" = [ + search = { + default = "Milliron X Search"; + privateDefault = "Milliron X Search"; + force = true; + engines = { + "Milliron X Search" = { + urls = [ + { + rels = [ "results" ]; + type = "text/html"; + method = "GET"; + template = + "https://search.millironx.com/search?q={searchTerms}"; + } + { + rels = [ "suggestions" ]; + type = "application/x-suggestions+json"; + method = "GET"; + template = + "https://search.millironx.com/autocompleter?q={searchTerms}"; + } + ]; + icon = + "https://search.millironx.com/static/themes/simple/img/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@mxs" ]; + }; + "Perplexity" = { + urls = + [{ template = "https://www.perplexity.ai/?q={searchTerms}"; }]; + icon = "https://www.perplexity.ai/favicon.ico"; + updateInterval = 7 * 24 * 60 * 60 * 1000; + definedAliases = [ "@pxt" ]; + }; + }; + }; + settings = { + "app.normandy.first_run" = false; + "app.shield.optoutstudies.enabled" = false; + "browser.contentblocking.category" = "strict"; + "browser.formfill.enable" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = + false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = + false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.showWeather" = false; + "browser.newtabpage.pinned" = [ + { + url = "https://millironx.com"; + label = "Home"; + baseDomain = "millironx.com"; + } + { + url = "https://nextcloud.millironx.com"; + label = "Nextcloud"; + baseDomain = "nextcloud.millironx.com"; + } + { + url = "https://code.millironx.com"; + label = "Code"; + baseDomain = "code.millironx.com"; + } + { + url = "https://video.millironx.com"; + label = "Videos"; + baseDomain = "video.millironx.com"; + } + { + url = "https://photos.millironx.com"; + label = "Photos"; + baseDomain = "photos.millironx.com"; + } + { + url = "https://vault.millironx.com"; + label = "Vault"; + baseDomain = "vault.millironx.com"; + } + { + url = "https://www.perplexity.ai/"; + label = "perplexity"; + } + { + url = + "https://www.vet.k-state.edu/academics/student-faculty-handbook/"; + } + ]; + "browser.shopping.experience2023.active" = false; + "browser.startup.homepage_override.mstone" = "ignore"; + "browser.tabs.closeWindowWithLastTab" = false; + "browser.tabs.inTitlebar" = 0; + "browser.theme.content-theme" = 0; + "browser.theme.toolbar-theme" = 0; + "browser.toolbars.bookmarks.visibility" = "never"; + "browser.uiCustomization.state" = { + placements = { + "widget-overflow-fixed-list" = [ ]; + "unified-extensions-area" = [ + "floccus_handmadeideas_org-browser-action" + "7esoorv3_alefvanoon_anonaddy_me-browser-action" + "plasma-browser-integration_kde_org-browser-action" + "firefoxpwa_filips_si-browser-action" + "_d07ccf11-c0cd-4938-a265-2a4d6ad01189_-browser-action" # Web Archives + "openwith_darktrojan_net-browser-action" + "zotero_chnm_gmu_edu-browser-action" + ]; + "nav-bar" = [ + "back-button" + "forward-button" + "customizableui-special-spring1" + "vertical-spacer" + "urlbar-container" + "stop-reload-button" + "customizableui-special-spring2" + "downloads-button" + "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" # Bitwarden + "ublock0_raymondhill_net-browser-action" + "unified-extensions-button" + "_testpilot-containers-browser-action" + ]; + "TabsToolbar" = [ + "firefox-view-button" + "tabbrowser-tabs" + "new-tab-button" + "alltabs-button" + ]; + "vertical-tabs" = [ ]; + "PersonalToolbar" = [ "import-button" "personal-bookmarks" ]; + }; + seen = [ + "save-to-pocket-button" + "developer-button" + "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" + "_testpilot-containers-browser-action" "floccus_handmadeideas_org-browser-action" "7esoorv3_alefvanoon_anonaddy_me-browser-action" "plasma-browser-integration_kde_org-browser-action" "firefoxpwa_filips_si-browser-action" - "_d07ccf11-c0cd-4938-a265-2a4d6ad01189_-browser-action" # Web Archives - "openwith_darktrojan_net-browser-action" - "zotero_chnm_gmu_edu-browser-action" - ]; - "nav-bar" = [ - "back-button" - "forward-button" - "customizableui-special-spring1" - "vertical-spacer" - "urlbar-container" - "stop-reload-button" - "customizableui-special-spring2" - "downloads-button" - "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" # Bitwarden "ublock0_raymondhill_net-browser-action" - "unified-extensions-button" - "_testpilot-containers-browser-action" + "_d07ccf11-c0cd-4938-a265-2a4d6ad01189_-browser-action" + "zotero_chnm_gmu_edu-browser-action" + "openwith_darktrojan_net-browser-action" ]; - "TabsToolbar" = [ - "firefox-view-button" - "tabbrowser-tabs" - "new-tab-button" - "alltabs-button" + dirtyAreaCache = [ + "nav-bar" + "vertical-tabs" + "PersonalToolbar" + "unified-extensions-area" ]; - "vertical-tabs" = [ ]; - "PersonalToolbar" = [ "import-button" "personal-bookmarks" ]; + currentVersion = 21; + newElementCount = 3; }; - seen = [ - "save-to-pocket-button" - "developer-button" - "_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action" - "_testpilot-containers-browser-action" - "floccus_handmadeideas_org-browser-action" - "7esoorv3_alefvanoon_anonaddy_me-browser-action" - "plasma-browser-integration_kde_org-browser-action" - "firefoxpwa_filips_si-browser-action" - "ublock0_raymondhill_net-browser-action" - "_d07ccf11-c0cd-4938-a265-2a4d6ad01189_-browser-action" - "zotero_chnm_gmu_edu-browser-action" - "openwith_darktrojan_net-browser-action" - ]; - dirtyAreaCache = [ - "nav-bar" - "vertical-tabs" - "PersonalToolbar" - "unified-extensions-area" - ]; - currentVersion = 21; - newElementCount = 3; + "browser.urlbar.suggest.showSearchSuggestionsFirst" = false; + "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; + "browser.urlbar.suggest.quicksuggest.sponsored" = false; + "browser.urlbar.suggest.quicksuggest.trending" = false; + "browser.warnOnQuitShortcut" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.usage.uploadEnabled" = false; + "extensions.formautofill.addresses.enabled" = false; + "extensions.formautofill.creditCards.enabled" = false; + "extensions.autoDisableScopes" = 0; + "network.trr.mode" = 3; # DNS over HTTPS always + "network.trr.uri" = "https://family.dns.mullvad.net/dns-query"; + "network.trr.custom_uri" = "https://family.dns.mullvad.net/dns-query"; + "privacy.bounceTrackingProtection.mode" = 1; + "privacy.clearOnShutdown_v2.browsingHistoryAndDownloads" = false; + "privacy.clearOnShutdown_v2.cache" = true; + "privacy.clearOnShutdown_v2.cookiesAndStorage" = true; + "privacy.clearOnShutdown_v2.formdata" = true; + "privacy.clearOnShutdown_v2.historyFormDataAndDownloads" = false; + "privacy.history.custom" = true; + "privacy.query_stripping.enabled" = true; + "privacy.sanitize.clearOnShutdown.hasMigratedToNewPrefs3" = true; + "privacy.sanitize.sanitizeOnShutdown" = true; + "privacy.trackingprotection.emailtracking.enabled" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.socialtracking.enabled" = true; + "widget.use-xdg-desktop-portal.file-picker" = 1; }; - "browser.urlbar.suggest.showSearchSuggestionsFirst" = false; - "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; - "browser.urlbar.suggest.quicksuggest.sponsored" = false; - "browser.urlbar.suggest.quicksuggest.trending" = false; - "browser.warnOnQuitShortcut" = false; - "datareporting.healthreport.uploadEnabled" = false; - "datareporting.usage.uploadEnabled" = false; - "extensions.formautofill.addresses.enabled" = false; - "extensions.formautofill.creditCards.enabled" = false; - "extensions.autoDisableScopes" = 0; - "network.trr.mode" = 3; # DNS over HTTPS always - "network.trr.uri" = "https://family.dns.mullvad.net/dns-query"; - "network.trr.custom_uri" = "https://family.dns.mullvad.net/dns-query"; - "privacy.bounceTrackingProtection.mode" = 1; - "privacy.clearOnShutdown_v2.browsingHistoryAndDownloads" = false; - "privacy.clearOnShutdown_v2.cache" = true; - "privacy.clearOnShutdown_v2.cookiesAndStorage" = true; - "privacy.clearOnShutdown_v2.formdata" = true; - "privacy.clearOnShutdown_v2.historyFormDataAndDownloads" = false; - "privacy.history.custom" = true; - "privacy.query_stripping.enabled" = true; - "privacy.sanitize.clearOnShutdown.hasMigratedToNewPrefs3" = true; - "privacy.sanitize.sanitizeOnShutdown" = true; - "privacy.trackingprotection.emailtracking.enabled" = true; - "privacy.trackingprotection.enabled" = true; - "privacy.trackingprotection.socialtracking.enabled" = true; - "widget.use-xdg-desktop-portal.file-picker" = 1; }; }; }; diff --git a/programs/git.nix b/programs/git.nix new file mode 100644 index 0000000..b4d790d --- /dev/null +++ b/programs/git.nix @@ -0,0 +1,45 @@ +{ ... }: { + programs.git = { + enable = true; + userName = "Thomas A. Christensen II"; + userEmail = "25492070+MillironX@users.noreply.github.com"; + extraConfig = { + core = { editor = "nvim"; }; + credential = { helper = "store"; }; + color = { ui = "auto"; }; + init = { defaultBranch = "master"; }; + column = { ui = "auto"; }; + branch = { sort = "-committerdate"; }; + tag = { sort = "version:refname"; }; + diff = { + algorithm = "histogram"; + colorMoved = "plain"; + mnemonicPrefix = true; + renames = true; + }; + push = { + default = "simple"; + autoSetupRemote = true; + followTages = true; + }; + fetch = { + prune = true; + pruneTags = true; + all = true; + }; + help = { autocorrect = "prompt"; }; + commit = { verbose = true; }; + rerere = { + enabled = true; + autoupdate = true; + }; + rebase = { + autoSquash = true; + autoStash = true; + updateRefs = true; + }; + merge = { conflictstyle = "zdiff3"; }; + pull = { rebase = true; }; + }; + }; +} diff --git a/programs/lsd.nix b/programs/lsd.nix new file mode 100644 index 0000000..a429f7b --- /dev/null +++ b/programs/lsd.nix @@ -0,0 +1,7 @@ +{ ... }: { + programs.lsd = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; +} diff --git a/programs/neovim.nix b/programs/neovim.nix new file mode 100644 index 0000000..39e6645 --- /dev/null +++ b/programs/neovim.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: { + programs.neovim = { + enable = true; + package = pkgs.neovim-unwrapped; + defaultEditor = true; + coc.enable = true; + plugins = with pkgs.vimPlugins; [ + mason-nvim + mason-lspconfig-nvim + nvim-lspconfig + nvim-dap + nvim-dap-ui + null-ls-nvim + nvim-lint + formatter-nvim + lspsaga-nvim + vim-slime + ]; + extraLuaConfig = '' + require("mason").setup() + ''; + }; +} diff --git a/programs/plasma.nix b/programs/plasma.nix index c4e1bc2..ea0b6e7 100644 --- a/programs/plasma.nix +++ b/programs/plasma.nix @@ -1,11 +1,13 @@ -{ config }: { - enable = true; - workspace = { - wallpaperFillMode = "preserveAspectCrop"; - wallpaperSlideShow = { - interval = 86400; - path = - "${config.home.homeDirectory}/Nextcloud/Pictures/Desktop backgrounds/"; +{ config, ... }: { + programs.plasma = { + enable = true; + workspace = { + wallpaperFillMode = "preserveAspectCrop"; + wallpaperSlideShow = { + interval = 86400; + path = + "${config.home.homeDirectory}/Nextcloud/Pictures/Desktop backgrounds/"; + }; }; }; } diff --git a/programs/shells.nix b/programs/shells.nix new file mode 100644 index 0000000..96ea730 --- /dev/null +++ b/programs/shells.nix @@ -0,0 +1,42 @@ +{ pkgs, ... }: +let + conda_init = shell: '' + eval "$(${pkgs.micromamba}/bin/micromamba shell hook --shell ${shell})" + + ''; + nd_bash_function = '' + function nd() { + mkdir -p "$1" && cd "$1" + } + + ''; +in { + programs = { + bash = { + enable = true; + initExtra = conda_init "bash" + nd_bash_function + '' + export PS1="[\[\e[32m\]\u\[\e[m\]@\[\e[33m\]\h\[\e[m\] \[\e[34m\]\W\[\e[m\]] \\$ " + ''; + }; + zsh = { + enable = true; + autosuggestion.enable = true; + enableCompletion = true; + completionInit = + "autoload -U compinit && compinit; autoload -U bashcompinit && bashcompinit"; + antidote = { + enable = true; + plugins = [ + "getantidote/use-omz" + "ohmyzsh/ohmyzsh path:lib" + "ohmyzsh/ohmyzsh path:plugins/git" + "ohmyzsh/ohmyzsh path:plugins/extract" + "zsh-users/zsh-syntax-highlighting" + "zsh-users/zsh-autosuggestions" + "zsh-users/zsh-completions" + ]; + }; + initContent = conda_init "zsh" + nd_bash_function; + }; + }; +} diff --git a/programs/starship.nix b/programs/starship.nix index 68543b0..a1cd04a 100644 --- a/programs/starship.nix +++ b/programs/starship.nix @@ -1,88 +1,89 @@ -{ lib }: +{ lib, ... }: let language-format-string = "[$symbol($version )]($style)"; in { - - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - settings = { - add_newline = false; - format = lib.concatStrings [ - "$os" - " " - "($container )" - "($direnv)" - "\\[" - "([$username](bold yellow)@[$hostname](bold red) )" - "[$directory](cyan)" - "($git_branch$git_commit$git_state$git_metrics$git_status)" - "\\] " - "($conda$nix_shell)" - "($julia$nodejs$python$quarto$rlang$ruby)" - "($shell)" - "$character" - ]; - right_format = lib.concatStrings [ "$cmd_duration" "$battery" ]; - character = { - success_symbol = "[\\$](bold green)"; - error_symbol = "[\\$](bold red)"; - }; - conda = { format = "[$symbol$environment]($style) "; }; - direnv = { - disabled = false; - allowed_msg = ""; - not_allowed_msg = ""; - denied_msg = ""; - loaded_msg = ""; - unloaded_msg = ""; - symbol = " "; - }; - git_metrics = { disabled = false; }; - git_status = { - # Remove trailing space from format string - format = "([\\[$all_status$ahead_behind\\]]($style))"; - }; - hostname = { format = "[$hostname]($style)"; }; - julia = { format = language-format-string; }; - nix_shell = { - symbol = ""; - impure_msg = "/󰓑"; - pure_msg = "/󱕦"; - format = "[$symbol$state( ($name))]($style) "; - }; - nodejs = { format = language-format-string; }; - os = { - disabled = false; - symbols = { - AlmaLinux = ""; - Alpine = ""; - CentOS = ""; - Debian = ""; - Fedora = ""; - Macos = ""; - NixOS = ""; + programs.starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + settings = { + add_newline = false; + format = lib.concatStrings [ + "$os" + " " + "($container )" + "($direnv)" + "\\[" + "([$username](bold yellow)@[$hostname](bold red) )" + "[$directory](cyan)" + "($git_branch$git_commit$git_state$git_metrics$git_status)" + "\\] " + "($conda$nix_shell)" + "($julia$nodejs$python$quarto$rlang$ruby)" + "($shell)" + "$character" + ]; + right_format = lib.concatStrings [ "$cmd_duration" "$battery" ]; + character = { + success_symbol = "[\\$](bold green)"; + error_symbol = "[\\$](bold red)"; }; + conda = { format = "[$symbol$environment]($style) "; }; + direnv = { + disabled = false; + allowed_msg = ""; + not_allowed_msg = ""; + denied_msg = ""; + loaded_msg = ""; + unloaded_msg = ""; + symbol = " "; + }; + git_metrics = { disabled = false; }; + git_status = { + # Remove trailing space from format string + format = "([\\[$all_status$ahead_behind\\]]($style))"; + }; + hostname = { format = "[$hostname]($style)"; }; + julia = { format = language-format-string; }; + nix_shell = { + symbol = ""; + impure_msg = "/󰓑"; + pure_msg = "/󱕦"; + format = "[$symbol$state( ($name))]($style) "; + }; + nodejs = { format = language-format-string; }; + os = { + disabled = false; + symbols = { + AlmaLinux = ""; + Alpine = ""; + CentOS = ""; + Debian = ""; + Fedora = ""; + Macos = ""; + NixOS = ""; + }; + }; + python = { + format = + "[\${symbol}\${pyenv_prefix}(\${version} )(($virtualenv) )]($style)"; + symbol = ""; + }; + quarto = { format = language-format-string; }; + rlang = { + format = language-format-string; + symbol = ""; + }; + ruby = { + format = language-format-string; + symbol = ""; + }; + shell = { + # Show which shell if not using zsh (the default) + disabled = false; + zsh_indicator = ""; + style = "yellow bold"; + }; + username = { format = "[$user]($style)"; }; }; - python = { - format = - "[\${symbol}\${pyenv_prefix}(\${version} )(($virtualenv) )]($style)"; - symbol = ""; - }; - quarto = { format = language-format-string; }; - rlang = { - format = language-format-string; - symbol = ""; - }; - ruby = { - format = language-format-string; - symbol = ""; - }; - shell = { - # Show which shell if not using zsh (the default) - disabled = false; - zsh_indicator = ""; - style = "yellow bold"; - }; - username = { format = "[$user]($style)"; }; }; } diff --git a/programs/zed.nix b/programs/zed.nix index f53478f..8917582 100644 --- a/programs/zed.nix +++ b/programs/zed.nix @@ -1,81 +1,83 @@ -{ - enable = true; - extensions = [ - "basher" - "clojure" - "cspell" - "dockerfile" - "earthfile" - "git-firefly" - "html" - "julia" - "latex" - "macos-classic" - "nix" - "r" - "toml" - "xml" - ]; - userSettings = { - agent = { - default_model = { - provider = "copilot_chat"; - model = "gpt-4o"; - }; - }; - auto_install_extensions = { - basher = true; - clojure = true; - cspell = true; - dockerfile = true; - earthfile = true; - git-firefly = true; - html = true; - julia = true; - latex = true; - macos-classic = true; - nix = true; - r = true; - toml = true; - xml = true; - }; - buffer_font_family = "FiraCode Nerd Font"; - buffer_font_size = 11; - features = { edit_prediction_provider = "zed"; }; - languages = { - Julia = { - formatter = { - external = { - command = "julia"; - arguments = [ - "-e" - "using JuliaFormatter; print(format_text(String(read(stdin))));" - ]; - }; +{ ... }: { + programs.zed-editor = { + enable = true; + extensions = [ + "basher" + "clojure" + "cspell" + "dockerfile" + "earthfile" + "git-firefly" + "html" + "julia" + "latex" + "macos-classic" + "nix" + "r" + "toml" + "xml" + ]; + userSettings = { + agent = { + default_model = { + provider = "copilot_chat"; + model = "gpt-4.1"; }; }; - LaTeX = { - formatter = { - external = { - command = "tex-fmt"; - arguments = [ "--stdin" ]; + auto_install_extensions = { + basher = true; + clojure = true; + cspell = true; + dockerfile = true; + earthfile = true; + git-firefly = true; + html = true; + julia = true; + latex = true; + macos-classic = true; + nix = true; + r = true; + toml = true; + xml = true; + }; + buffer_font_family = "FiraCode Nerd Font"; + buffer_font_size = 11; + features = { edit_prediction_provider = "zed"; }; + languages = { + Julia = { + formatter = { + external = { + command = "julia"; + arguments = [ + "-e" + "using JuliaFormatter; print(format_text(String(read(stdin))));" + ]; + }; }; }; + LaTeX = { + formatter = { + external = { + command = "tex-fmt"; + arguments = [ "--stdin" ]; + }; + }; + }; + Nix = { formatter = { external = { command = "nixfmt"; }; }; }; }; - Nix = { formatter = { external = { command = "nixfmt"; }; }; }; + preview_tabs = { enabled = false; }; + ssh_connections = [{ + host = "anderson"; + projects = [{ paths = [ "/var/docker" ]; }]; + }]; + show_edit_predictions = false; + terminal = { + font_family = "MesloLGS NF"; + font_size = 10; + }; + theme = "macOS Classic Dark2"; + ui_font_size = 16; + wrap_guides = [ 80 92 120 ]; }; - preview_tabs = { enabled = false; }; - ssh_connections = [{ - host = "anderson"; - projects = [{ paths = [ "/var/docker" ]; }]; - }]; - show_edit_predictions = false; - terminal = { - font_family = "MesloLGS NF"; - font_size = 10; - }; - theme = "macOS Classic Dark2"; - ui_font_size = 16; - wrap_guides = [ 80 92 120 ]; }; } diff --git a/services/gpg-agent.nix b/services/gpg-agent.nix new file mode 100644 index 0000000..e34906a --- /dev/null +++ b/services/gpg-agent.nix @@ -0,0 +1,11 @@ +{ ... }: { + services.gpg-agent = { + enable = true; + enableBashIntegration = true; + enableSshSupport = true; + enableZshIntegration = true; + defaultCacheTtl = 604800; + maxCacheTtl = 604800; + verbose = true; + }; +} diff --git a/services/pihole.nix b/services/pihole.nix index 4246c64..ed4cd19 100644 --- a/services/pihole.nix +++ b/services/pihole.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { age.secrets = { @@ -9,8 +9,7 @@ }; }; virtualisation = { - quadlet = let inherit (config.virtualisation.quadlet) networks pods; - in { + quadlet = { containers = { pihole = { containerConfig = {