1
Fork 0

feat: more work on the catppuccin installation

This commit is contained in:
Matei Adriel 2022-05-10 19:00:16 +03:00
parent 505fdbc65a
commit 14555c38b6
16 changed files with 189 additions and 15 deletions

View file

@ -1,4 +1,8 @@
{ pkgs, lib, ... }: { { pkgs, lib, ... }:
let
theme = pkgs.myThemes.current;
in
{
imports = [ ./modules ]; imports = [ ./modules ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -7,7 +11,6 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
hardware = { hardware = {
pulseaudio = { pulseaudio = {
enable = true; enable = true;
@ -40,7 +43,7 @@
chainloader /EFI/Microsoft/Boot/bootmgfw.efi chainloader /EFI/Microsoft/Boot/bootmgfw.efi
} }
''; '';
theme = pkgs.nixos-grub2-theme; theme = theme.grub.path;
version = 2; version = 2;
}; };

View file

@ -2,7 +2,10 @@ local M = {}
local function has_words_before() local function has_words_before()
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 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 end
function M.setup() function M.setup()
@ -23,10 +26,16 @@ function M.setup()
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}), ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}),
-- ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}), -- ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}),
['<C-y>'] = cmp.config.disable, ['<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}), ['<CR>'] = cmp.mapping.confirm({select = true}),
-- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings -- 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? -- TODO: abstract booth of those away perhaps?
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
@ -61,7 +70,9 @@ function M.setup()
cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}}) cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -- 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 end
return M return M

View file

@ -7,6 +7,8 @@ bind C-a send-prefix
set-option -g allow-rename off set-option -g allow-rename off
# Visual stuff # 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) 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 - # Split panes with \ and -

View file

@ -16,6 +16,8 @@ in
settings = { settings = {
window.decorations = "none"; window.decorations = "none";
fonts.normal.family = "Nerd Font Source Code Pro"; fonts.normal.family = "Nerd Font Source Code Pro";
env = { TERM = "xterm-256color"; };
}; };
}; };
} }

View file

@ -1,4 +1,8 @@
{ ... }: { { pkgs, ... }:
let
theme = pkgs.myThemes.current;
in
{
home-manager.users.adrielus.programs.rofi = { home-manager.users.adrielus.programs.rofi = {
enable = true; enable = true;
font = "Source Code Pro 16"; font = "Source Code Pro 16";
@ -7,6 +11,7 @@
# lines = 7; # lines = 7;
# fullscreen = false; # fullscreen = false;
cycle = true; cycle = true;
theme = "purple"; theme = theme.rofi.theme;
extraConfig = theme.rofi.config;
}; };
} }

View file

@ -10,8 +10,8 @@
arpeggio = fetchFromGitHub { arpeggio = fetchFromGitHub {
owner = "kana"; owner = "kana";
repo = "vim-arpeggio"; repo = "vim-arpeggio";
rev = "37978445197ab00edeb5b731e9ca90c2b141723f"; rev = "01c8fc1a72ef58e490ee0490c65ee313b1b6e843";
sha256 = "13p3i0b8azkmhafyv8hc4hav1pmgqg52xzvk2a3gp3ppqqx9bwpc"; sha256 = "0405yp1273kzsr3g5j6mj2dfs73qvw716474phkdr67md8ln12dy";
}; };
agda-nvim = fetchFromGitHub { agda-nvim = fetchFromGitHub {

View file

@ -2,7 +2,8 @@
self: super: self: super:
let let
allThemes = self.callPackage (import ../themes/themes.nix) { }; allThemes = self.callPackage (import ../themes/themes.nix) { };
currentTheme = "github-light"; # currentTheme = "github-light";
currentTheme = "catppuccin";
in in
with self; { with self; {
myHelpers = self.callPackage (import ../helpers.nix) { }; myHelpers = self.callPackage (import ../helpers.nix) { };

View 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;
};
}

View 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";
};
}

View file

@ -0,0 +1,6 @@
local catppuccin = require("catppuccin")
catppuccin.setup({
transparet_background = true,
integrations = {nvimtree = {transparent_panel = true}}
})

View file

@ -1,5 +1,7 @@
{ ... }: { { ... }: {
imports = [ 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?) ./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 ./wallpaper.nix # Sets the wallpaper required by the current theme
]; ];

View file

@ -16,6 +16,14 @@ in
lualineTheme = "github"; lualineTheme = "github";
}; };
tmux.path = "${githubTheme}/terminal/tmux/github_${variant}.conf"; 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 = { alacritty.settings = {
import = [ "${githubTheme}/terminal/alacritty/github_${variant}.yml" ]; import = [ "${githubTheme}/terminal/alacritty/github_${variant}.yml" ];
window = { window = {

10
modules/themes/gtk.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
let
theme = pkgs.myThemes.current;
in
{
home-manager.users.adrielus.gtk = {
enable = true;
theme = theme.gtk.path;
};
}

View file

@ -1,7 +1,14 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let githubVariant = import ./githubVariant.nix; let
githubVariant = import ./githubVariant.nix;
catppuccin = import ./catppuccin/default.nix;
in in
lib.lists.map (theme: pkgs.callPackage theme { }) [ lib.lists.map (theme: pkgs.callPackage theme { }) [
(catppuccin {
# wallpaper = "os/nix-magenta-pink-1920x1080.png";
wallpaper = "minimalistic/tetris.png";
transparency = 0.6;
})
(githubVariant { (githubVariant {
variant = "light"; variant = "light";
# wallpaper = ./wallpapers/wall.png; # wallpaper = ./wallpapers/wall.png;

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
let
theme = pkgs.myThemes.current;
in
{
home-manager.users.adrielus.xresources = {
extraConfig = theme.xresources;
};
}

View file

@ -1,4 +1,8 @@
{ pkgs, ... }: { { pkgs, ... }:
let
theme = pkgs.myThemes.current;
in
{
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# Required for the sddm theme # Required for the sddm theme
libsForQt5.qt5.qtquickcontrols libsForQt5.qt5.qtquickcontrols
@ -17,7 +21,7 @@
defaultSession = "none+xmonad"; defaultSession = "none+xmonad";
sddm = { sddm = {
enable = true; enable = true;
theme = "${pkgs.sddm-theme-chili}"; theme = theme.sddm.path;
}; };
autoLogin = { autoLogin = {