feat: initial commit
This commit is contained in:
commit
7fc2437bed
38 changed files with 1528 additions and 0 deletions
24
users/gandalf/modules/alacritty.nix
Normal file
24
users/gandalf/modules/alacritty.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ ... }:
|
||||
let
|
||||
common = import ./common.nix;
|
||||
in
|
||||
{
|
||||
# alacritty - a cross-platform, GPU-accelerated terminal emulator
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
# custom settings
|
||||
settings = {
|
||||
env.TERM = "xterm-256color";
|
||||
font = {
|
||||
size = 12;
|
||||
draw_bold_text_with_bright_colors = true;
|
||||
normal = {
|
||||
family = common.font;
|
||||
};
|
||||
};
|
||||
scrolling.multiplier = 5;
|
||||
selection.save_to_clipboard = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
20
users/gandalf/modules/common.nix
Normal file
20
users/gandalf/modules/common.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
colorschemes = rec {
|
||||
custom = {
|
||||
black = "#000000";
|
||||
white = "#ffffff";
|
||||
|
||||
# https://yeun.github.io/open-color/
|
||||
active = "#ffdeeb"; # pink1
|
||||
activeDark = "#f783ac"; # pink4
|
||||
inactive = "#495057"; # gray7
|
||||
inactiveDark = "#212529"; # gray9
|
||||
alert = "#c92a2a"; # red9
|
||||
};
|
||||
default = custom;
|
||||
};
|
||||
|
||||
font = "DejaVuSansM Nerd Font";
|
||||
font-size = "14";
|
||||
gtk = "Adwaita";
|
||||
}
|
||||
14
users/gandalf/modules/default.nix
Normal file
14
users/gandalf/modules/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
imports = [
|
||||
./alacritty.nix
|
||||
./fzf.nix
|
||||
./gnupg.nix
|
||||
./neovim.nix
|
||||
./sway.nix
|
||||
./tmux.nix
|
||||
./vscode.nix
|
||||
./waybar.nix
|
||||
./wofi.nix
|
||||
./zsh.nix
|
||||
];
|
||||
}
|
||||
7
users/gandalf/modules/fzf.nix
Normal file
7
users/gandalf/modules/fzf.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
||||
12
users/gandalf/modules/gnupg.nix
Normal file
12
users/gandalf/modules/gnupg.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ ... }: {
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
pinentryFlavor = "gnome3";
|
||||
};
|
||||
}
|
||||
131
users/gandalf/modules/neovim.nix
Normal file
131
users/gandalf/modules/neovim.nix
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
vimAlias = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
toggleterm-nvim
|
||||
nvim-tree-lua
|
||||
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars))
|
||||
nvim-lspconfig
|
||||
];
|
||||
extraPackages = with pkgs; [
|
||||
nil
|
||||
nixpkgs-fmt
|
||||
];
|
||||
extraLuaConfig = ''
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- set termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
local set = vim.opt
|
||||
set.tabstop = 2
|
||||
set.shiftwidth = 2
|
||||
set.softtabstop = 2
|
||||
set.expandtab = true
|
||||
-- needed for toggleterm
|
||||
set.hidden = true
|
||||
|
||||
-- nvim-tree setup
|
||||
local nvimtree = require('nvim-tree')
|
||||
local nvimtreeapi = require('nvim-tree.api')
|
||||
local function nvimtree_on_attach(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
-- default mappings
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
-- custom mappings
|
||||
vim.keymap.set('n', '<C-t>', api.tree.toggle, {})
|
||||
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||
end
|
||||
nvimtree.setup({
|
||||
on_attach = nvimtree_on_attach,
|
||||
})
|
||||
vim.keymap.set('n', '<C-t>', nvimtreeapi.tree.toggle, {})
|
||||
|
||||
-- telescope setup
|
||||
local telescope = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', telescope.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', telescope.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', telescope.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', telescope.help_tags, {})
|
||||
|
||||
-- toggleterm setup
|
||||
local toggleterm = require('toggleterm')
|
||||
toggleterm.setup{
|
||||
open_mapping = [[<c-\>]],
|
||||
hide_numbers = false,
|
||||
autochdir = true,
|
||||
direction = 'float',
|
||||
float_opts = {
|
||||
border = 'curved',
|
||||
},
|
||||
}
|
||||
|
||||
-- nvim-treesitter
|
||||
local treesitter = require('nvim-treesitter.configs')
|
||||
treesitter.setup {
|
||||
indent = {
|
||||
enable = true
|
||||
},
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
}
|
||||
|
||||
-- nvim-lspconfig
|
||||
local lspconfig = require('lspconfig')
|
||||
lspconfig.nil_ls.setup {
|
||||
settings = {
|
||||
['nil'] = {
|
||||
formatting = {
|
||||
command = { "nixpkgs-fmt" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
|
||||
-- Use LspAttach autocommand to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
||||
-- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
-- vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
-- vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
-- vim.keymap.set('n', '<space>wl', function()
|
||||
-- print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
-- end, opts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
||||
-- vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
||||
-- vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', '<space>f', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
280
users/gandalf/modules/sway.nix
Normal file
280
users/gandalf/modules/sway.nix
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.wayland.windowManager.sway.config;
|
||||
common = import ./common.nix;
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
brightnessctl # control screen brightness
|
||||
pavucontrol # control audio
|
||||
networkmanagerapplet # control network
|
||||
dracula-theme # gtk theme
|
||||
gnome3.adwaita-icon-theme # default gnome cursors
|
||||
# wdisplays # graphical output manager
|
||||
# wev # wayland event monitor
|
||||
wl-clipboard # cli tool to manage wayland clipboard
|
||||
# wl-mirror # emulation for “mirror display” mode
|
||||
# wlr-randr # output management that actually works
|
||||
];
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures = {
|
||||
base = true;
|
||||
gtk = true;
|
||||
};
|
||||
xwayland = true;
|
||||
extraSessionCommands = ''
|
||||
export CLUTTER_BACKEND=wayland;
|
||||
export GDK_BACKEND=wayland;
|
||||
export GDK_DPI_SCALE=1;
|
||||
export NIXOS_OZONE_WL=1;
|
||||
export WLR_NO_HARDWARE_CURSORS=1;
|
||||
export MOZ_ENABLE_WAYLAND=1;
|
||||
export MOZ_USE_XINPUT2=1;
|
||||
export XDG_SESSION_TYPE=wayland;
|
||||
export XDG_CURRENT_DESKTOP=sway;
|
||||
# SDL:
|
||||
export SDL_VIDEODRIVER=wayland
|
||||
# QT (needs qt5.qtwayland in systemPackages):
|
||||
export QT_QPA_PLATFORM=wayland-egl
|
||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
|
||||
# Fix for some Java AWT applications (e.g. Android Studio),
|
||||
# use this if they aren't displayed properly:
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on";
|
||||
'';
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
terminal = "${pkgs.alacritty}/bin/alacritty";
|
||||
menu = "${pkgs.wofi}/bin/wofi";
|
||||
startup = [
|
||||
{ command = "blueman-applet"; }
|
||||
{ command = "nm-applet"; }
|
||||
];
|
||||
input = {
|
||||
"2:7:SynPS/2_Synaptics_TouchPad" = {
|
||||
accel_profile = "flat";
|
||||
dwt = "enabled";
|
||||
dwtp = "enabled";
|
||||
tap = "enabled";
|
||||
natural_scroll = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
scroll_factor = "0.3";
|
||||
};
|
||||
"2:10:TPPS/2_IBM_TrackPoint" = {
|
||||
accel_profile = "flat";
|
||||
scroll_factor = "0.5";
|
||||
};
|
||||
};
|
||||
left = "h";
|
||||
down = "j";
|
||||
up = "k";
|
||||
right = "l";
|
||||
keybindings = {
|
||||
# Basics
|
||||
"${cfg.modifier}+Return" = "exec ${cfg.terminal}";
|
||||
"${cfg.modifier}+q" = "kill";
|
||||
"${cfg.modifier}+Space" = "exec ${cfg.menu}";
|
||||
"${cfg.modifier}+Shift+c" = "reload";
|
||||
"${cfg.modifier}+Shift+q" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||
|
||||
# Focus
|
||||
"${cfg.modifier}+${cfg.left}" = "focus left";
|
||||
"${cfg.modifier}+${cfg.down}" = "focus down";
|
||||
"${cfg.modifier}+${cfg.up}" = "focus up";
|
||||
"${cfg.modifier}+${cfg.right}" = "focus right";
|
||||
|
||||
"${cfg.modifier}+Left" = "focus left";
|
||||
"${cfg.modifier}+Down" = "focus down";
|
||||
"${cfg.modifier}+Up" = "focus up";
|
||||
"${cfg.modifier}+Right" = "focus right";
|
||||
|
||||
# Moving
|
||||
"${cfg.modifier}+Shift+${cfg.left}" = "move left";
|
||||
"${cfg.modifier}+Shift+${cfg.down}" = "move down";
|
||||
"${cfg.modifier}+Shift+${cfg.up}" = "move up";
|
||||
"${cfg.modifier}+Shift+${cfg.right}" = "move right";
|
||||
|
||||
"${cfg.modifier}+Shift+Left" = "move left";
|
||||
"${cfg.modifier}+Shift+Down" = "move down";
|
||||
"${cfg.modifier}+Shift+Up" = "move up";
|
||||
"${cfg.modifier}+Shift+Right" = "move right";
|
||||
|
||||
# Workspaces
|
||||
"${cfg.modifier}+1" = "workspace number 1";
|
||||
"${cfg.modifier}+2" = "workspace number 2";
|
||||
"${cfg.modifier}+3" = "workspace number 3";
|
||||
"${cfg.modifier}+4" = "workspace number 4";
|
||||
"${cfg.modifier}+5" = "workspace number 5";
|
||||
"${cfg.modifier}+6" = "workspace number 6";
|
||||
"${cfg.modifier}+7" = "workspace number 7";
|
||||
"${cfg.modifier}+8" = "workspace number 8";
|
||||
"${cfg.modifier}+9" = "workspace number 9";
|
||||
"${cfg.modifier}+0" = "workspace number 10";
|
||||
|
||||
"${cfg.modifier}+Shift+1" = "move container to workspace number 1";
|
||||
"${cfg.modifier}+Shift+2" = "move container to workspace number 2";
|
||||
"${cfg.modifier}+Shift+3" = "move container to workspace number 3";
|
||||
"${cfg.modifier}+Shift+4" = "move container to workspace number 4";
|
||||
"${cfg.modifier}+Shift+5" = "move container to workspace number 5";
|
||||
"${cfg.modifier}+Shift+6" = "move container to workspace number 6";
|
||||
"${cfg.modifier}+Shift+7" = "move container to workspace number 7";
|
||||
"${cfg.modifier}+Shift+8" = "move container to workspace number 8";
|
||||
"${cfg.modifier}+Shift+9" = "move container to workspace number 9";
|
||||
"${cfg.modifier}+Shift+0" = "move container to workspace number 10";
|
||||
|
||||
"${cfg.modifier}+Control+${cfg.down}" = "workspace prev";
|
||||
"${cfg.modifier}+Control+${cfg.up}" = "workspace next";
|
||||
"${cfg.modifier}+Control+Shift+${cfg.down}" = "move workspace to output left";
|
||||
"${cfg.modifier}+Control+Shift+${cfg.up}" = "move workspace to output right";
|
||||
|
||||
# Splits
|
||||
"${cfg.modifier}+b" = "splith";
|
||||
"${cfg.modifier}+v" = "splitv";
|
||||
|
||||
# Layouts
|
||||
"${cfg.modifier}+s" = "layout stacking";
|
||||
"${cfg.modifier}+w" = "layout tabbed";
|
||||
"${cfg.modifier}+e" = "layout toggle split";
|
||||
"${cfg.modifier}+f" = "fullscreen toggle";
|
||||
|
||||
"${cfg.modifier}+a" = "focus parent";
|
||||
|
||||
"${cfg.modifier}+d" = "floating toggle";
|
||||
"${cfg.modifier}+Shift+d" = "focus mode_toggle";
|
||||
|
||||
# Scratchpad
|
||||
"${cfg.modifier}+Shift+minus" = "move scratchpad";
|
||||
"${cfg.modifier}+minus" = "scratchpad show";
|
||||
|
||||
# Resize mode
|
||||
"${cfg.modifier}+r" = "mode resize";
|
||||
|
||||
# Multimedia Keys
|
||||
"XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+";
|
||||
"XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-";
|
||||
"XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
"XF86AudioMicMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
||||
|
||||
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%-";
|
||||
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%+";
|
||||
|
||||
# "XF86AudioPrev" = "exec ${pkgs.mpc_cli}/bin/mpc -q next";
|
||||
# "XF86AudioNext" = "exec ${pkgs.mpc_cli}/bin/mpc -q prev";
|
||||
# "XF86AudioPlay" = "exec ${pkgs.mpc_cli}/bin/mpc -q toggle";
|
||||
# "XF86AudioPause" = "exec ${pkgs.mpc_cli}/bin/mpc -q toggle";
|
||||
|
||||
# Programs
|
||||
"${cfg.modifier}+Shift+v" = "exec ${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
"${cfg.modifier}+Shift+b" = "exec ${pkgs.blueman}/bin/blueman-manager";
|
||||
"${cfg.modifier}+Shift+n" = "exec ${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
|
||||
};
|
||||
fonts = {
|
||||
names = [ common.font ];
|
||||
style = "Bold";
|
||||
size = 12.0;
|
||||
};
|
||||
seat = {
|
||||
"*" = {
|
||||
xcursor_theme = common.gtk;
|
||||
};
|
||||
};
|
||||
window = {
|
||||
titlebar = false;
|
||||
border = 4;
|
||||
};
|
||||
gaps = {
|
||||
inner = 5;
|
||||
};
|
||||
colors = {
|
||||
focused = {
|
||||
border = common.colorschemes.default.active;
|
||||
background = common.colorschemes.default.active;
|
||||
text = common.colorschemes.default.black;
|
||||
indicator = common.colorschemes.default.activeDark;
|
||||
childBorder = common.colorschemes.default.active;
|
||||
};
|
||||
focusedInactive = {
|
||||
border = common.colorschemes.default.inactive;
|
||||
background = common.colorschemes.default.inactive;
|
||||
text = common.colorschemes.default.white;
|
||||
indicator = common.colorschemes.default.inactive;
|
||||
childBorder = common.colorschemes.default.inactive;
|
||||
};
|
||||
unfocused = {
|
||||
border = common.colorschemes.default.inactiveDark;
|
||||
background = common.colorschemes.default.inactiveDark;
|
||||
text = common.colorschemes.default.white;
|
||||
indicator = common.colorschemes.default.inactiveDark;
|
||||
childBorder = common.colorschemes.default.inactiveDark;
|
||||
};
|
||||
urgent = {
|
||||
border = common.colorschemes.default.alert;
|
||||
background = common.colorschemes.default.alert;
|
||||
text = common.colorschemes.default.white;
|
||||
indicator = common.colorschemes.default.black;
|
||||
childBorder = common.colorschemes.default.alert;
|
||||
};
|
||||
placeholder = {
|
||||
border = common.colorschemes.default.active;
|
||||
background = common.colorschemes.default.active;
|
||||
text = common.colorschemes.default.black;
|
||||
indicator = common.colorschemes.default.activeDark;
|
||||
childBorder = common.colorschemes.default.active;
|
||||
};
|
||||
};
|
||||
bars = [
|
||||
{
|
||||
command = "${pkgs.waybar}/bin/waybar";
|
||||
}
|
||||
];
|
||||
};
|
||||
extraConfig = ''
|
||||
for_window [title="Firefox — Sharing Indicator"] {
|
||||
floating enable
|
||||
}
|
||||
for_window [title="Bluetooth Devices"] {
|
||||
floating enable
|
||||
resize set 700px 450px
|
||||
move position 100ppt 0
|
||||
move left 700px
|
||||
}
|
||||
for_window [title="Volume Control"] {
|
||||
floating enable
|
||||
resize set 700px 450px
|
||||
move position 100ppt 0
|
||||
move left 700px
|
||||
}
|
||||
for_window [app_id="nm-connection-editor" title="Network Connections"] {
|
||||
floating enable
|
||||
resize set 700px 450px
|
||||
move position 100ppt 0
|
||||
move left 700px
|
||||
}
|
||||
for_window [app_id="thunderbird" title="Reminder"] {
|
||||
floating enable
|
||||
resize set 700px 450px
|
||||
move position 100ppt 0
|
||||
move left 700px
|
||||
}
|
||||
|
||||
set $ddterm-id dropdown-terminal
|
||||
set $ddterm ${cfg.terminal} --class $ddterm-id
|
||||
set $ddterm-resize resize set 100ppt 40ppt, move position 0 0
|
||||
|
||||
# resize/move new dropdown terminal windows
|
||||
for_window [app_id="$ddterm-id"] {
|
||||
floating enable
|
||||
$ddterm-resize
|
||||
move to scratchpad
|
||||
scratchpad show
|
||||
}
|
||||
|
||||
# show existing or start new dropdown terminal
|
||||
bindsym ${cfg.modifier}+grave exec swaymsg '[app_id="$ddterm-id"] scratchpad show' || $ddterm && sleep .1 && swaymsg '[app_id="$ddterm-id"] $ddterm-resize'
|
||||
# ^-- resize again, case moving to different output
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
14
users/gandalf/modules/tmux.nix
Normal file
14
users/gandalf/modules/tmux.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
newSession = true;
|
||||
terminal = "screen-256color";
|
||||
|
||||
clock24 = true;
|
||||
escapeTime = 0;
|
||||
historyLimit = 10000;
|
||||
|
||||
mouse = true;
|
||||
keyMode = "vi";
|
||||
};
|
||||
}
|
||||
147
users/gandalf/modules/vscode.nix
Normal file
147
users/gandalf/modules/vscode.nix
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
common = import ./common.nix;
|
||||
in
|
||||
{
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
enableExtensionUpdateCheck = true;
|
||||
enableUpdateCheck = false;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
vscodevim.vim
|
||||
editorconfig.editorconfig
|
||||
dbaeumer.vscode-eslint
|
||||
waderyan.gitblame
|
||||
bierner.markdown-mermaid
|
||||
pkief.material-icon-theme
|
||||
christian-kohler.path-intellisense
|
||||
johnpapa.vscode-peacock
|
||||
esbenp.prettier-vscode
|
||||
bradlc.vscode-tailwindcss
|
||||
jnoortheen.nix-ide
|
||||
];
|
||||
userSettings = {
|
||||
"window.menuBarVisibility" = "toggle";
|
||||
|
||||
"workbench.iconTheme" = "material-icon-theme";
|
||||
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
"explorer.confirmDelete" = false;
|
||||
|
||||
"editor.renderControlCharacters" = true;
|
||||
"editor.renderWhitespace" = "all";
|
||||
"editor.renderFinalNewline" = "on";
|
||||
"editor.tabSize" = 4;
|
||||
"editor.cursorStyle" = "line";
|
||||
"editor.insertSpaces" = false;
|
||||
"editor.lineNumbers" = "on";
|
||||
"editor.wordSeparators" = "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-";
|
||||
"editor.wordWrap" = "on";
|
||||
"editor.suggestSelection" = "first";
|
||||
"editor.fontFamily" = common.font;
|
||||
"editor.fontSize" = 16;
|
||||
"editor.bracketPairColorization.enabled" = true;
|
||||
"editor.guides.bracketPairs" = "active";
|
||||
"editor.quickSuggestions" = {
|
||||
strings = "on";
|
||||
};
|
||||
"editor.codeActionsOnSave" = {
|
||||
".source.organizeImports" = true;
|
||||
};
|
||||
|
||||
"terminal.integrated.fontFamily" = common.font;
|
||||
|
||||
"files.exclude" = {
|
||||
"**/.classpath" = true;
|
||||
"**/.project" = true;
|
||||
"**/.settings" = true;
|
||||
"**/.factorypath" = true;
|
||||
"**/__pycache__" = true;
|
||||
};
|
||||
|
||||
"[html]" = {
|
||||
"editor.tabSize" = 2;
|
||||
"editor.insertSpaces" = true;
|
||||
"editor.defaultFormatter" = "esbenp.prettier-vscode";
|
||||
};
|
||||
"[javascript]" = {
|
||||
"editor.tabSize" = 2;
|
||||
"editor.insertSpaces" = true;
|
||||
"editor.defaultFormatter" = "esbenp.prettier-vscode";
|
||||
};
|
||||
"[typescript]" = {
|
||||
"editor.tabSize" = 2;
|
||||
"editor.insertSpaces" = true;
|
||||
"editor.defaultFormatter" = "esbenp.prettier-vscode";
|
||||
};
|
||||
"[typescriptreact]" = {
|
||||
"editor.tabSize" = 2;
|
||||
"editor.insertSpaces" = true;
|
||||
"editor.defaultFormatter" = "esbenp.prettier-vscode";
|
||||
};
|
||||
"[python]" = {
|
||||
"editor.tabSize" = 4;
|
||||
"editor.insertSpaces" = true;
|
||||
"editor.formatOnType" = true;
|
||||
};
|
||||
"[yaml]" = {
|
||||
"editor.insertSpaces" = true;
|
||||
"editor.tabSize" = 2;
|
||||
"editor.autoIndent" = "advanced";
|
||||
};
|
||||
"[json]" = {
|
||||
"editor.defaultFormatter" = "vscode.json-language-features";
|
||||
};
|
||||
"[jsonc]" = {
|
||||
"editor.defaultFormatter" = "esbenp.prettier-vscode";
|
||||
};
|
||||
"[java]" = {
|
||||
"editor.defaultFormatter" = "redhat.java";
|
||||
};
|
||||
"[markdown]" = {
|
||||
"editor.defaultFormatter" = "esbenp.prettier-vscode";
|
||||
};
|
||||
"[css]" = {
|
||||
"editor.defaultFormatter" = "esbenp.prettier-vscode";
|
||||
};
|
||||
"[nix]" = {
|
||||
"editor.defaultFormatter" = "jnoortheen.nix-ide";
|
||||
};
|
||||
|
||||
|
||||
"git.autofetch" = true;
|
||||
"json.schemaDownload.enable" = true;
|
||||
"javascript.updateImportsOnFileMove.enabled" = "always";
|
||||
"typescript.updateImportsOnFileMove.enabled" = "always";
|
||||
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "${pkgs.nil}/bin/nil";
|
||||
"nix.formatterPath" = "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt";
|
||||
};
|
||||
|
||||
keybindings = [
|
||||
{
|
||||
key = "ctrl+tab";
|
||||
command = "workbench.action.nextEditor";
|
||||
}
|
||||
{
|
||||
key = "ctrl+shift+tab";
|
||||
command = "workbench.action.previousEditor";
|
||||
}
|
||||
{
|
||||
key = "alt+left";
|
||||
command = "workbench.action.navigateBack";
|
||||
}
|
||||
{
|
||||
key = "alt+right";
|
||||
command = "workbench.action.navigateForward";
|
||||
}
|
||||
{
|
||||
key = "ctrl+f";
|
||||
command = "editor.action.formatDocument";
|
||||
when = "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
338
users/gandalf/modules/waybar.nix
Normal file
338
users/gandalf/modules/waybar.nix
Normal file
|
|
@ -0,0 +1,338 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
|
||||
settings.mainBar = {
|
||||
layer = "top";
|
||||
margin = "5 5 5 5";
|
||||
modules-left = [ "sway/workspaces" "sway/window" "sway/mode" ];
|
||||
modules-center = [ "clock" ];
|
||||
modules-right = [ "tray" "network" "pulseaudio" "custom/mem" "temperature" "backlight" "battery" ];
|
||||
"sway/workspaces" = {
|
||||
disable-scroll = true;
|
||||
persistent_workspaces = {
|
||||
"1" = [ ];
|
||||
"2" = [ ];
|
||||
"3" = [ ];
|
||||
"4" = [ ];
|
||||
};
|
||||
};
|
||||
"sway/window" = {
|
||||
format = "{title}";
|
||||
max-length = 43;
|
||||
};
|
||||
"sway/mode" = {
|
||||
format = "<span style=\"italic\">{}</span>";
|
||||
};
|
||||
clock = {
|
||||
timezones = [ "Europe/Berlin" ];
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
format = "{:%a, %d %b, %H:%M}";
|
||||
actions = {
|
||||
on-click = "tz_up";
|
||||
};
|
||||
};
|
||||
network = {
|
||||
interval = 1;
|
||||
format = "{ifname}";
|
||||
format-wifi = "{signalStrength}% ";
|
||||
format-ethernet = "eth ";
|
||||
format-disconnected = ""; # An empty format will hide the module.
|
||||
tooltip-format = "{ifname} via {gwaddr} ";
|
||||
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
|
||||
tooltip-format-ethernet = "{ifname} ";
|
||||
tooltip-format-disconnected = "Disconnected";
|
||||
};
|
||||
pulseaudio = {
|
||||
reverse-scrolling = 1;
|
||||
format = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "{volume}% ";
|
||||
format-source-muted = "";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
min-length = 13;
|
||||
};
|
||||
"custom/mem" = {
|
||||
format = "{} ";
|
||||
interval = 3;
|
||||
exec = "free -h | awk '/Mem:/{printf $3}'";
|
||||
tooltip = false;
|
||||
};
|
||||
temperature = {
|
||||
critical-threshold = 80;
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
tooltip = false;
|
||||
};
|
||||
backlight = {
|
||||
device = "intel_backlight";
|
||||
format = "{percent}% {icon}";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
format-charging = "{capacity}% ";
|
||||
format-plugged = "{capacity}% ";
|
||||
format-alt = "{time} {icon}";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
on-update = pkgs.writeShellScript "check-battery" ''
|
||||
bat=/sys/class/power_supply/BAT0
|
||||
CRIT=''${1:-15}
|
||||
|
||||
FILE=~/.config/waybar/.notified.target
|
||||
|
||||
stat=$(cat $bat/status)
|
||||
perc=$(cat $bat/capacity)
|
||||
|
||||
if [[ $perc -le $CRIT ]] && [[ $stat == "Discharging" ]]; then
|
||||
if [[ ! -f "$FILE" ]]; then
|
||||
notify-send --urgency=critical --icon=dialog-warning "Battery Low" "Current charge: $perc%"
|
||||
touch $FILE
|
||||
fi
|
||||
elif [[ -f "$FILE" ]]; then
|
||||
rm $FILE
|
||||
fi
|
||||
'';
|
||||
};
|
||||
tray = {
|
||||
icon-size = 16;
|
||||
spacing = 0;
|
||||
};
|
||||
};
|
||||
style = ''
|
||||
@define-color bg-color #212529;
|
||||
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: DejaVuSansM Nerd Font;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
margin-right: 8px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
transition: none;
|
||||
color: #7c818c;
|
||||
background: transparent;
|
||||
padding: 5px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#workspaces button.persistent {
|
||||
color: #7c818c;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
transition: none;
|
||||
box-shadow: inherit;
|
||||
text-shadow: inherit;
|
||||
border-radius: inherit;
|
||||
color: @bg-color;
|
||||
background: #7c818c;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: white;
|
||||
}
|
||||
|
||||
#window {
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
margin-right: 8px;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#mode {
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#clock {
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#network {
|
||||
margin-right: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
margin-right: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
background-color: #90b1b1;
|
||||
color: #2a5c45;
|
||||
}
|
||||
|
||||
#custom-mem {
|
||||
margin-right: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
margin-right: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
background-color: #eb4d4b;
|
||||
}
|
||||
|
||||
#backlight {
|
||||
margin-right: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#battery {
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
color: #ffffff;
|
||||
background-color: #26A65B;
|
||||
}
|
||||
|
||||
#battery.warning:not(.charging) {
|
||||
background-color: #ffbe61;
|
||||
color: black;
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #f53c3c;
|
||||
color: #ffffff;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#tray {
|
||||
margin-right: 8px;
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #ffffff;
|
||||
background: @bg-color;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
66
users/gandalf/modules/wofi.nix
Normal file
66
users/gandalf/modules/wofi.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ ... }:
|
||||
let
|
||||
common = import ./common.nix;
|
||||
in
|
||||
{
|
||||
programs.wofi = {
|
||||
enable = true;
|
||||
settings = {
|
||||
show = "drun";
|
||||
allow_images = true;
|
||||
image_size = 24;
|
||||
no_actions = true;
|
||||
};
|
||||
style = ''
|
||||
* {
|
||||
font-family: '${common.font}', monospace;
|
||||
font-size: ${common.font-size}px;
|
||||
color: ${common.colorschemes.default.black};
|
||||
}
|
||||
|
||||
window {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#input {
|
||||
background-color: ${common.colorschemes.default.active};
|
||||
border: 5px;
|
||||
border-color: ${common.colorschemes.default.activeDark};
|
||||
border-radius: 0px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#scroll {
|
||||
background-color: ${common.colorschemes.default.active};
|
||||
border: 5px;
|
||||
border-color: ${common.colorschemes.default.activeDark};
|
||||
border-radius: 0px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#entry {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#entry #text {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
#entry:selected {
|
||||
background-color: ${common.colorschemes.default.activeDark};
|
||||
}
|
||||
|
||||
#entry:selected #img {
|
||||
background-color: ${common.colorschemes.default.activeDark};
|
||||
}
|
||||
|
||||
#entry:selected #text {
|
||||
background-color: ${common.colorschemes.default.activeDark};
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
30
users/gandalf/modules/zsh.nix
Normal file
30
users/gandalf/modules/zsh.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ config, pkgs, ... }: {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
enableAutosuggestions = true;
|
||||
plugins = [
|
||||
{
|
||||
name = "zsh-syntax-highlighting";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "zsh-users";
|
||||
repo = "zsh-syntax-highlighting";
|
||||
rev = "0.7.1";
|
||||
hash = "sha256-gOG0NLlaJfotJfs+SUhGgLTNOnGLjoqnUp54V9aFJg8=";
|
||||
};
|
||||
}
|
||||
];
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
theme = "terminalparty";
|
||||
plugins = [
|
||||
"git"
|
||||
];
|
||||
};
|
||||
history = {
|
||||
path = "${config.xdg.dataHome}/zsh/histfile";
|
||||
size = 10000;
|
||||
save = 10000;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue