More configuration
This commit is contained in:
1 parent
23c2ef87b0
commit
0f437230c7
12 files changed
+657
-287
No files matched your search
@@ -16,6 +16,7 @@ in {
|
||||
curl
|
||||
dig
|
||||
nix-tree
|
||||
procps
|
||||
];
|
||||
|
||||
modules = {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
./foot/default.nix
|
||||
./mako/default.nix
|
||||
./obsidian/default.nix
|
||||
./qutebrowser/default.nix
|
||||
./rofi/default.nix
|
||||
./rofi/rofi-rbw.nix
|
||||
./shell/bash.nix
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.waybar;
|
||||
in {
|
||||
options.modules.waybar = {
|
||||
enable = mkEnableOption "waybar";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
pulsemixer
|
||||
playerctl
|
||||
];
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
spacing = 16;
|
||||
modules-left = [
|
||||
"river/tags"
|
||||
];
|
||||
modules-center = [
|
||||
#"river/window"
|
||||
"mpris"
|
||||
];
|
||||
modules-right = [
|
||||
"pulseaudio"
|
||||
"battery"
|
||||
"clock"
|
||||
];
|
||||
"river/window" = {
|
||||
max-length = 50;
|
||||
};
|
||||
"river/tags" = {
|
||||
tag-labels = [
|
||||
"一"
|
||||
"二"
|
||||
"三"
|
||||
"四"
|
||||
"五"
|
||||
"六"
|
||||
"七"
|
||||
"八"
|
||||
"九"
|
||||
];
|
||||
disable-click = false;
|
||||
};
|
||||
pulseaudio = {
|
||||
tooltip = false;
|
||||
format = "{icon} {volume}%"; # Spacing achieved using "Thin Space"
|
||||
#format-muted = "";
|
||||
format-muted = "{icon} --%"; # Spacing achieved using "Thin Space"
|
||||
format-icons = {
|
||||
#headphone = "";
|
||||
#default = [ "" "" ];
|
||||
headphone = "";
|
||||
headphone-muted = "";
|
||||
default = [ "" "" "" ];
|
||||
};
|
||||
};
|
||||
battery = {
|
||||
format = "{icon} {capacity}%"; # Spacing achieved using "Thin Space"
|
||||
format-charging = " {capacity}%"; # Spacing achieved using "Thin Space"
|
||||
#format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ];
|
||||
format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ];
|
||||
interval = 1;
|
||||
};
|
||||
clock = {
|
||||
#format = " {:%H:%M}";
|
||||
#format = " {:%H:%M}"; # Spacing achieved using "Thin Space"
|
||||
format = "{:%H:%M}";
|
||||
};
|
||||
mpris = {
|
||||
format = "{dynamic}";
|
||||
tooltip-format = "";
|
||||
interval = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
window#waybar {
|
||||
color: #${colors.base05};
|
||||
background-color: #${colors.base00};
|
||||
border-style: none none solid none;
|
||||
border-width: ${toString borderSize}px;
|
||||
border-color: #${colors.base01};
|
||||
font-size: 12px;
|
||||
font-family: "${fonts.monospace.name}";
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin: 0 8px 0 0;
|
||||
}
|
||||
|
||||
#tags button {
|
||||
color: #${colors.base03};
|
||||
padding: 0 5px 1px 5px;
|
||||
border-radius: 0;
|
||||
font-size: 16px;
|
||||
font-family: "Unifont";
|
||||
}
|
||||
|
||||
#tags button.occupied {
|
||||
color: #${colors.base05};
|
||||
}
|
||||
|
||||
#tags button.focused {
|
||||
color: #${colors.base09};
|
||||
}
|
||||
|
||||
#tags.button.bell {
|
||||
color: #${colors.base0A};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -6,6 +6,7 @@ let
|
||||
in {
|
||||
imports = [
|
||||
# Import desktop environment modules
|
||||
./bar/waybar.nix
|
||||
./lock-screen/waylock.nix
|
||||
./window-manager/river.nix
|
||||
];
|
||||
|
||||
@@ -18,9 +18,21 @@ in {
|
||||
river
|
||||
'';
|
||||
|
||||
# Update background after rebuild
|
||||
home.activation = {
|
||||
river = lib.hm.dag.entryAfter [ "installPackages" ] ''
|
||||
# Close waybar
|
||||
PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill waybar
|
||||
|
||||
# Restart river
|
||||
PATH="${pkgs.river}/bin:$PATH" $DRY_RUN_CMD ~/.config/river/init
|
||||
'';
|
||||
};
|
||||
|
||||
# River setup
|
||||
wayland.windowManager.river = {
|
||||
enable = true;
|
||||
systemd.enable = false;
|
||||
xwayland.enable = true;
|
||||
settings = let
|
||||
layout = "rivertile";
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.neovim;
|
||||
in {
|
||||
options.modules.neovim = {
|
||||
enable = mkEnableOption "neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
];
|
||||
|
||||
opts = {
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
|
||||
signcolumn = "yes";
|
||||
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
|
||||
tabstop = 4;
|
||||
shiftwidth = 4;
|
||||
softtabstop = 0;
|
||||
expandtab = true;
|
||||
smarttab = true;
|
||||
|
||||
list = true;
|
||||
listchars = "tab:»┈«,trail:·,extends:→,precedes:←,nbsp:␣";
|
||||
};
|
||||
|
||||
diagnostics = {
|
||||
enable = true;
|
||||
signs = true;
|
||||
underline = true;
|
||||
update_in_insert = true;
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
vim.fn.sign_define("DiagnosticSignError",
|
||||
{text = "", texthl = "DiagnosticSignError"})
|
||||
vim.fn.sign_define("DiagnosticSignWarn",
|
||||
{text = "", texthl = "DiagnosticSignWarn"})
|
||||
vim.fn.sign_define("DiagnosticSignInfo",
|
||||
{text = "", texthl = "DiagnosticSignInfo"})
|
||||
vim.fn.sign_define("DiagnosticSignHint",
|
||||
{text = "💡", texthl = "DiagnosticSignHint"})
|
||||
'';
|
||||
|
||||
keymaps = [
|
||||
# Save shortcut
|
||||
{
|
||||
action = ":update<CR>";
|
||||
key = "<C-s>";
|
||||
mode = "n";
|
||||
}
|
||||
{
|
||||
action = "<C-o>:update<CR>";
|
||||
key = "<C-s>";
|
||||
mode = "i";
|
||||
}
|
||||
|
||||
# Neo tree
|
||||
{
|
||||
action = ":Neotree action=focus reveal toggle<CR>";
|
||||
key = "<leader>n";
|
||||
mode = "n";
|
||||
options.silent = true;
|
||||
}
|
||||
];
|
||||
|
||||
autoCmd = [
|
||||
{
|
||||
desc = "Automatic formatting";
|
||||
event = "BufWritePre";
|
||||
callback = {
|
||||
__raw = ''
|
||||
function()
|
||||
vim.lsp.buf.format {
|
||||
async = false,
|
||||
}
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
highlight = {
|
||||
Comment = {
|
||||
italic = true;
|
||||
fg = colors.withHashtag.base03;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
plugins.lsp = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
#plugins.treesitter = {
|
||||
# enable = true;
|
||||
#};
|
||||
|
||||
plugins.cmp = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
mapping = {
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-e>" = "cmp.mapping.close()";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
};
|
||||
sources = [
|
||||
{ name = "path"; }
|
||||
{ name = "nvim_lsp"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
plugins.neo-tree = {
|
||||
enable = true;
|
||||
|
||||
closeIfLastWindow = true;
|
||||
window = {
|
||||
width = 30;
|
||||
autoExpandWidth = true;
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
default_component_configs.git_status.symbols = {
|
||||
# Change type
|
||||
added = "+";
|
||||
deleted = "✕";
|
||||
modified = "✦";
|
||||
renamed = "→";
|
||||
|
||||
# Status type
|
||||
untracked = "?";
|
||||
ignored = "▫";
|
||||
unstaged = "□";
|
||||
staged = "■";
|
||||
conflict = "‼";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#plugins.cmp-nvim-lsp.enable = true;
|
||||
|
||||
plugins.gitsigns = {
|
||||
enable = true;
|
||||
settings.current_line_blame = true;
|
||||
};
|
||||
|
||||
#plugins.copilot-vim = {
|
||||
# enable = true;
|
||||
#};
|
||||
|
||||
plugins.rust-tools = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
plugins.vimtex = {
|
||||
enable = true;
|
||||
texlivePackage = null;
|
||||
settings = {
|
||||
view_method = "zathura";
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.neovim.defaultEditor = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.qutebrowser;
|
||||
theme = config.theming;
|
||||
in {
|
||||
options.modules.qutebrowser.enable = mkEnableOption "qutebrowser";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.qutebrowser = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
config.set("colors.webpage.darkmode.enabled", False)
|
||||
config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}")
|
||||
config.set("fonts.default_family", "${theme.fonts.monospace.name}")
|
||||
config.set("fonts.default_size", "${toString theme.fonts.monospace.recommendedSize}pt")
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -45,7 +45,7 @@ in {
|
||||
padding = mkLiteral "0px 2px";
|
||||
};
|
||||
"element selected" = {
|
||||
background-color = mkLiteral "#${colors.focused}";
|
||||
background-color = mkLiteral "#${colors.unfocused}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -249,9 +249,27 @@ in {
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
|
||||
gtk3.extraCss = mkIf !cfg.clientSideDecorations disableCSD;
|
||||
gtk4.extraCss = mkIf !cfg.clientSideDecorations disableCSD;
|
||||
}
|
||||
gtk3.extraCss = mkIf (! cfg.clientSideDecorations) disableCSD;
|
||||
gtk4.extraCss = mkIf (! cfg.clientSideDecorations) disableCSD;
|
||||
};
|
||||
|
||||
# TODO: This should just straight up not be here
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
# TODO: Make cursors configurable using modules.
|
||||
home.pointerCursor = {
|
||||
gtk.enable = true;
|
||||
name = lib.mkForce "BreezeX-RosePine-Linux";
|
||||
package = lib.mkForce pkgs.rose-pine-cursor;
|
||||
size = lib.mkForce 24;
|
||||
x11 = {
|
||||
defaultCursor = lib.mkForce "BreezeX-RosePine-Linux";
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Enable stylix
|
||||
# TODO: Move to own module
|
||||
@@ -260,7 +278,11 @@ in {
|
||||
autoEnable = false;
|
||||
|
||||
targets = {
|
||||
vscode.enable = config.modules.vscode.enable;
|
||||
foot.enable = true;
|
||||
nixvim.enable = true;
|
||||
qutebrowser.enable = true;
|
||||
vscode.enable = true;
|
||||
zathura.enable = true;
|
||||
};
|
||||
|
||||
base16Scheme = cfg.colorScheme;
|
||||
|
||||
@@ -47,6 +47,9 @@ in {
|
||||
|
||||
# Autoformatting
|
||||
"editor.formatOnSave" = true;
|
||||
|
||||
# Layout
|
||||
"window.menuBarVisibility" = "hidden";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user