diff options
34 files changed, 574 insertions, 340 deletions
@@ -13,4 +13,4 @@ My personal home manager configurations. | zsh | Shell | | lf | Terminal file manager | | rofi | Application launcher | -| nerdfonts | Font with glphs | +| nerdfonts | Font with glyphs | diff --git a/alacritty/default.nix b/alacritty/default.nix index eb3825e..e4c1551 100644 --- a/alacritty/default.nix +++ b/alacritty/default.nix @@ -28,7 +28,7 @@ size = 16.0; }; - colors = with config.lib.stylix.colors; { + colors = with config.scheme; { primary = { background = "0x${base00}"; foreground = "0x${base05}"; diff --git a/base16/default.nix b/base16/default.nix new file mode 100644 index 0000000..d8d392d --- /dev/null +++ b/base16/default.nix @@ -0,0 +1,5 @@ +{ pkgs, config, ... }: + +{ + config.scheme = "${pkgs.base16-schemes}/share/themes/classic-dark.yaml"; +} diff --git a/bash/default.nix b/bash/default.nix index c0c17c7..199aa10 100644 --- a/bash/default.nix +++ b/bash/default.nix @@ -1,6 +1,7 @@ -{ ... }: +{ config, ... }: { programs.bash.enable = true; - programs.bash.historyFile = "$HOME/.cache/bash/history"; + programs.bash.historyFile = "${config.xdg.cacheHome}/bash/history"; + home.file."${config.xdg.cacheHome}/bash/histroy".text = ""; # Create the cache directory and histroy file } diff --git a/bat/default.nix b/bat/default.nix new file mode 100644 index 0000000..af6bfca --- /dev/null +++ b/bat/default.nix @@ -0,0 +1,8 @@ +{ config, ... }: + +{ + programs.bat.enable = true; + programs.bat.config.theme = "customTheme"; + xdg.configFile."bat/themes/customTheme.tmTheme".text + = import ./theme.nix config; +} diff --git a/bat/theme.nix b/bat/theme.nix new file mode 100644 index 0000000..e345ee4 --- /dev/null +++ b/bat/theme.nix @@ -0,0 +1,124 @@ +config: + +with config.scheme.withHashtag; +'' +<?xml version="1.0" encoding="UTF-8"?> +<plist version="1.0"> +<dict> + <key>name</key> + <string>customTheme</string> + <key>settings</key> + <array> + <!-- General Colors --> + <dict> + <key>settings</key> + <dict> + <key>background</key> + <string>#0F1419</string> <!-- Background (base00) --> + <key>foreground</key> + <string>#E6E1CF</string> <!-- Foreground (base05) --> + <key>caret</key> + <string>#F3F4F5</string> <!-- Caret (base07) --> + <key>invisibles</key> + <string>#3E4B59</string> <!-- Invisibles (base03) --> + <key>lineHighlight</key> + <string>#272D38</string> <!-- Line highlight (base02) --> + <key>selection</key> + <string>#3E4B59</string> <!-- Selection (base03) --> + </dict> + </dict> + + <!-- Syntax-Specific Colors --> + <dict> + <key>scope</key> + <string>comment</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#BFBDB6</string> <!-- Comments (base04) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>string</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FFB454</string> <!-- Strings (base0A) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>constant.numeric</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#FF8F40</string> <!-- Numbers (base09) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>variable</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#F07178</string> <!-- Variables (base08) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>keyword</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#59C2FF</string> <!-- Keywords (base0D) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>support.function</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#D2A6FF</string> <!-- Functions (base0E) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>constant.language</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#B8CC52</string> <!-- Constants (base0B) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>entity.name.tag</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#95E6CB</string> <!-- Tags (base0C) --> + </dict> + </dict> + + <dict> + <key>scope</key> + <string>invalid</string> + <key>settings</key> + <dict> + <key>foreground</key> + <string>#E6B673</string> <!-- Invalid (base0F) --> + </dict> + </dict> + </array> +</dict> +</plist> +'' diff --git a/bspwm/default.nix b/bspwm/default.nix index 5696ba1..c0226f8 100644 --- a/bspwm/default.nix +++ b/bspwm/default.nix @@ -3,7 +3,7 @@ { xsession.windowManager.bspwm.enable = true; - xsession.windowManager.bspwm.settings = with config.lib.stylix.colors.withHashtag; { + xsession.windowManager.bspwm.settings = with config.scheme.withHashtag; { window_gap = 5; split_ratio = 0.5; single_monocle = true; @@ -11,7 +11,7 @@ gapless_monocle = false; focus_follows_pointer = true; pointer_follows_focus = false; - pointer_motion_interval = 60; + pointer_motion_interval = 40; pointer_modifier = "mod1"; # alt key pointer_action1 = "resize_side"; pointer_action2 = "move"; @@ -5,11 +5,11 @@ "fromYaml": "fromYaml" }, "locked": { - "lastModified": 1708890466, - "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "lastModified": 1721224776, + "narHash": "sha256-iakVQHg2DSmdOc5dNBwrDt9JLRxX5MT+IIbxfZEpGdo=", "owner": "SenchoPens", "repo": "base16.nix", - "rev": "665b3c6748534eb766c777298721cece9453fdae", + "rev": "c89c8123310257f3ddc04cc59aa4b5573c6d515f", "type": "github" }, "original": { @@ -18,147 +18,14 @@ "type": "github" } }, - "base16-fish": { - "flake": false, - "locked": { - "lastModified": 1622559957, - "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", - "owner": "tomyun", - "repo": "base16-fish", - "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", - "type": "github" - }, - "original": { - "owner": "tomyun", - "repo": "base16-fish", - "type": "github" - } - }, - "base16-foot": { - "flake": false, - "locked": { - "lastModified": 1696725948, - "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", - "owner": "tinted-theming", - "repo": "base16-foot", - "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-foot", - "type": "github" - } - }, - "base16-helix": { - "flake": false, - "locked": { - "lastModified": 1720809814, - "narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=", - "owner": "tinted-theming", - "repo": "base16-helix", - "rev": "34f41987bec14c0f3f6b2155c19787b1f6489625", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-helix", - "type": "github" - } - }, - "base16-kitty": { - "flake": false, - "locked": { - "lastModified": 1665001328, - "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", - "owner": "kdrag0n", - "repo": "base16-kitty", - "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", - "type": "github" - }, - "original": { - "owner": "kdrag0n", - "repo": "base16-kitty", - "type": "github" - } - }, - "base16-tmux": { - "flake": false, - "locked": { - "lastModified": 1696725902, - "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", - "owner": "tinted-theming", - "repo": "base16-tmux", - "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-tmux", - "type": "github" - } - }, - "base16-vim": { - "flake": false, - "locked": { - "lastModified": 1716150083, - "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", - "owner": "tinted-theming", - "repo": "base16-vim", - "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-vim", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": [ - "stylix", - "systems" - ] - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "fromYaml": { "flake": false, "locked": { - "lastModified": 1689549921, - "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "lastModified": 1721222302, + "narHash": "sha256-5vL4w9+tS9yd8WpIiDUtxN1IuxCVK2nebZMs/hCXXis=", "owner": "SenchoPens", "repo": "fromYaml", - "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "rev": "93bad85d1633b8b27287b438c0bd394094c24d06", "type": "github" }, "original": { @@ -167,23 +34,6 @@ "type": "github" } }, - "gnome-shell": { - "flake": false, - "locked": { - "lastModified": 1713702291, - "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", - "owner": "GNOME", - "repo": "gnome-shell", - "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", - "type": "github" - }, - "original": { - "owner": "GNOME", - "ref": "46.1", - "repo": "gnome-shell", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -204,27 +54,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "stylix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1724435763, - "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1726243404, @@ -241,72 +70,11 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1725194671, - "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "stylix": "stylix" - } - }, - "stylix": { - "inputs": { "base16": "base16", - "base16-fish": "base16-fish", - "base16-foot": "base16-foot", - "base16-helix": "base16-helix", - "base16-kitty": "base16-kitty", - "base16-tmux": "base16-tmux", - "base16-vim": "base16-vim", - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "gnome-shell": "gnome-shell", - "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_2", - "systems": "systems" - }, - "locked": { - "lastModified": 1726170940, - "narHash": "sha256-sobkRkGBaMX9pD0bwU1iVPWi0WtQvZqlHyl1YtvNDio=", - "owner": "danth", - "repo": "stylix", - "rev": "35233f929629c8eb64e939e35260fc8347f94df9", - "type": "github" - }, - "original": { - "owner": "danth", - "repo": "stylix", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" } } }, @@ -7,10 +7,10 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - stylix.url = "github:danth/stylix"; + base16.url = "github:SenchoPens/base16.nix"; }; - outputs = { nixpkgs, home-manager, stylix, ... }: + outputs = { nixpkgs, home-manager, base16, ... }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; @@ -19,7 +19,7 @@ inherit pkgs; modules = [ ./home.nix - stylix.homeManagerModules.stylix + base16.homeManagerModule ]; }; }; diff --git a/git/default.nix b/git/default.nix index 973b4b6..5a32294 100644 --- a/git/default.nix +++ b/git/default.nix @@ -1,14 +1,14 @@ -{ lib, ... }: +{ lib, config, ... }: { programs.git.enable = true; programs.git.userEmail = "54011232+arpitchakladar@users.noreply.github.com"; programs.git.userName = "Arpit Chakladar"; programs.git.extraConfig = { - credential.helper = "store --file $HOME/.cache/git/credential"; + credential.helper = "store --file ${config.xdg.cacheHome}/git/credential"; core.askPass = ""; }; # The base directory of the credential file must exist - home.activation.createGitCacheDirectory = lib.hm.dag.entryAfter [ "writeBoundary" ] "mkdir -p $HOME/.cache/git"; + home.activation.createGitCacheDirectory = lib.hm.dag.entryAfter [ "writeBoundary" ] "mkdir -p ${config.xdg.cacheHome}/git"; } @@ -1,8 +1,8 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { imports = [ - ./stylix/default.nix + ./base16/default.nix ./bspwm/default.nix ./sxhkd/default.nix ./polybar/default.nix @@ -15,28 +15,16 @@ ./lf/default.nix ./rofi/default.nix ./htop/default.nix + ./lsd/default.nix + ./bat/default.nix ]; - # Home Manager needs a bit of information about you and the paths it should - # manage. home.username = "arpit"; home.homeDirectory = "/home/arpit"; - - # This value determines the Home Manager release that your configuration is - # compatible with. This helps avoid breakage when a new Home Manager release - # introduces backwards incompatible changes. - # - # You should not change this value, even if you update Home Manager. If you do - # want to update the value, then make sure to first check the Home Manager - # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + home.stateVersion = "23.11"; home.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) ]; - home.sessionVariables = { - EDITOR = "nvim"; - }; - programs.home-manager.enable = true; } diff --git a/lf/default.nix b/lf/default.nix index 804b121..f8bb96b 100644 --- a/lf/default.nix +++ b/lf/default.nix @@ -1,15 +1,15 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { programs.lf.enable = true; programs.lf.settings = { hidden = true; }; + programs.lf.previewer.source = pkgs.writeShellScript + "previewer.sh" + (builtins.readFile ./scripts/previewer.sh); programs.lf.extraConfig = "set icons"; - xdg.configFile."lf/icons".source = builtins.fetchurl { - url = "https://raw.githubusercontent.com/gokcehan/lf/master/etc/icons.example"; - sha256 = "sha256:12cwy6kfa2wj7nzffaxn5bka21yjqa5sx38nzdhyg1dq0c6jnjkk"; - }; + xdg.configFile."lf/icons".source = ./icons; } diff --git a/lf/icons b/lf/icons new file mode 100644 index 0000000..2e9d8a2 --- /dev/null +++ b/lf/icons @@ -0,0 +1,334 @@ +# vim:ft=conf + +# These examples require Nerd Fonts or a compatible font to be used. +# See https://www.nerdfonts.com for more information. + +# file types (with matching order) +ln # LINK +or # ORPHAN +tw t # STICKY_OTHER_WRITABLE +ow # OTHER_WRITABLE +st t # STICKY +di # DIR +pi p # FIFO +so s # SOCK +bd b # BLK +cd c # CHR +su u # SETUID +sg g # SETGID +ex # EXEC +fi # FILE + +# file extensions (vim-devicons) +*.styl +*.sass +*.scss +*.htm +*.html +*.slim +*.haml +*.ejs +*.css +*.less +*.md +*.mdx +*.markdown +*.rmd +*.json +*.webmanifest +*.js +*.mjs +*.jsx +*.rb +*.gemspec +*.rake +*.php +*.py +*.pyc +*.pyo +*.pyd +*.coffee +*.mustache +*.hbs +*.conf +*.ini +*.yml +*.yaml +*.toml +*.bat +*.mk +*.jpg +*.jpeg +*.bmp +*.png +*.webp +*.gif +*.ico +*.twig +*.cpp +*.c++ +*.cxx +*.cc +*.cp +*.c +*.cs +*.h +*.hh +*.hpp +*.hxx +*.hs +*.lhs +*.nix +*.lua +*.java +*.sh +*.fish +*.bash +*.zsh +*.ksh +*.csh +*.awk +*.ps1 +*.ml λ +*.mli λ +*.diff +*.db +*.sql +*.dump +*.clj +*.cljc +*.cljs +*.edn +*.scala +*.go +*.dart +*.xul +*.sln +*.suo +*.pl +*.pm +*.t +*.rss +'*.f#' +*.fsscript +*.fsx +*.fs +*.fsi +*.rs +*.rlib +*.d +*.erl +*.hrl +*.ex +*.exs +*.eex +*.leex +*.heex +*.vim +*.ai +*.psd +*.psb +*.ts +*.tsx +*.jl +*.pp +*.vue +*.elm +*.swift +*.xcplayground +*.tex +*.r +*.rproj +*.sol +*.pem + +# file names (vim-devicons) (case-insensitive not supported in lf) +*gruntfile.coffee +*gruntfile.js +*gruntfile.ls +*gulpfile.coffee +*gulpfile.js +*gulpfile.ls +*mix.lock +*dropbox +*.ds_store +*.gitconfig +*.gitignore +*.gitattributes +*.gitlab-ci.yml +*.bashrc +*.zshrc +*.zshenv +*.zprofile +*.vimrc +*.gvimrc +*_vimrc +*_gvimrc +*.bashprofile +*favicon.ico +*license +*node_modules +*react.jsx +*procfile +*dockerfile +*docker-compose.yml +*docker-compose.yaml +*compose.yml +*compose.yaml +*rakefile +*config.ru +*gemfile +*makefile +*cmakelists.txt +*robots.txt + +# file names (case-sensitive adaptations) +*Gruntfile.coffee +*Gruntfile.js +*Gruntfile.ls +*Gulpfile.coffee +*Gulpfile.js +*Gulpfile.ls +*Dropbox +*.DS_Store +*LICENSE +*React.jsx +*Procfile +*Dockerfile +*Docker-compose.yml +*Docker-compose.yaml +*Rakefile +*Gemfile +*Makefile +*CMakeLists.txt + +# file patterns (file name adaptations) +*jquery.min.js +*angular.min.js +*backbone.min.js +*require.min.js +*materialize.min.js +*materialize.min.css +*mootools.min.js +*vimrc +Vagrantfile + +# archives or compressed (extensions from dircolors defaults) +*.tar +*.tgz +*.arc +*.arj +*.taz +*.lha +*.lz4 +*.lzh +*.lzma +*.tlz +*.txz +*.tzo +*.t7z +*.zip +*.z +*.dz +*.gz +*.lrz +*.lz +*.lzo +*.xz +*.zst +*.tzst +*.bz2 +*.bz +*.tbz +*.tbz2 +*.tz +*.deb +*.rpm +*.jar +*.war +*.ear +*.sar +*.rar +*.alz +*.ace +*.zoo +*.cpio +*.7z +*.rz +*.cab +*.wim +*.swm +*.dwm +*.esd + +# image formats (extensions from dircolors defaults) +*.jpg +*.jpeg +*.mjpg +*.mjpeg +*.gif +*.bmp +*.pbm +*.pgm +*.ppm +*.tga +*.xbm +*.xpm +*.tif +*.tiff +*.png +*.svg +*.svgz +*.mng +*.pcx +*.mov +*.mpg +*.mpeg +*.m2v +*.mkv +*.webm +*.ogm +*.mp4 +*.m4v +*.mp4v +*.vob +*.qt +*.nuv +*.wmv +*.asf +*.rm +*.rmvb +*.flc +*.avi +*.fli +*.flv +*.gl +*.dl +*.xcf +*.xwd +*.yuv +*.cgm +*.emf +*.ogv +*.ogx + +# audio formats (extensions from dircolors defaults) +*.aac +*.au +*.flac +*.m4a +*.mid +*.midi +*.mka +*.mp3 +*.mpc +*.ogg +*.ra +*.wav +*.oga +*.opus +*.spx +*.xspf + +# other formats +*.pdf diff --git a/lf/scripts/previewer.sh b/lf/scripts/previewer.sh new file mode 100644 index 0000000..407e0a0 --- /dev/null +++ b/lf/scripts/previewer.sh @@ -0,0 +1,3 @@ +#!/bin/sh +unset COLORTERM +bat -pp --line-range=:500 --color=always "$1" diff --git a/lsd/default.nix b/lsd/default.nix new file mode 100644 index 0000000..6698ef0 --- /dev/null +++ b/lsd/default.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + programs.lsd.enable = true; + programs.lsd.enableAliases = true; + programs.bash.shellAliases."tree" = "${pkgs.lsd}/bin/lsd -a --tree"; + + programs.lsd.settings = { + icons.separator = " "; + }; +} diff --git a/nvim/default.nix b/nvim/default.nix index bf5b050..73dc359 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -5,39 +5,33 @@ programs.neovim.viAlias = true; programs.neovim.vimAlias = true; programs.neovim.vimdiffAlias = true; + programs.neovim.defaultEditor = true; + + programs.neovim.extraPackages = with pkgs; [ + gcc # Required for treesitter + ]; programs.neovim.extraLuaConfig = '' ${builtins.readFile ./options.lua} ${builtins.readFile ./keybindings.lua} -''; - - programs.neovim.plugins = - with pkgs.vimPlugins; - let - toLua = str: "lua << EOF\n${str}\nEOF\n"; - toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n"; - in [ - { - plugin = comment-nvim; - config = toLuaFile ./plugins/comment.lua; - } - { - plugin = lualine-nvim; - config = toLuaFile ./plugins/lualine.lua; - } - - { - plugin = base16-nvim; - config = toLua (import ./plugins/base16.nix config); - } +-- Plugins configuration +${builtins.readFile ./plugins/comment.lua} +${builtins.readFile ./plugins/lualine.lua} +${import ./plugins/treesitter.nix config} +${builtins.readFile ./plugins/base16.lua} +${builtins.readFile ./plugins/nvim-tree.lua} +''; + programs.neovim.plugins = with pkgs.vimPlugins; [ + comment-nvim + lualine-nvim + nvim-treesitter nvim-web-devicons - - { - plugin = nvim-tree-lua; - config = toLuaFile ./plugins/nvim-tree.lua; - } + nvim-tree-lua + (base16-vim.overrideAttrs (old: { + patchPhase = "ln -s ${config.scheme base16-vim} colors/base16-scheme.vim"; + })) ]; } diff --git a/nvim/options.lua b/nvim/options.lua index 5efd8d5..b1fe9cb 100644 --- a/nvim/options.lua +++ b/nvim/options.lua @@ -8,9 +8,9 @@ vim.o.list = true; vim.o.listchars = "tab:| ,trail:_,lead:_"; vim.o.laststatus = 3; -vim.opt.fillchars = { eob = " " }; vim.o.signcolumn = "auto"; +vim.opt.fillchars = { eob = " " }; vim.o.tabstop = 2; vim.o.shiftwidth = 2; @@ -18,6 +18,4 @@ vim.o.expandtab = false; vim.o.updatetime = 300; -vim.o.termguicolors = true; - vim.o.mouse = "a"; diff --git a/nvim/plugins/base16.lua b/nvim/plugins/base16.lua new file mode 100644 index 0000000..9843b76 --- /dev/null +++ b/nvim/plugins/base16.lua @@ -0,0 +1,6 @@ +vim.o.termguicolors = true; +vim.opt.termguicolors = true; +vim.o.background = "dark"; +vim.g.base16colorspace = 256 +vim.cmd.colorscheme("base16-scheme"); +vim.api.nvim_set_hl(0, "LineNr", { link = "Normal" }); -- disable the background of line numbers diff --git a/nvim/plugins/base16.nix b/nvim/plugins/base16.nix deleted file mode 100644 index 170b68b..0000000 --- a/nvim/plugins/base16.nix +++ /dev/null @@ -1,11 +0,0 @@ -config: - -with config.lib.stylix.colors.withHashtag; -'' -require("base16-colorscheme").setup { - base00 = "${base00}", base01 = "${base01}", base02 = "${base02}", base03 = "${base03}", - base04 = "${base04}", base05 = "${base05}", base06 = "${base06}", base07 = "${base07}", - base08 = "${base08}", base09 = "${base09}", base0A = "${base0A}", base0B = "${base0B}", - base0C = "${base0C}", base0D = "${base0D}", base0E = "${base0E}", base0F = "${base0F}", -}; -'' diff --git a/nvim/plugins/treesitter.nix b/nvim/plugins/treesitter.nix new file mode 100644 index 0000000..05f1f2a --- /dev/null +++ b/nvim/plugins/treesitter.nix @@ -0,0 +1,13 @@ +config: + +'' +require("nvim-treesitter.configs").setup { + auto_install = true, + highlight = { + enable = true, + }, + parser_install_dir = "${config.xdg.dataHome}/nvim", +}; + +vim.opt.runtimepath:append("${config.xdg.dataHome}/nvim"); +'' diff --git a/polybar/bars/main.nix b/polybar/bars/main.nix index 74213d1..630664d 100644 --- a/polybar/bars/main.nix +++ b/polybar/bars/main.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { width = "100%"; height = 30; diff --git a/polybar/default.nix b/polybar/default.nix index 038a28d..8eec80f 100644 --- a/polybar/default.nix +++ b/polybar/default.nix @@ -4,7 +4,7 @@ services.polybar.enable = true; services.polybar.script = "polybar main &"; - services.polybar.config = with config.lib.stylix.colors.withHashtag; { + services.polybar.config = { "bar/main" = import ./bars/main.nix config; "module/xwindow" = import ./modules/xwindow.nix config; "module/bspwm" = import ./modules/bspwm.nix config; diff --git a/polybar/modules/battery.nix b/polybar/modules/battery.nix index 9e9e2d5..9860c3c 100644 --- a/polybar/modules/battery.nix +++ b/polybar/modules/battery.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "internal/battery"; battery = "BAT0"; diff --git a/polybar/modules/bspwm.nix b/polybar/modules/bspwm.nix index 2bb32c5..7ec5c6d 100644 --- a/polybar/modules/bspwm.nix +++ b/polybar/modules/bspwm.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "internal/bspwm"; diff --git a/polybar/modules/cpu.nix b/polybar/modules/cpu.nix index d130d07..f118990 100644 --- a/polybar/modules/cpu.nix +++ b/polybar/modules/cpu.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "internal/cpu"; interval = 2; diff --git a/polybar/modules/date.nix b/polybar/modules/date.nix index 4cba926..11a5934 100644 --- a/polybar/modules/date.nix +++ b/polybar/modules/date.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "internal/date"; interval = 60; diff --git a/polybar/modules/kernel-version.nix b/polybar/modules/kernel-version.nix index d858617..a900264 100644 --- a/polybar/modules/kernel-version.nix +++ b/polybar/modules/kernel-version.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "custom/script"; exec = "uname -r"; diff --git a/polybar/modules/memory.nix b/polybar/modules/memory.nix index 230286f..1aff8a3 100644 --- a/polybar/modules/memory.nix +++ b/polybar/modules/memory.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "internal/memory"; interval = 2; diff --git a/polybar/modules/time.nix b/polybar/modules/time.nix index fde01de..e4c7cbe 100644 --- a/polybar/modules/time.nix +++ b/polybar/modules/time.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "internal/date"; interval = 30; diff --git a/polybar/modules/xwindow.nix b/polybar/modules/xwindow.nix index 7a242d0..23245ba 100644 --- a/polybar/modules/xwindow.nix +++ b/polybar/modules/xwindow.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; { type = "internal/xwindow"; label = "%title:0:30:...%"; diff --git a/rofi/theme/default.nix b/rofi/theme/default.nix index 9ae3bb5..b0b8173 100644 --- a/rofi/theme/default.nix +++ b/rofi/theme/default.nix @@ -1,6 +1,6 @@ config: -with config.lib.stylix.colors.withHashtag; +with config.scheme.withHashtag; builtins.toFile "theme.rasi" '' ${builtins.readFile ./theme.rasi} diff --git a/stylix/default.nix b/stylix/default.nix deleted file mode 100644 index cb04e66..0000000 --- a/stylix/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: - -{ - stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/ayu-dark.yaml"; - stylix.polarity = "dark"; -} diff --git a/sxhkd/default.nix b/sxhkd/default.nix index 762c6b0..c481136 100644 --- a/sxhkd/default.nix +++ b/sxhkd/default.nix @@ -1,13 +1,8 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { services.sxhkd.enable = true; - xdg.configFile."sxhkd/scripts/show-keybindings.sh" = { - source = ./scripts/show-keybindings.sh; - executable = true; - }; - services.sxhkd.keybindings = let modKey = "alt"; @@ -16,7 +11,9 @@ ${(createKeybinding "s" "Show keybindings.")} - = "$HOME/.config/sxhkd/scripts/show-keybindings.sh"; + = pkgs.writeShellScript + "show-keybindings.sh" + (builtins.readFile ./scripts/show-keybindings.sh); ${(createKeybinding "r" diff --git a/zsh/default.nix b/zsh/default.nix index f7c5f26..1951933 100644 --- a/zsh/default.nix +++ b/zsh/default.nix @@ -1,8 +1,9 @@ -{ ... }: +{ config, ... }: { programs.zsh.enable = true; programs.zsh.dotDir = ".config/zsh"; - programs.zsh.history.path = "$HOME/.cache/zsh/history"; + programs.zsh.history.path = "${config.xdg.cacheHome}/zsh/history"; programs.zsh.initExtra = builtins.readFile ./zshrc; + programs.zsh.shellAliases = config.programs.bash.shellAliases; } |
