summaryrefslogtreecommitdiff
path: root/home-manager
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager')
-rw-r--r--home-manager/default.nix1
-rw-r--r--home-manager/firefox.nix4
-rw-r--r--home-manager/neovim.nix108
-rw-r--r--home-manager/resources/firefox/userChrome.css175
4 files changed, 2 insertions, 286 deletions
diff --git a/home-manager/default.nix b/home-manager/default.nix
index 8d9c722..226552a 100644
--- a/home-manager/default.nix
+++ b/home-manager/default.nix
@@ -6,7 +6,6 @@
./home-cleanup.nix
./htop.nix
./mint-theme.nix
- ./neovim.nix
./pcmanfm.nix
./qt-gtk-theme.nix
./theme-st.nix
diff --git a/home-manager/firefox.nix b/home-manager/firefox.nix
index 7c95e56..119ff35 100644
--- a/home-manager/firefox.nix
+++ b/home-manager/firefox.nix
@@ -1,4 +1,4 @@
-{ config, lib, pkgs, ... }: let
+{ config, lib, pkgs, inputs, ... }: let
cfg = config.programs.firefox;
search = {
engines = {
@@ -30,7 +30,7 @@
privateDefault = "Timmy Search";
force = true; # Overwrite old
};
- userChrome = builtins.readFile ./resources/firefox/userChrome.css;
+ userChrome = inputs.firefox-userchrome.userChrome;
uiCustomization = {
placements = {
nav-bar = [
diff --git a/home-manager/neovim.nix b/home-manager/neovim.nix
deleted file mode 100644
index 6bb13d7..0000000
--- a/home-manager/neovim.nix
+++ /dev/null
@@ -1,108 +0,0 @@
-{ lib, config, pkgs, ... }: let
- cfg = config.programs._neovim;
-
- pluginDir = let
- extraPlugins = cfg.plugins.packages // {
- start = (cfg.plugins.packages.start or [])
- ++ lib.optionals (cfg.plugins.lsp.enable && cfg.plugins.lsp.lspconfig.enable) [ cfg.plugins.lsp.lspconfig.pluginPackage ]
- ++ lib.optionals cfg.plugins.treesitter.enable [ cfg.plugins.treesitter.pluginPackage ];
- };
- in pkgs.linkFarm "nvim-site"
- (lib.concatLists (lib.mapAttrsToList (stage: plugins:
- map (plugin: {
- name = "share/nvim/site/pack/plugins/${stage}/${plugin.name}";
- path = plugin;
- }) plugins
- ) extraPlugins));
-
- extraPackages = pkgs.symlinkJoin {
- name = "nvim-extra-packages";
- paths = cfg.extraPackages
- ++ lib.optionals cfg.plugins.lsp.enable cfg.plugins.lsp.languageServers.packages;
- };
-
- parserDir = let
- allTSParserPackages = builtins.filter lib.isDerivation
- (builtins.attrValues cfg.plugins.treesitter.parsers.installAllFromPackageSet);
- in pkgs.symlinkJoin {
- name = "nvim-treesitter-parsers";
- paths = if cfg.plugins.treesitter.parsers.installAll then allTSParserPackages else cfg.plugins.treesitter.parsers.packages;
- };
-
- finalPackage = pkgs.symlinkJoin {
- name = "neovim-not-wrapped";
- paths = [ cfg.package ];
- nativeBuildInputs = [ pkgs.makeWrapper ];
- postBuild = ''
- wrapProgram $out/bin/nvim \
- --prefix PATH : ${extraPackages}/bin \
- --prefix XDG_DATA_DIRS : ${pluginDir}/share \
- '' + lib.optionalString cfg.plugins.treesitter.enable ''
- --add-flags '--cmd "set rtp^=${parserDir}"' \
- --add-flags '--cmd "set rtp^=${cfg.plugins.treesitter.pluginPackage}/runtime"' \
- '' + ''
- # blank line here to terminate multiline command string
- '' + lib.optionalString cfg.viAlias ''
- ln -s $out/bin/nvim $out/bin/vi
- '' + lib.optionalString cfg.vimAlias ''
- ln -s $out/bin/nvim $out/bin/vim
- '';
- };
-in {
- options.programs._neovim = {
- enable = lib.mkEnableOption "install and configure neovim";
- package = lib.mkPackageOption pkgs "neovim" {};
- viAlias = lib.mkEnableOption "alias vi => nvim";
- vimAlias = lib.mkEnableOption "alias vim => nvim";
- plugins = {
- lsp = {
- enable = lib.mkEnableOption "install defined language servers into nvim path";
- lspconfig = {
- enable = lib.mkEnableOption "install plugin `lspconfig.pluginPackage`";
- pluginPackage = lib.mkPackageOption pkgs.vimPlugins "nvim-lspconfig" {};
- };
- languageServers.packages = lib.mkOption {
- type = lib.types.listOf lib.types.package;
- default = [ ];
- description = "language server packages to add to nvim path when lsp is enabled";
- };
- };
- treesitter = {
- enable = lib.mkEnableOption "install treesitter and parsers as nvim plugins";
- pluginPackage = lib.mkPackageOption pkgs.vimPlugins "nvim-treesitter" {};
- parsers.installAll = lib.mkEnableOption "install all available parsers. overrides `parsers.packages`";
- parsers.installAllFromPackageSet = lib.mkOption {
- type = lib.types.attrsOf lib.types.anything;
- default = pkgs.vimPlugins.nvim-treesitter-parsers;
- defaultText = lib.literalExpression "pkgs.vimPlugins.nvim-treesitter-parsers";
- description = "parent package from which to install all treesitter parsers";
- };
- parsers.packages = lib.mkOption {
- type = lib.types.listOf lib.types.package;
- default = [ ];
- description = "treesitter parsers to install as plugins";
- };
- };
- packages = lib.mkOption {
- type = lib.types.attrsOf (lib.types.listOf lib.types.package);
- default = [ ];
- example = {
- start = with pkgs.vimPlugins; [
- nvim-colorizer-lua
- ];
- };
- description = "extra plugins to be made available to nvim via packpath, organized by stage";
- };
- };
- extraPackages = lib.mkOption {
- type = lib.types.listOf lib.types.package;
- default = [ ];
- description = "extra packages to add to nvim path";
- };
- };
-
- config = lib.mkIf cfg.enable {
- # NOTE: Don't use programs.neovim since that will build neovim from source
- home.packages = [ finalPackage ];
- };
-}
diff --git a/home-manager/resources/firefox/userChrome.css b/home-manager/resources/firefox/userChrome.css
deleted file mode 100644
index 7ec4588..0000000
--- a/home-manager/resources/firefox/userChrome.css
+++ /dev/null
@@ -1,175 +0,0 @@
-/* TODO create separate repo for this */
-/* TOP BAR */
-#navigator-toolbox {
- --uc-navigationbar-width: 40vw;
-
- #TabsToolbar {
- /* Move new tab to far right */
- #tabbrowser-arrowscrollbox-periphery { margin-left: auto }
- /* remove alltabs button */
- #alltabs-button { display: none }
- }
-
- #nav-bar {
- /* Remove overflow button */
- #nav-bar-overflow-button { display: none }
- }
-
- #PersonalToolbar {
- /* Change background color of bookmarks toolbar */
- background: var(--toolbox-bgcolor) !important;
- /* Adjust spacing of toolbar items */
- #PlacesToolbarItems { gap: .35rem; margin-block: .2rem }
- }
-}
-
-/* Media queries for width of nav bar */
-@media screen and (max-width: 1000px) {
- #navigator-toolbox { --uc-navigationbar-width: 50vw }
-}
-@media screen and (max-width: 800px) {
- #navigator-toolbox { --uc-navigationbar-width: 60vw }
-}
-
-/* Change look of tabs in smaller view */
-@media screen and (max-width: 800px) {
- #TabsToolbar-customization-target {
- /* TODO fix w/o. Don't allow tabbar to move up when moving tabs */
- height: 37px;
- /* Make tabs fill more vertical space */
- .tab-background { margin-block: 1px !important }
- }
-}
-
-
-/* COMBINE TOP BAR */
-/* Combine top bar into single line if width >= 800px */
-@media screen and (min-width: 800px) {
- /* Half height bar */
- :root { --uc-toolbar-height: 36px }
-
- /* Modify these to change relative widths or default height */
- #navigator-toolbox {
- margin-bottom: 0px;
- padding-top: 1px; /* Top bar is cut off otherwise */
-
- #TabsToolbar {
- margin-left: calc(var(--uc-navigationbar-width) + 2px); /* Resize tab bar */
- margin-top: -4px;
- margin-bottom: 2px;
-
- #TabsToolbar-customization-target {
- height: var(--uc-toolbar-height);
-
- /* Tabs extend to bottom of bar */
- .tab-background {
- margin-bottom: 0 !important;
- margin-top: 3px !important; /* See above navigator-toolbox rule. Avoid cutting off top */
- }
-
- /* 1px margin on touch density causes tabs to be too high */
- .tab-close-button { margin-top: 0 !important }
- }
-
- /* Center tab buttons */
- #tabs-newtab-button, #alltabs-button { margin-top: 4px !important }
- }
-
- /* Integrate url / nav bar */
- #nav-bar {
- margin-right:calc(100vw - var(--uc-navigationbar-width));
- margin-top: calc(0px - var(--uc-toolbar-height));
- border-radius: 0 var(--tab-border-radius) var(--tab-border-radius) 0;
- border-right: 1px solid ThreeDShadow !important;
- box-shadow: 0 0 4px rgba(0,0,0,.4) !important;
- /* Fix spacing around tabs by removing nav bar top border */
- border: none !important;
-
- #urlbar-container {
- /* Remove min and max width of urlbar */
- width: 0 !important;
- /* Make opened urlbar overlay the toolbar */
- #urlbar[open]:focus-within { min-width: 50vw !important }
- }
- }
-
- /* Bottom of tags is cut off by 1px without this */
- #PersonalToolbar { margin-top: 1px }
- }
-
- /* Fix customization view */
- #customization-panelWrapper .panel-arrowbox .panel-arrow {
- margin-inline-end: initial !important;
- }
-
- /* Shorten findbar */
- findbar {
- width: 600px !important;
- border-radius: 0 0 0 5px;
- border-bottom: none !important;
- box-shadow: 0 2px 4px rgba(0,0,0,.4); /* Move down 2px so it doesn't go over the tab bar */
- }
-}
-
-
-/* FINDBAR */
-findbar {
- width: 100vw;
- position: absolute;
- top: 0;
- right: 0;
- padding: 0 !important;
- padding-top: 1px !important;
- background: -moz-headerbar Field !important;
- border-top-width: 0px !important;
- border-bottom: 1px solid ThreeDShadow;
-
- .findbar-container {
- padding-bottom: 5px !important; /* Move search bar closer to left edge */
- padding-top: 2px !important; /* Move search bar closer to left edge */
- height: max-content !important;
- gap: 2px;
- justify-content: space-between;
- flex-wrap: wrap;
-
- /* Force textbox to fill up first line */
- .findbar-textbox {
- width: 100% !important;
- background: Field !important; /* Set the background color to be consistent with found-matches label when unfocused */
- }
-
- description {
- /* Hide description showing wrap conditions etc. */
- display: none;
- /* Show description when it says "Phrase Not Found" */
- &[status=notfound] { display: inline-block }
- }
-
- /* Move found matches label (roughly) into the textbox */
- label.found-matches,
- description {
- position: absolute;
- top: 6.5px;
- right: 110px;
- color: color-mix(in srgb, -moz-headerbartext, transparent 46%) !important;
- /* So this text overrides the text below, TODO find a more elegant solution */
- padding-inline: 1ex;
- background: Field;
- }
-
- /* Force checkboxes onto second line */
- hbox { width: 100% }
- }
-}
-
-
-/* BOOKMARK BAR */
-@-moz-document url(chrome://browser/content/browser.xhtml) {
- #PersonalToolbar {
- background: -moz-headerbar Field !important;
- border-top: 1px solid ThreeDShadow !important;
- z-index: 1000; /* To not be affected by shadow from navbar */
- /* Space out bookmark items */
- .bookmark-item .toolbarbutton-text { padding: 2.5px 4px }
- }
-}