diff options
Diffstat (limited to 'share/cfg')
| -rw-r--r-- | share/cfg/default.nix | 17 | ||||
| -rw-r--r-- | share/cfg/firefox/default.nix | 63 | ||||
| -rw-r--r-- | share/cfg/firefox/usercss/compact-about-config.css | 24 | ||||
| -rw-r--r-- | share/cfg/firefox/usercss/context-menu.css | 12 | ||||
| -rw-r--r-- | share/cfg/firefox/usercss/tab-separator-lines.css | 23 | ||||
| -rw-r--r-- | share/cfg/firefox/usercss/unified-extensions-view.css | 46 | ||||
| -rw-r--r-- | share/cfg/fish.nix | 7 | ||||
| -rw-r--r-- | share/cfg/gallery-dl.nix | 31 | ||||
| -rw-r--r-- | share/cfg/git.nix | 11 | ||||
| -rw-r--r-- | share/cfg/helix.nix | 52 | ||||
| -rw-r--r-- | share/cfg/kitty.nix | 25 | ||||
| -rw-r--r-- | share/cfg/mpv.nix | 10 | ||||
| -rw-r--r-- | share/cfg/shellenv.nix | 48 | ||||
| -rw-r--r-- | share/cfg/tofi.nix | 38 | ||||
| -rw-r--r-- | share/cfg/waybar.css | 271 | ||||
| -rw-r--r-- | share/cfg/waybar.nix | 50 | ||||
| -rw-r--r-- | share/cfg/wpaperd.nix | 14 |
17 files changed, 742 insertions, 0 deletions
diff --git a/share/cfg/default.nix b/share/cfg/default.nix new file mode 100644 index 0000000..1415377 --- /dev/null +++ b/share/cfg/default.nix @@ -0,0 +1,17 @@ +{ ... }: { + imports = [ + ../hm-modules + + ./wpaperd.nix + ./tofi.nix + ./waybar.nix + ./git.nix + ./mpv.nix + ./kitty.nix + ./firefox + ./helix.nix + ./gallery-dl.nix + ./fish.nix + ./shellenv.nix + ]; +} diff --git a/share/cfg/firefox/default.nix b/share/cfg/firefox/default.nix new file mode 100644 index 0000000..07281ec --- /dev/null +++ b/share/cfg/firefox/default.nix @@ -0,0 +1,63 @@ +{ pkgs, ... }: +let + # Concatenate all files in the `./usercss` directory into one string + css-files = + map (n: ./usercss/${n}) (builtins.attrNames (builtins.readDir ./usercss)); + userChrome = builtins.concatStringsSep "\n" (map builtins.readFile css-files); +in +{ + home.sessionVariables.BROWSER = "firefox"; + + programs.firefox = { + profiles = { + alice = { + name = "alice"; + isDefault = true; + inherit userChrome; + + search = { + default = "DuckDuckGo"; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + }]; + + icon = + "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ + template = "https://nixos.wiki/index.php?search={searchTerms}"; + }]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + # builtin engines only support specifying one additional alias + "Google".medaData.alias = "@g"; + }; + }; # end of search + + settings = { + "browser.compactmode.show" = true; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; + }; # end of alice (profile) + }; # end of profiles + }; +} diff --git a/share/cfg/firefox/usercss/compact-about-config.css b/share/cfg/firefox/usercss/compact-about-config.css new file mode 100644 index 0000000..55e30f7 --- /dev/null +++ b/share/cfg/firefox/usercss/compact-about-config.css @@ -0,0 +1,24 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/content/compact_about_config.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Makes about:config list more compact */ + +@-moz-document url("about:config"){ + .button-delete, + .button-edit, + .button-reset, + .button-save, + .button-toggle{ + margin-block: 1px !important; + padding-block: 11px 0 !important; + padding-inline: 0 !important; + min-height: 22px !important; + width: 22px !important; + outline-offset: 0 !important; + } + .cell-edit{ width: 28px !important; } + form > input, + tr:not(.add) > th, + tr:not(.add) > .cell-value{ padding-block: 0 !important; } + tr:not(:hover) .semi-transparent:not(.primary,.button-add){ background-color: transparent !important; } +} diff --git a/share/cfg/firefox/usercss/context-menu.css b/share/cfg/firefox/usercss/context-menu.css new file mode 100644 index 0000000..0bf5749 --- /dev/null +++ b/share/cfg/firefox/usercss/context-menu.css @@ -0,0 +1,12 @@ +/*** Remove items from image context menu ***/ +#context-sendimage, /* Email image */ +#context-inspect-a11y, +#context-savelinktopocket, +#context-pocket, +#context-savepage, +#context-print-selection, /* Print selected text */ +#context-selectall, +#context-sep-selectall /* Seperator bar */ +{ + display: none !important; +} diff --git a/share/cfg/firefox/usercss/tab-separator-lines.css b/share/cfg/firefox/usercss/tab-separator-lines.css new file mode 100644 index 0000000..2f77db4 --- /dev/null +++ b/share/cfg/firefox/usercss/tab-separator-lines.css @@ -0,0 +1,23 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/tab_separator_lines.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Bring back tab separator lines that were removed in Proton */ + +.tabbrowser-tab{ + border-inline-start: 1px solid transparent !important; + border-image: 0 1 linear-gradient( + transparent 20%, + color-mix(in srgb, currentColor 20%, transparent) 20%, + color-mix(in srgb, currentColor 20%, transparent) 80%, + transparent 80% + ) !important; +} + +.tabbrowser-tab:hover, +#tabbrowser-tabs:not([movingtab]) .tabbrowser-tab:hover + .tabbrowser-tab:not([first-visible-unpinned-tab]), +.tabbrowser-tab:first-child, +.tabbrowser-tab[selected], +.tabbrowser-tab[multiselected], +#tabbrowser-arrowscrollbox[overflowing] > .tabbrowser-tab[first-visible-unpinned-tab], +#tabbrowser-tabs:not([movingtab]) .tabbrowser-tab[multiselected] + .tabbrowser-tab, +#tabbrowser-tabs:not([movingtab]) .tabbrowser-tab[selected] + .tabbrowser-tab { border-image: none !important; }
\ No newline at end of file diff --git a/share/cfg/firefox/usercss/unified-extensions-view.css b/share/cfg/firefox/usercss/unified-extensions-view.css new file mode 100644 index 0000000..876a7d0 --- /dev/null +++ b/share/cfg/firefox/usercss/unified-extensions-view.css @@ -0,0 +1,46 @@ +/*** Clean and tight extensions menu ***/ +#unified-extensions-view { + --uei-icon-size: 20px; +} + +#unified-extensions-view .panel-header, +#unified-extensions-view .panel-header + toolbarseparator, +#unified-extensions-view .panel-subview-body + toolbarseparator, +#unified-extensions-view #unified-extensions-manage-extensions { + display:none !important; +} + +#unified-extensions-view .unified-extensions-item-menu-button.subviewbutton { + visibility: hidden !important; + transition: 300ms !important; + -moz-margin-end: -3.6em !important; +} + +#unified-extensions-view .panel-subview-body { + padding-top: 8px !important; + padding-bottom: 8px !important; +} + +#unified-extensions-view:hover +.unified-extensions-item-menu-button.subviewbutton { + visibility: visible !important; + transition: 300ms !important; + -moz-margin-end: initial !important; +} + +#unified-extensions-view .unified-extensions-item .unified-extensions-item-icon, +#unified-extensions-view .unified-extensions-item .toolbarbutton-badge-stack { + margin-inline-end: 2px !important; +} + +#unified-extensions-view .unified-extensions-item-name, +#unified-extensions-view .unified-extensions-item-message { + padding-inline-start: 0.5em !important; + width: 21em !important; +} + +#unified-extensions-view .unified-extensions-item-action-button.subviewbutton { + padding-top: 2px !important; + padding-bottom: 2px !important; +} + diff --git a/share/cfg/fish.nix b/share/cfg/fish.nix new file mode 100644 index 0000000..d697942 --- /dev/null +++ b/share/cfg/fish.nix @@ -0,0 +1,7 @@ +{ ... }: { + imports = [ ./shellenv.nix ]; + + programs.starship.enableFishIntegration = true; + programs.atuin.enableFishIntegration = true; + programs.nix-index.enableFishIntegration = true; +} diff --git a/share/cfg/gallery-dl.nix b/share/cfg/gallery-dl.nix new file mode 100644 index 0000000..320061b --- /dev/null +++ b/share/cfg/gallery-dl.nix @@ -0,0 +1,31 @@ +{ config, ... }: { + programs.gallery-dl = { + settings.extractor = { + base-directory = "${config.xdg.userDirs.download}/gallery-dl"; + + postprocessors = [ + { + name = "metadata"; + mode = "json"; + whitelist = [ + "danbooru" + "moebooru" + "gelbooru" + "sankaku" + "nhentai" + "rule34" + ]; + } + { + name = "zip"; + compression = "store"; + extension = "cbz"; + filter = "extension not in ('zip', 'rar')"; + whitelist = [ "nhentai" "mangadex" ]; + } + ]; + + Danbooru.metadata = true; + }; # End of settings.extractor + }; # End of programs.gallery-dl +} diff --git a/share/cfg/git.nix b/share/cfg/git.nix new file mode 100644 index 0000000..67170a0 --- /dev/null +++ b/share/cfg/git.nix @@ -0,0 +1,11 @@ +{ ... }: { + programs.git = { + userEmail = "miran.bastaja04@gmail.com"; + userName = "Miran Bastaja"; + signing = { + key = "002426427AE095E093D51B3EF42E936D529F5760"; + signByDefault = true; + }; + delta.enable = true; + }; +} diff --git a/share/cfg/helix.nix b/share/cfg/helix.nix new file mode 100644 index 0000000..55b6f76 --- /dev/null +++ b/share/cfg/helix.nix @@ -0,0 +1,52 @@ +{ pkgs, ... }: { + programs.helix = { + extraPackages = with pkgs; [ + rust-analyzer + rustfmt + nil + nixfmt-rfc-style + python311Packages.python-lsp-server + clang-tools + black + nodePackages.vscode-html-languageserver-bin + emmet-ls + ]; + + settings = { + theme = "tokyonight"; + editor = { + line-number = "relative"; + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + whitespace.render = { + space = "all"; + tab = "all"; + newline = "none"; + }; + whitespace.characters = { + space = "·"; + nbsp = "⍽"; + tab = "→"; + newline = "⏎"; + tabpad = "·"; # Tabs will look like "→···" (depending on tab width) + }; + cursorline = true; + lsp.display-messages = true; + }; + }; + + languages = { + language-server.emmet-ls = { + args = [ "--stdio" ]; + command = "emmet-ls"; + }; + language = [{ + name = "html"; + language-servers = [ "vscode-html-language-server" "emmet-ls" ]; + }]; + }; + }; +} diff --git a/share/cfg/kitty.nix b/share/cfg/kitty.nix new file mode 100644 index 0000000..efe01e0 --- /dev/null +++ b/share/cfg/kitty.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: { + programs.kitty = { + theme = "Mayukai"; + + font = { + package = pkgs.nerdfonts.override { fonts = [ "AnonymousPro" ]; }; + name = "AnonymousPro"; + size = 10; + }; + + settings = { cursor_shape = "beam"; }; + + keybindings = { + "ctrl+tab" = "new_tab"; + + "alt+1" = "goto_tab 1"; + "alt+2" = "goto_tab 2"; + "alt+3" = "goto_tab 3"; + "alt+4" = "goto_tab 4"; + "alt+5" = "goto_tab 5"; + }; + }; + + home.shellAliases = { s = "kitty +kitten ssh"; }; +} diff --git a/share/cfg/mpv.nix b/share/cfg/mpv.nix new file mode 100644 index 0000000..427ed33 --- /dev/null +++ b/share/cfg/mpv.nix @@ -0,0 +1,10 @@ +{ config, ... }: { + programs.mpv = { + config = { + # The format is '<Filename without extension> [<screenshot number>].<ext>' + # Read more about it at: https://mpv.io/manual/master/#screenshot + screenshot-template = "%F [%n]"; + screenshot-directory = "${config.xdg.userDirs.pictures}/Screenshots/mpv"; + }; + }; +} diff --git a/share/cfg/shellenv.nix b/share/cfg/shellenv.nix new file mode 100644 index 0000000..16b28ac --- /dev/null +++ b/share/cfg/shellenv.nix @@ -0,0 +1,48 @@ +{ ... }: { + home.shellAliases = { + ltg = "ls --git --tree"; + ltgi = "ltg --git-ignore"; + }; + programs.eza = { + icons = true; + extraOptions = [ "--header" "--group-directories-first" "--long" ]; + }; + + programs.starship = { + # settings = let + # lightblue-bg = "bg:#769ff0"; + # lightblue-fg = "fg:#e3e5e5"; + # lightblue = "${lightblue-fg} ${lightblue-bg}"; + # in { + # format = lib.concatStrings [ + # "[░▒▓](#a3aed2)" + # "[$username @ $hostname](${lightblue})" + # "$directory" + # "$rust" + # "$package" + # "\n" + # "> " + # ]; + # + # hostname = { + # ssh_only = false; + # format = "[$hostname]($style)"; + # trim_at = ""; # disable trimming + # style = lightblue; + # }; + # + # username = { + # show_always = true; + # format = "[$user]($style)"; + # style_user = lightblue; + # style_root = "${lightblue-bg} fg:red bold"; + # }; + # + # directory = { + # format = "[ $path ]($style)"; + # truncation_length = 3; + # truncation_symbol = "…/"; + # }; + # }; # end of settings + }; # end of programs.starship +} diff --git a/share/cfg/tofi.nix b/share/cfg/tofi.nix new file mode 100644 index 0000000..e4f2ff9 --- /dev/null +++ b/share/cfg/tofi.nix @@ -0,0 +1,38 @@ +# IMPORTANT: this is the config for a custom module that's located at +# /share/hm-modules/tofi.nix. In order to use this config you have to also +# import that module. +{ lib, config, ... }: { + + # Tofi's cache seems to get messed up sometimes, so we regenerate it when + # building the system. + # https://github.com/philj56/tofi/issues/115#issuecomment-1701748297 + home.activation = { + regenerateTofiCache = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + tofi_cache=${config.xdg.cacheHome}/tofi-drun + [[ -f "$tofi_cache" ]] && rm "$tofi_cache" + ''; + }; + + programs.tofi = { + settings = { + anchor = "top"; + width = "100%"; + height = 30; + horizontal = true; + font-size = 14; + prompt-text = " run: "; + font = "monospace"; + outline-width = 0; + border-width = 0; + background-color = "#000000"; + min-input-width = 120; + result-spacing = 15; + padding-top = 0; + padding-right = 0; + padding-bottom = 0; + padding-left = 0; + drun-launch = true; + terminal = "kitty"; + }; + }; +} diff --git a/share/cfg/waybar.css b/share/cfg/waybar.css new file mode 100644 index 0000000..c2213cb --- /dev/null +++ b/share/cfg/waybar.css @@ -0,0 +1,271 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button { + padding: 0; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#power-profiles-daemon, +#mpd { + padding: 0; + color: #ffffff; +} + +#window { + margin: 0 4px; +} + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +/* Using steps() instead of linear as a timing function to limit cpu usage */ +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: steps(12); + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#power-profiles-daemon { + padding-right: 15px; +} + +#power-profiles-daemon.performance { + background-color: #f53c3c; + color: #ffffff; +} + +#power-profiles-daemon.balanced { + background-color: #2980b9; + color: #ffffff; +} + +#power-profiles-daemon.power-saver { + background-color: #2ecc71; + color: #000000; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad.empty { + background-color: transparent; +} + +#privacy { + padding: 0; +} + +#privacy-item { + padding: 0 5px; + color: white; +} + +#privacy-item.screenshare { + background-color: #cf5700; +} + +#privacy-item.audio-in { + background-color: #1ca000; +} + +#privacy-item.audio-out { + background-color: #0069d4; +} diff --git a/share/cfg/waybar.nix b/share/cfg/waybar.nix new file mode 100644 index 0000000..9df08b2 --- /dev/null +++ b/share/cfg/waybar.nix @@ -0,0 +1,50 @@ +{ ... }: { + programs.waybar = { + systemd = { + enable = true; + target = "hyprland-session.target"; + }; + # settings.mainBar = { + # layer = "top"; + # position = "right"; + # width = 40; + # reload_style_on_change = true; + # + # modules-left = [ "hyprland/workspaces" ]; + # modules-right = [ + # "battery" + # "network" + # "cpu" + # "memory" + # "temperature" + # "backlight" + # "clock" + # "tray" + # ]; + # + # clock = { + # format = "{:%H:%m\n%b}"; + # }; + # + # battery = { + # format = lib.concatStringsSep "\n" [ + # "{icon} {capacity}%" + # " {power:4.1f} W" + # ]; + # interval = 2; + # format-icons = [ "" "" "" "" "" "" "" "" "" "" ]; + # }; + # + # keyboard-state = { + # numlock = true; + # capslock = true; + # format = "{name} {icon}"; + # format-icons = { + # locked = ""; + # unlocked = ""; + # }; + # }; + # }; # end of settings.mainBar + # style = builtins.readFile ./waybar.css; + }; +} diff --git a/share/cfg/wpaperd.nix b/share/cfg/wpaperd.nix new file mode 100644 index 0000000..f5e58b4 --- /dev/null +++ b/share/cfg/wpaperd.nix @@ -0,0 +1,14 @@ +# IMPORTANT: this is the config for a custom module that's located at +# /share/hm-modules/wpaperd.nix. In order to use this config you have to also +# import that module. +{ config, ... }: +let wallpapers-dir = "${config.xdg.userDirs.pictures}/Wallpapers"; +in { + services.wpaperd = { + settings.default = { + path = wallpapers-dir; + duration = "10m"; + sorting = "random"; + }; + }; +} |
