diff --git a/configuration.nix b/configuration.nix index 2a3e608..026801f 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,8 @@ -{ pkgs, lib, ... }: { +{ pkgs, lib, ... }: +let + theme = pkgs.myThemes.current; +in +{ imports = [ ./modules ]; boot.loader.systemd-boot.enable = true; @@ -7,7 +11,6 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - hardware = { pulseaudio = { enable = true; @@ -40,7 +43,7 @@ chainloader /EFI/Microsoft/Boot/bootmgfw.efi } ''; - theme = pkgs.nixos-grub2-theme; + theme = theme.grub.path; version = 2; }; diff --git a/dotfiles/neovim/lua/my/plugins/cmp.lua b/dotfiles/neovim/lua/my/plugins/cmp.lua index 7cea831..cd7e1e5 100644 --- a/dotfiles/neovim/lua/my/plugins/cmp.lua +++ b/dotfiles/neovim/lua/my/plugins/cmp.lua @@ -2,7 +2,10 @@ local M = {} local function has_words_before() local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil + return col ~= 0 and + vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, + col) + :match('%s') == nil end function M.setup() @@ -23,10 +26,16 @@ function M.setup() [''] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}), -- [''] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}), [''] = cmp.config.disable, - [''] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}), + [''] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close() + }), [''] = cmp.mapping.confirm({select = true}), -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings - [''] = cmp.mapping.confirm {behavior = cmp.ConfirmBehavior.Insert, select = true}, + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Insert, + select = true + }, -- TODO: abstract booth of those away perhaps? [""] = cmp.mapping(function(fallback) if cmp.visible() then @@ -61,7 +70,9 @@ function M.setup() cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}}) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', {sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})}) + cmp.setup.cmdline(':', { + sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}}) + }) end return M diff --git a/dotfiles/tmux/tmux.conf b/dotfiles/tmux/tmux.conf index 79bcfba..0724254 100644 --- a/dotfiles/tmux/tmux.conf +++ b/dotfiles/tmux/tmux.conf @@ -7,6 +7,8 @@ bind C-a send-prefix set-option -g allow-rename off # Visual stuff +set -g default-terminal "xterm-256color" +set-option -ga terminal-overrides ",xterm-256color:Tc" set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' # Supposedly helps with cursor shapes under vim (spoiler: it does not) # Split panes with \ and - diff --git a/modules/applications/alacritty.nix b/modules/applications/alacritty.nix index a6f344c..d8b985b 100644 --- a/modules/applications/alacritty.nix +++ b/modules/applications/alacritty.nix @@ -16,6 +16,8 @@ in settings = { window.decorations = "none"; fonts.normal.family = "Nerd Font Source Code Pro"; + + env = { TERM = "xterm-256color"; }; }; }; } diff --git a/modules/applications/rofi.nix b/modules/applications/rofi.nix index 7826c54..21760c7 100644 --- a/modules/applications/rofi.nix +++ b/modules/applications/rofi.nix @@ -1,4 +1,8 @@ -{ ... }: { +{ pkgs, ... }: +let + theme = pkgs.myThemes.current; +in +{ home-manager.users.adrielus.programs.rofi = { enable = true; font = "Source Code Pro 16"; @@ -7,6 +11,7 @@ # lines = 7; # fullscreen = false; cycle = true; - theme = "purple"; + theme = theme.rofi.theme; + extraConfig = theme.rofi.config; }; } diff --git a/modules/foreign.nix b/modules/foreign.nix index e63dc8c..c2b3d73 100644 --- a/modules/foreign.nix +++ b/modules/foreign.nix @@ -10,8 +10,8 @@ arpeggio = fetchFromGitHub { owner = "kana"; repo = "vim-arpeggio"; - rev = "37978445197ab00edeb5b731e9ca90c2b141723f"; - sha256 = "13p3i0b8azkmhafyv8hc4hav1pmgqg52xzvk2a3gp3ppqqx9bwpc"; + rev = "01c8fc1a72ef58e490ee0490c65ee313b1b6e843"; + sha256 = "0405yp1273kzsr3g5j6mj2dfs73qvw716474phkdr67md8ln12dy"; }; agda-nvim = fetchFromGitHub { diff --git a/modules/overlays/myPackages.nix b/modules/overlays/myPackages.nix index 6372768..f31cf01 100644 --- a/modules/overlays/myPackages.nix +++ b/modules/overlays/myPackages.nix @@ -2,7 +2,8 @@ self: super: let allThemes = self.callPackage (import ../themes/themes.nix) { }; - currentTheme = "github-light"; + # currentTheme = "github-light"; + currentTheme = "catppuccin"; in with self; { myHelpers = self.callPackage (import ../helpers.nix) { }; diff --git a/modules/themes/catppuccin/default.nix b/modules/themes/catppuccin/default.nix new file mode 100644 index 0000000..ae9ff94 --- /dev/null +++ b/modules/themes/catppuccin/default.nix @@ -0,0 +1,48 @@ +{ transparency ? 1, wallpaper }: { pkgs, ... }: +let + githubTheme = pkgs.myVimPlugins.githubNvimTheme; # github theme for neovim + variant = "dark"; + foreign = pkgs.callPackage (import ./foreign.nix) { }; +in +{ + wallpaper = "${foreign.wallpapers}/${wallpaper}"; + + name = "catppuccin"; + neovim = { + plugins = [ + ( + pkgs.vimUtils.buildVimPluginFrom2Nix { + name = "catppuccin"; + src = foreign.nvim; + } + ) + ]; + theme = builtins.readFile ./nvim.lua; + + lualineTheme = "catppuccin"; + }; + tmux.path = "${foreign.tmux}/catppuccin.conf"; + sddm.path = "${foreign.sddm}"; + grub.path = pkgs.nixos-grub2-theme; + # grub.path = "${foreign.grub}/catppuccin-grub-theme/theme.txt"; + gtk.path = null; + xresources = builtins.readFile "${foreign.xresources}/Xresources"; + rofi = { + theme = "purple"; + config = { }; + }; + alacritty.settings = { + import = [ "${foreign.alacritty}/catppuccin.yml" ]; + window = { + padding = { + x = 8; + y = 8; + }; + + gtk_theme_variant = "dark"; + }; + + background_opacity = transparency; + }; +} + diff --git a/modules/themes/catppuccin/foreign.nix b/modules/themes/catppuccin/foreign.nix new file mode 100644 index 0000000..6a56eb9 --- /dev/null +++ b/modules/themes/catppuccin/foreign.nix @@ -0,0 +1,56 @@ +{ fetchFromGitHub, ... }: { + nvim = fetchFromGitHub { + owner = "catppuccin"; + repo = "nvim"; + sha256 = "1w96rvpbm7lk9lcc5i13d6dyb5b10vkjh1902xmklqvpzy1wya19"; + rev = "8a67df6da476cba68ecf26a519a5279686edbd2e"; + }; + tmux = fetchFromGitHub { + owner = "catppuccin"; + repo = "tmux"; + sha256 = "0frqk3g85licwl06qnck1bpxm9c7h9mj5law5vq28i2kv24qvv9n"; + rev = "87c33d683cf2b40e1340a10fa9049af2d28f5606"; + }; + sddm = fetchFromGitHub { + owner = "catppuccin"; + repo = "sddm"; + sha256 = "19r04g28w17cg4c520qnz4gdf133vz8wlgjv6538wymh13pazh84"; + rev = "da92da8ba221c85a3d0722cd35efece616c487cf"; + }; + grub = fetchFromGitHub { + owner = "catppuccin"; + repo = "grub"; + sha256 = "06ji9w3n36c5kdkqavpnx1bb9xz4l83i1fx059a4gwkvni5lapkp"; + rev = "3f62cd4174465631b40269a7c5631e5ee86dec45"; + }; + gtk = fetchFromGitHub { + owner = "catppuccin"; + repo = "gtk"; + sha256 = "16dnfaj2w34m9i0b1jcg8wpaz5zdscl56gl3hqs4b7nkap1lan01"; + rev = "359c584f607c021fcc657ce77b81c181ebaff6de"; + }; + rofi = fetchFromGitHub { + owner = "catppuccin"; + repo = "rofi"; + sha256 = "063qwhy9hpy7i7wykliccpy9sdxhj77v6ry3ys69dwcchmspyn3j"; + rev = "b5ebfaf11bb90f1104b3d256e4671c6abb66d060"; + }; + alacritty = fetchFromGitHub { + owner = "catppuccin"; + repo = "alacritty"; + sha256 = "0x90ac9v9j93i8l92nn1lhzwn6kzcg55v5xv7mg6g8rcrxlsm0xk"; + rev = "8f6b261375302657136c75569bdbd6dc3e2c67c4"; + }; + wallpapers = fetchFromGitHub { + owner = "catppuccin"; + repo = "wallpapers"; + sha256 = "055080z71zf752psmgywhkm51jhba5a1b23nnb9wqhksxd5saa0n"; + rev = "61d997b8f4c33f6890b0d138bfed6329f3aff794"; + }; + xresources = fetchFromGitHub { + owner = "catppuccin"; + repo = "xresources"; + sha256 = "0jj30xhpdgpl2ii67rv181c8pdgy88jzqnc584z4zpq4am3z4yip"; + rev = "8caaef8e506f1a1da185ee46685dd791f0efffd1"; + }; +} diff --git a/modules/themes/catppuccin/nvim.lua b/modules/themes/catppuccin/nvim.lua new file mode 100644 index 0000000..67dda3f --- /dev/null +++ b/modules/themes/catppuccin/nvim.lua @@ -0,0 +1,6 @@ +local catppuccin = require("catppuccin") + +catppuccin.setup({ + transparet_background = true, + integrations = {nvimtree = {transparent_panel = true}} +}) diff --git a/modules/themes/default.nix b/modules/themes/default.nix index 575bd8b..d9e1351 100644 --- a/modules/themes/default.nix +++ b/modules/themes/default.nix @@ -1,5 +1,7 @@ { ... }: { imports = [ + ./gtk.nix # Sets up gtk theming + ./xresources.nix # Sets up xresources ./fonts.nix # Installs fonts and stuff (TODO: consider moving this into the individual themes which require these fonts?) ./wallpaper.nix # Sets the wallpaper required by the current theme ]; diff --git a/modules/themes/githubVariant.nix b/modules/themes/githubVariant.nix index 8948577..f223d51 100644 --- a/modules/themes/githubVariant.nix +++ b/modules/themes/githubVariant.nix @@ -16,6 +16,14 @@ in lualineTheme = "github"; }; tmux.path = "${githubTheme}/terminal/tmux/github_${variant}.conf"; + sddm.path = "${pkgs.sddm-theme-chili}"; # TODO: don't expose this globally + grub.path = pkgs.nixos-grub2-theme; + gtk.path = null; + xresources = ""; + rofi = { + theme = "purple"; + config = { }; + }; alacritty.settings = { import = [ "${githubTheme}/terminal/alacritty/github_${variant}.yml" ]; window = { diff --git a/modules/themes/gtk.nix b/modules/themes/gtk.nix new file mode 100644 index 0000000..3febd18 --- /dev/null +++ b/modules/themes/gtk.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +let + theme = pkgs.myThemes.current; +in +{ + home-manager.users.adrielus.gtk = { + enable = true; + theme = theme.gtk.path; + }; +} diff --git a/modules/themes/themes.nix b/modules/themes/themes.nix index 44f998f..67f376c 100644 --- a/modules/themes/themes.nix +++ b/modules/themes/themes.nix @@ -1,7 +1,14 @@ { pkgs, lib, ... }: -let githubVariant = import ./githubVariant.nix; +let + githubVariant = import ./githubVariant.nix; + catppuccin = import ./catppuccin/default.nix; in lib.lists.map (theme: pkgs.callPackage theme { }) [ + (catppuccin { + # wallpaper = "os/nix-magenta-pink-1920x1080.png"; + wallpaper = "minimalistic/tetris.png"; + transparency = 0.6; + }) (githubVariant { variant = "light"; # wallpaper = ./wallpapers/wall.png; diff --git a/modules/themes/xresources.nix b/modules/themes/xresources.nix new file mode 100644 index 0000000..73b2d67 --- /dev/null +++ b/modules/themes/xresources.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +let + theme = pkgs.myThemes.current; +in +{ + home-manager.users.adrielus.xresources = { + extraConfig = theme.xresources; + }; +} diff --git a/modules/xserver.nix b/modules/xserver.nix index f45eecc..cacf910 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -1,4 +1,8 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +let + theme = pkgs.myThemes.current; +in +{ environment.systemPackages = with pkgs; [ # Required for the sddm theme libsForQt5.qt5.qtquickcontrols @@ -17,7 +21,7 @@ defaultSession = "none+xmonad"; sddm = { enable = true; - theme = "${pkgs.sddm-theme-chili}"; + theme = theme.sddm.path; }; autoLogin = {