feat: more work on the catppuccin installation
This commit is contained in:
		
					parent
					
						
							
								505fdbc65a
							
						
					
				
			
			
				commit
				
					
						14555c38b6
					
				
			
		
					 16 changed files with 189 additions and 15 deletions
				
			
		|  | @ -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; | ||||
|     }; | ||||
|  |  | |||
|  | @ -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() | |||
|             ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}), | ||||
|             -- ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}), | ||||
|             ['<C-y>'] = cmp.config.disable, | ||||
|             ['<C-e>'] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}), | ||||
|             ['<C-e>'] = cmp.mapping({ | ||||
|                 i = cmp.mapping.abort(), | ||||
|                 c = cmp.mapping.close() | ||||
|             }), | ||||
|             ['<CR>'] = cmp.mapping.confirm({select = true}), | ||||
|             -- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings | ||||
|             ['<C-Space>'] = cmp.mapping.confirm {behavior = cmp.ConfirmBehavior.Insert, select = true}, | ||||
|             ['<C-Space>'] = cmp.mapping.confirm { | ||||
|                 behavior = cmp.ConfirmBehavior.Insert, | ||||
|                 select = true | ||||
|             }, | ||||
|             -- TODO: abstract booth of those away perhaps? | ||||
|             ["<Tab>"] = 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 | ||||
|  |  | |||
|  | @ -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 - | ||||
|  |  | |||
|  | @ -16,6 +16,8 @@ in | |||
|     settings = { | ||||
|       window.decorations = "none"; | ||||
|       fonts.normal.family = "Nerd Font Source Code Pro"; | ||||
| 
 | ||||
|       env = { TERM = "xterm-256color"; }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
|  | @ -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; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
|  | @ -10,8 +10,8 @@ | |||
|     arpeggio = fetchFromGitHub { | ||||
|       owner = "kana"; | ||||
|       repo = "vim-arpeggio"; | ||||
|       rev = "37978445197ab00edeb5b731e9ca90c2b141723f"; | ||||
|       sha256 = "13p3i0b8azkmhafyv8hc4hav1pmgqg52xzvk2a3gp3ppqqx9bwpc"; | ||||
|       rev = "01c8fc1a72ef58e490ee0490c65ee313b1b6e843"; | ||||
|       sha256 = "0405yp1273kzsr3g5j6mj2dfs73qvw716474phkdr67md8ln12dy"; | ||||
|     }; | ||||
| 
 | ||||
|     agda-nvim = fetchFromGitHub { | ||||
|  |  | |||
|  | @ -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) { }; | ||||
|  |  | |||
							
								
								
									
										48
									
								
								modules/themes/catppuccin/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								modules/themes/catppuccin/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -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; | ||||
|   }; | ||||
| } | ||||
| 
 | ||||
							
								
								
									
										56
									
								
								modules/themes/catppuccin/foreign.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								modules/themes/catppuccin/foreign.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -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"; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										6
									
								
								modules/themes/catppuccin/nvim.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								modules/themes/catppuccin/nvim.lua
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| local catppuccin = require("catppuccin") | ||||
| 
 | ||||
| catppuccin.setup({ | ||||
|     transparet_background = true, | ||||
|     integrations = {nvimtree = {transparent_panel = true}} | ||||
| }) | ||||
|  | @ -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 | ||||
|   ]; | ||||
|  |  | |||
|  | @ -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 = { | ||||
|  |  | |||
							
								
								
									
										10
									
								
								modules/themes/gtk.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								modules/themes/gtk.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| { pkgs, ... }: | ||||
| let | ||||
|   theme = pkgs.myThemes.current; | ||||
| in | ||||
| { | ||||
|   home-manager.users.adrielus.gtk = { | ||||
|     enable = true; | ||||
|     theme = theme.gtk.path; | ||||
|   }; | ||||
| } | ||||
|  | @ -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; | ||||
|  |  | |||
							
								
								
									
										9
									
								
								modules/themes/xresources.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								modules/themes/xresources.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| { pkgs, ... }: | ||||
| let | ||||
|   theme = pkgs.myThemes.current; | ||||
| in | ||||
| { | ||||
|   home-manager.users.adrielus.xresources = { | ||||
|     extraConfig = theme.xresources; | ||||
|   }; | ||||
| } | ||||
|  | @ -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 = { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Matei Adriel
				Matei Adriel