chore: initial commit
This commit is contained in:
commit
cc4f3398ff
37 changed files with 2210 additions and 0 deletions
65
modules/desktop/hyprland/default.nix
Normal file
65
modules/desktop/hyprland/default.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{ config, lib, pkgs, system, hyprland, ... }:
|
||||
let
|
||||
exec = "exec Hyprland";
|
||||
in
|
||||
{
|
||||
imports = [ ../../programs/waybar.nix ];
|
||||
|
||||
environment = {
|
||||
loginShellInit = ''
|
||||
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||
${exec}
|
||||
fi
|
||||
''; # Will automatically open Hyprland when logged into tty1
|
||||
|
||||
variables = {
|
||||
#WLR_NO_HARDWARE_CURSORS="1"; # Possible variables needed in vm
|
||||
#WLR_RENDERER_ALLOW_SOFTWARE="1";
|
||||
XDG_CURRENT_DESKTOP = "Hyprland";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
XDG_SESSION_DESKTOP = "Hyprland";
|
||||
};
|
||||
sessionVariables = {
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
|
||||
GDK_BACKEND = "wayland";
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
};
|
||||
systemPackages = with pkgs; [
|
||||
grim
|
||||
mpvpaper
|
||||
slurp
|
||||
swappy
|
||||
swaylock
|
||||
wl-clipboard
|
||||
wlr-randr
|
||||
];
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = {
|
||||
text = ''
|
||||
auth include login
|
||||
'';
|
||||
};
|
||||
|
||||
programs = {
|
||||
hyprland = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
# Required for flatpak with window managers and for file browsing
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
# Waybar with experimental features
|
||||
(final: prev: {
|
||||
waybar = hyprland.packages.${system}.waybar-hyprland;
|
||||
})
|
||||
];
|
||||
}
|
||||
186
modules/desktop/hyprland/home.nix
Normal file
186
modules/desktop/hyprland/home.nix
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
hyprlandConf = ''
|
||||
monitor=,preferred,auto,auto
|
||||
$mainMod=SUPER
|
||||
|
||||
general {
|
||||
border_size=3
|
||||
gaps_in=5
|
||||
gaps_out=7
|
||||
col.active_border=rgba(33ccffee) rgba(00ff99ee) 45deg
|
||||
col.inactive_border=0x66333333
|
||||
layout=dwindle
|
||||
}
|
||||
|
||||
decoration {
|
||||
rounding=5
|
||||
multisample_edges=true
|
||||
active_opacity=0.93
|
||||
inactive_opacity=0.93
|
||||
fullscreen_opacity=1
|
||||
blur=true
|
||||
drop_shadow=false
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled=true
|
||||
bezier = myBezier,0.1,0.7,0.1,1.05
|
||||
animation=fade,1,7,default
|
||||
animation=windows,1,7,myBezier
|
||||
animation=windowsOut,1,3,default,popin 60%
|
||||
animation=windowsMove,1,7,myBezier
|
||||
}
|
||||
|
||||
input {
|
||||
kb_layout=us
|
||||
kb_options=caps:ctrl_modifier
|
||||
follow_mouse=2
|
||||
repeat_delay=250
|
||||
numlock_by_default=1
|
||||
accel_profile=flat
|
||||
sensitivity=0.8
|
||||
touchpad {
|
||||
natural_scroll=true
|
||||
middle_button_emulation=true
|
||||
tap-to-click=true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gestures {
|
||||
workspace_swipe=true
|
||||
workspace_swipe_fingers=3
|
||||
workspace_swipe_distance=100
|
||||
}
|
||||
|
||||
dwindle {
|
||||
pseudotile=false
|
||||
force_split=2
|
||||
}
|
||||
|
||||
debug {
|
||||
damage_tracking=2
|
||||
}
|
||||
|
||||
bindm=$mainMod,mouse:272,movewindow
|
||||
bindm=$mainMod,mouse:273,resizewindow
|
||||
|
||||
bind=$mainMod,Return,exec,${pkgs.alacritty}/bin/alacritty
|
||||
bind=$mainMod,Q,killactive,
|
||||
bind=$mainMod,Escape,exit,
|
||||
bind=$mainMod,L,exec,${pkgs.swaylock}/bin/swaylock
|
||||
bind=$mainMod,E,exec,${pkgs.pcmanfm}/bin/pcmanfm
|
||||
bind=$mainMod,H,togglefloating,
|
||||
#bind=$mainMod,Space,exec,${pkgs.rofi}/bin/rofi -show drun
|
||||
bind=$mainMod,Space,exec,${pkgs.wofi}/bin/wofi --show drun
|
||||
bind=$mainMod,P,pseudo,
|
||||
bind=$mainMod,F,fullscreen,
|
||||
bind=$mainMod,R,forcerendererreload
|
||||
bind=$mainMod,R,exec,${pkgs.hyprland}/bin/hyprctl reload
|
||||
|
||||
bind=$mainMod,left,movefocus,l
|
||||
bind=$mainMod,right,movefocus,r
|
||||
bind=$mainMod,up,movefocus,u
|
||||
bind=$mainMod,down,movefocus,d
|
||||
|
||||
bind=$mainMod SHIFT,left,movewindow,l
|
||||
bind=$mainMod SHIFT,right,movewindow,r
|
||||
bind=$mainMod SHIFT,up,movewindow,u
|
||||
bind=$mainMod SHIFT,down,movewindow,d
|
||||
|
||||
bind=$mainMod,1,workspace,1
|
||||
bind=$mainMod,2,workspace,2
|
||||
bind=$mainMod,3,workspace,3
|
||||
bind=$mainMod,4,workspace,4
|
||||
bind=$mainMod,5,workspace,5
|
||||
bind=$mainMod,6,workspace,6
|
||||
bind=$mainMod,7,workspace,7
|
||||
bind=$mainMod,8,workspace,8
|
||||
bind=$mainMod,9,workspace,9
|
||||
bind=$mainMod,0,workspace,10
|
||||
bind=$mainMod,right,workspace,+1
|
||||
bind=$mainMod,left,workspace,-1
|
||||
|
||||
bind=$mainMod SHIFT,1,movetoworkspace,1
|
||||
bind=$mainMod SHIFT,2,movetoworkspace,2
|
||||
bind=$mainMod SHIFT,3,movetoworkspace,3
|
||||
bind=$mainMod SHIFT,4,movetoworkspace,4
|
||||
bind=$mainMod SHIFT,5,movetoworkspace,5
|
||||
bind=$mainMod SHIFT,6,movetoworkspace,6
|
||||
bind=$mainMod SHIFT,7,movetoworkspace,7
|
||||
bind=$mainMod SHIFT,8,movetoworkspace,8
|
||||
bind=$mainMod SHIFT,9,movetoworkspace,9
|
||||
bind=$mainMod SHIFT,0,movetoworkspace,10
|
||||
bind=$mainMod SHIFT,right,movetoworkspace,+1
|
||||
bind=$mainMod SHIFT,left,movetoworkspace,-1
|
||||
|
||||
bind=CTRL,right,resizeactive,20 0
|
||||
bind=CTRL,left,resizeactive,-20 0
|
||||
bind=CTRL,up,resizeactive,0 -20
|
||||
bind=CTRL,down,resizeactive,0 20
|
||||
|
||||
bind=,print,exec,${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.swappy}/bin/swappy -f - -o ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png && notify-send "Saved to ~/Pictures/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png"
|
||||
|
||||
bind=,XF86AudioLowerVolume,exec,${pkgs.pamixer}/bin/pamixer -d 10
|
||||
bind=,XF86AudioRaiseVolume,exec,${pkgs.pamixer}/bin/pamixer -i 10
|
||||
bind=,XF86AudioMute,exec,${pkgs.pamixer}/bin/pamixer -t
|
||||
bind=,XF86AudioMicMute,exec,${pkgs.pamixer}/bin/pamixer --default-source -t
|
||||
bind=,XF86MonBrightnessDown,exec,${pkgs.light}/bin/light -U 10
|
||||
bind=,XF86MonBrightnessUP,exec,${pkgs.light}/bin/light -A 10
|
||||
|
||||
#windowrule=float,^(Rofi)$
|
||||
windowrule=float,title:^(Volume Control)$
|
||||
windowrule=float,title:^(Picture-in-Picture)$
|
||||
windowrule=pin,title:^(Picture-in-Picture)$
|
||||
windowrule=move 75% 75% ,title:^(Picture-in-Picture)$
|
||||
windowrule=size 24% 24% ,title:^(Picture-in-Picture)$
|
||||
|
||||
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
|
||||
exec-once=${pkgs.waybar}/bin/waybar
|
||||
exec-once=${pkgs.blueman}/bin/blueman-applet
|
||||
exec-once=${pkgs.swaybg}/bin/swaybg -m fill -i $HOME/.config/wall
|
||||
'';
|
||||
in
|
||||
{
|
||||
xdg.configFile."hypr/hyprland.conf".text = hyprlandConf;
|
||||
|
||||
programs.swaylock.settings = {
|
||||
image = "$HOME/.config/lock";
|
||||
color = "000000f0";
|
||||
font-size = "24";
|
||||
indicator-idle-visible = false;
|
||||
indicator-radius = 100;
|
||||
indicator-thickness = 20;
|
||||
inside-color = "00000000";
|
||||
inside-clear-color = "00000000";
|
||||
inside-ver-color = "00000000";
|
||||
inside-wrong-color = "00000000";
|
||||
key-hl-color = "79b360";
|
||||
line-color = "000000f0";
|
||||
line-clear-color = "000000f0";
|
||||
line-ver-color = "000000f0";
|
||||
line-wrong-color = "000000f0";
|
||||
ring-color = "ffffff50";
|
||||
ring-clear-color = "bbbbbb50";
|
||||
ring-ver-color = "bbbbbb50";
|
||||
ring-wrong-color = "b3606050";
|
||||
text-color = "ffffff";
|
||||
text-ver-color = "ffffff";
|
||||
text-wrong-color = "ffffff";
|
||||
show-failed-attempts = true;
|
||||
};
|
||||
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
events = [
|
||||
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -f"; }
|
||||
{ event = "lock"; command = "lock"; }
|
||||
];
|
||||
timeouts = [
|
||||
{ timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -f"; }
|
||||
];
|
||||
systemdTarget = "xdg-desktop-portal-hyprland.service";
|
||||
};
|
||||
}
|
||||
4
modules/desktop/virtualisation/default.nix
Normal file
4
modules/desktop/virtualisation/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[
|
||||
./docker.nix
|
||||
./virtualbox.nix
|
||||
]
|
||||
21
modules/desktop/virtualisation/docker.nix
Normal file
21
modules/desktop/virtualisation/docker.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
};
|
||||
|
||||
users.groups.docker.members = [ "${user}" ];
|
||||
|
||||
#environment = {
|
||||
# interactiveShellInit = ''
|
||||
# alias rtmp='docker start nginx-rtmp'
|
||||
# ''; # Alias to easily start container
|
||||
#};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
docker-compose
|
||||
distrobox
|
||||
];
|
||||
}
|
||||
|
||||
20
modules/desktop/virtualisation/virtualbox.nix
Normal file
20
modules/desktop/virtualisation/virtualbox.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, pkgs, user, ... }:
|
||||
|
||||
{
|
||||
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
users.extraGroups.vboxusers.members = [ "${user}" ];
|
||||
virtualisation.virtualbox.host.enableExtensionPack = true;
|
||||
|
||||
|
||||
#environment = {
|
||||
# interactiveShellInit = ''
|
||||
# alias rtmp='docker start nginx-rtmp'
|
||||
# ''; # Alias to easily start container
|
||||
#};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
vagrant
|
||||
];
|
||||
}
|
||||
|
||||
3
modules/editors/default.nix
Normal file
3
modules/editors/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[
|
||||
# ./nvim
|
||||
]
|
||||
15
modules/editors/helix/config.toml
Normal file
15
modules/editors/helix/config.toml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
theme = "onedark"
|
||||
|
||||
[editor]
|
||||
line-number = "relative"
|
||||
mouse = true
|
||||
auto-completion = true
|
||||
|
||||
[editor.cursor-shape]
|
||||
insert = "bar"
|
||||
normal = "block"
|
||||
select = "underline"
|
||||
|
||||
[editor.file-picker]
|
||||
hidden = false
|
||||
|
||||
25
modules/editors/helix/home.nix
Normal file
25
modules/editors/helix/home.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
helix = { enable = true; };
|
||||
|
||||
};
|
||||
|
||||
xdg.configFile = { "helix/config.toml".source = ./config.toml; };
|
||||
|
||||
home.packages = with pkgs; [
|
||||
pyright
|
||||
nil
|
||||
taplo
|
||||
yaml-language-server
|
||||
terraform-ls
|
||||
lua-language-server
|
||||
rust-analyzer
|
||||
nixfmt
|
||||
nodePackages_latest.bash-language-server
|
||||
nodePackages_latest.typescript-language-server
|
||||
python311Packages.python-lsp-server
|
||||
];
|
||||
|
||||
}
|
||||
0
modules/editors/helix/languages.toml
Normal file
0
modules/editors/helix/languages.toml
Normal file
16
modules/editors/nvim/config/init.lua
Normal file
16
modules/editors/nvim/config/init.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
vim.opt.expandtab = true
|
||||
vim.opt.hidden = true
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.mouse = "a"
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
vim.opt.signcolumn = "yes:3"
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.timeoutlen = 0
|
||||
vim.wo.wrap = false
|
||||
vim.opt.exrc = true
|
||||
vim.cmd("syntax on")
|
||||
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
28
modules/editors/nvim/config/lspconfig.lua
Normal file
28
modules/editors/nvim/config/lspconfig.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
local lspc = require'lspconfig'
|
||||
|
||||
lspc.nil_ls.setup{}
|
||||
lspc.clangd.setup{}
|
||||
|
||||
local buf_map = function(bufnr, mode, lhs, rhs, opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or {
|
||||
silent = true,
|
||||
})
|
||||
end
|
||||
|
||||
lspc.tsserver.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
client.resolved_capabilities.document_formatting = false
|
||||
client.resolved_capabilities.document_range_formatting = false
|
||||
|
||||
local ts_utils = require("nvim-lsp-ts-utils")
|
||||
ts_utils.setup({})
|
||||
ts_utils.setup_client(client)
|
||||
|
||||
buf_map(bufnr, "n", "gs", ":TSLspOrganize<CR>")
|
||||
buf_map(bufnr, "n", "gi", ":TSLspRenameFile<CR>")
|
||||
buf_map(bufnr, "n", "go", ":TSLspImportAll<CR>")
|
||||
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
})
|
||||
|
||||
73
modules/editors/nvim/config/nvim-cmp.lua
Normal file
73
modules/editors/nvim/config/nvim-cmp.lua
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
local has_words_before = function()
|
||||
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
|
||||
end
|
||||
|
||||
local feedkey = function(key, mode)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
||||
end
|
||||
|
||||
local cmp = require("cmp")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
cmp.setup({
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "cmp_tabnine" },
|
||||
{ name = "treesitter" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "vsnip" },
|
||||
-- { name = "copilot" },
|
||||
},
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
with_text = true,
|
||||
menu = {
|
||||
buffer = "[Buf]",
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
latex_symbols = "[Latex]",
|
||||
treesitter = "[TS]",
|
||||
cmp_tabnine = "[TN]",
|
||||
vsnip = "[Snip]",
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
mapping = {
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
},
|
||||
})
|
||||
20
modules/editors/nvim/config/theming.lua
Normal file
20
modules/editors/nvim/config/theming.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
-- set colorscheme
|
||||
vim.cmd 'set termguicolors'
|
||||
|
||||
vim.g.catppuccin_flavour = "mocha"
|
||||
|
||||
require("catppuccin").setup()
|
||||
|
||||
vim.cmd [[colorscheme catppuccin]]
|
||||
|
||||
-- enable colorizer
|
||||
require'colorizer'.setup()
|
||||
|
||||
-- set sign
|
||||
vim.cmd 'sign define DiagnosticSignError text= linehl= texthl=DiagnosticSignError numhl='
|
||||
vim.cmd 'sign define DiagnosticSignHint text= linehl= texthl=DiagnosticSignHint numhl='
|
||||
vim.cmd 'sign define DiagnosticSignInfo text= linehl= texthl=DiagnosticSignInfo numhl='
|
||||
vim.cmd 'sign define DiagnosticSignWarn text= linehl= texthl=DiagnosticSignWarn numhl='
|
||||
|
||||
-- set lightline theme to horizon
|
||||
vim.g.lightline = { colorscheme = "catppuccin" }
|
||||
14
modules/editors/nvim/config/treesitter-textobjects.lua
Normal file
14
modules/editors/nvim/config/treesitter-textobjects.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
30
modules/editors/nvim/config/treesitter.lua
Normal file
30
modules/editors/nvim/config/treesitter.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "grn",
|
||||
scope_incremental = "grc",
|
||||
node_decremental = "grm",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- breaks highlight
|
||||
-- vim.cmd([[set foldmethod=expr]])
|
||||
-- vim.cmd([[set foldlevel=10]])
|
||||
-- vim.cmd([[set foldexpr=nvim_treesitter#foldexpr()]])
|
||||
29
modules/editors/nvim/config/utils.lua
Normal file
29
modules/editors/nvim/config/utils.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- telescope
|
||||
require('telescope').load_extension('fzy_native')
|
||||
|
||||
-- null-ls
|
||||
local nb = require('null-ls').builtins
|
||||
|
||||
require('null-ls').setup({
|
||||
sources = {
|
||||
nb.formatting.alejandra,
|
||||
nb.code_actions.statix,
|
||||
nb.diagnostics.cppcheck,
|
||||
nb.diagnostics.deadnix,
|
||||
nb.diagnostics.statix,
|
||||
nb.diagnostics.eslint,
|
||||
nb.completion.spell,
|
||||
},
|
||||
})
|
||||
|
||||
require("gitsigns").setup()
|
||||
|
||||
-- autopairs
|
||||
require('nvim-autopairs').setup{}
|
||||
|
||||
-- copy to system clipboard
|
||||
vim.api.nvim_set_keymap( 'v', '<Leader>y', '"+y', {noremap = true})
|
||||
vim.api.nvim_set_keymap( 'n', '<Leader>y', ':%+y<CR>', {noremap = true})
|
||||
|
||||
-- paste from system clipboard
|
||||
vim.api.nvim_set_keymap( 'n', '<Leader>p', '"+p', {noremap = true})
|
||||
39
modules/editors/nvim/config/which-key.lua
Normal file
39
modules/editors/nvim/config/which-key.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.setup({})
|
||||
|
||||
wk.register({
|
||||
["<leader>"] = {
|
||||
b = { "<cmd>Telescope buffers<cr>", "Buffers" },
|
||||
["/"] = { "<cmd>Telescope live_grep<cr>", "Live Grep" },
|
||||
f = { "<cmd>Telescope find_files<cr>", "Find File" },
|
||||
g = {
|
||||
name = "Git / VCS",
|
||||
i = { "<cmd>lua require('telescope').extensions.gh.issues()<cr>", "Github Issues" },
|
||||
p = { "<cmd>lua require('telescope').extensions.gh.pull_request()<cr>", "Github PRs" },
|
||||
b = { "<cmd>ToggleBlameLine<cr>", "Toggle BlameLine" },
|
||||
c = { "<cmd>Neogit commit<cr>", "Commit" },
|
||||
s = { "<cmd>Neogit kind=split<cr>", "Staging" },
|
||||
},
|
||||
a = { "<cmd>lua require('telescope.builtin').lsp_code_actions()<cr>", "Code Actions" },
|
||||
d = { "<cmd>lua require('telescope.builtin').lsp_document_diagnostics()<cr>", "LSP Diagnostics" },
|
||||
k = { "<cmd>lua vim.lsp.buf.signature_help()<cr>", "Signature Help" },
|
||||
l = {
|
||||
name = "LSP",
|
||||
f = { "<cmd>lua vim.lsp.buf.formatting_sync()<cr>", "Format file"},
|
||||
q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", "Set Loclist" },
|
||||
e = { "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>", "Show Line Diagnostics" },
|
||||
},
|
||||
p = { "\"+p", "Paste from clipboard" },
|
||||
P = { "\"+P", "Paste from clipboard before cursor" },
|
||||
y = { "\"+y", "Yank to clipboard" },
|
||||
},
|
||||
g = {
|
||||
l = { "$", "Line end" },
|
||||
h = { "0", "Line start" },
|
||||
s = { "^", "First non-blank in line" },
|
||||
e = { "G", "Bottom" },
|
||||
},
|
||||
})
|
||||
65
modules/editors/nvim/home.nix
Normal file
65
modules/editors/nvim/home.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
vimdiffAlias = true;
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
catppuccin-nvim
|
||||
cmp-buffer
|
||||
cmp-nvim-lsp
|
||||
cmp-path
|
||||
cmp-spell
|
||||
cmp-treesitter
|
||||
cmp-vsnip
|
||||
friendly-snippets
|
||||
gitsigns-nvim
|
||||
lightline-vim
|
||||
lspkind-nvim
|
||||
neogit
|
||||
null-ls-nvim
|
||||
nvim-autopairs
|
||||
nvim-cmp
|
||||
nvim-colorizer-lua
|
||||
nvim-lspconfig
|
||||
nvim-tree-lua
|
||||
nvim-ts-rainbow
|
||||
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars))
|
||||
plenary-nvim
|
||||
telescope-fzy-native-nvim
|
||||
telescope-nvim
|
||||
telescope-github-nvim
|
||||
vim-floaterm
|
||||
vim-sneak
|
||||
vim-vsnip
|
||||
which-key-nvim
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [ gcc ripgrep fd deadnix ];
|
||||
|
||||
extraConfig =
|
||||
let
|
||||
luaRequire = module:
|
||||
builtins.readFile (builtins.toString
|
||||
./config
|
||||
+ "/${module}.lua");
|
||||
luaConfig = builtins.concatStringsSep "\n" (map luaRequire [
|
||||
"init"
|
||||
"lspconfig"
|
||||
"nvim-cmp"
|
||||
"theming"
|
||||
"treesitter"
|
||||
"treesitter-textobjects"
|
||||
"utils"
|
||||
"which-key"
|
||||
]);
|
||||
in
|
||||
''
|
||||
lua <<
|
||||
${luaConfig}
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
||||
13
modules/hardware/bluetooth.nix
Normal file
13
modules/hardware/bluetooth.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
#hsphfpd.enable = true; # HSP & HFP daemon
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
3
modules/hardware/default.nix
Normal file
3
modules/hardware/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[
|
||||
./bluetooth.nix
|
||||
]
|
||||
437
modules/programs/waybar.nix
Normal file
437
modules/programs/waybar.nix
Normal file
|
|
@ -0,0 +1,437 @@
|
|||
{ config, lib, pkgs, host, user, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
waybar
|
||||
];
|
||||
|
||||
home-manager.users.${user} = {
|
||||
# Home-manager waybar config
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd = {
|
||||
enable = true;
|
||||
target = "sway-session.target"; # Needed for waybar to start automatically
|
||||
};
|
||||
|
||||
style = ''
|
||||
* {
|
||||
border: none;
|
||||
font-family: FiraCode Nerd Font Mono;
|
||||
/*font-weight: bold;*/
|
||||
font-size: 12px;
|
||||
text-shadow: 0px 0px 5px #000000;
|
||||
}
|
||||
button:hover {
|
||||
background-color: rgba(80,100,100,0.4);
|
||||
}
|
||||
window#waybar {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
background: transparent;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
border-bottom: none;
|
||||
}
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
#workspace,
|
||||
#mode,
|
||||
#clock,
|
||||
#pulseaudio,
|
||||
#custom-sink,
|
||||
#network,
|
||||
#mpd,
|
||||
#memory,
|
||||
#network,
|
||||
#window,
|
||||
#cpu,
|
||||
#disk,
|
||||
#backlight,
|
||||
#battery,
|
||||
#custom-ds4,
|
||||
#tray {
|
||||
color: #999999;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
#custom-menu {
|
||||
color: #A7C7E7;
|
||||
padding: 0px 5px 0px 5px;
|
||||
}
|
||||
#workspaces button {
|
||||
padding: 0px 5px;
|
||||
min-width: 5px;
|
||||
color: rgba(255,255,255,0.8);
|
||||
}
|
||||
#workspaces button:hover {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
}
|
||||
/*#workspaces button.focused {*/
|
||||
#workspaces button.active {
|
||||
color: rgba(255,255,255,0.8);
|
||||
background-color: rgba(80,100,100,0.4);
|
||||
}
|
||||
#workspaces button.visible {
|
||||
color: #ccffff;
|
||||
}
|
||||
#workspaces button.hidden {
|
||||
color: #999999;
|
||||
}
|
||||
#battery.warning {
|
||||
color: #ff5d17;
|
||||
background-color: rgba(0,0,0,0);
|
||||
}
|
||||
#battery.critical {
|
||||
color: #ff200c;
|
||||
background-color: rgba(0,0,0,0);
|
||||
}
|
||||
#battery.charging {
|
||||
color: #9ece6a;
|
||||
background-color: rgba(0,0,0,0);
|
||||
}
|
||||
'';
|
||||
settings = with host; {
|
||||
Main = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 16;
|
||||
output = [
|
||||
"${mainMonitor}"
|
||||
];
|
||||
tray = { spacing = 5; };
|
||||
#modules-center = [ "clock" ];
|
||||
modules-left = with config;
|
||||
if programs.hyprland.enable == true then
|
||||
[ "custom/menu" "wlr/workspaces" ]
|
||||
else if programs.sway.enable == true then
|
||||
[ "sway/workspaces" "sway/window" "sway/mode" ]
|
||||
else [ ];
|
||||
|
||||
modules-right =
|
||||
if hostName == "desktop" then
|
||||
[ "custom/ds4" "custom/pad" "network" "cpu" "memory" "custom/pad" "pulseaudio" "custom/sink" "custom/pad" "clock" "tray" ]
|
||||
else
|
||||
[ "cpu" "memory" "custom/pad" "battery" "custom/pad" "backlight" "custom/pad" "pulseaudio" "custom/pad" "clock" "tray" ];
|
||||
|
||||
"custom/pad" = {
|
||||
format = " ";
|
||||
tooltip = false;
|
||||
};
|
||||
"custom/menu" = {
|
||||
format = "<span font='16'></span>";
|
||||
#on-click = ''${pkgs.rofi}/bin/rofi -show power-menu -modi "power-menu:rofi-power-menu --choices=logout/suspend/reboot/shutdown"'';
|
||||
#on-click-right = "${pkgs.rofi}/bin/rofi -show drun";
|
||||
on-click = ''~/.config/wofi/power.sh'';
|
||||
on-click-right = "${pkgs.wofi}/bin/wofi --show drun";
|
||||
tooltip = false;
|
||||
};
|
||||
"sway/workspaces" = {
|
||||
format = "<span font='12'>{icon}</span>";
|
||||
format-icons = {
|
||||
"1" = "";
|
||||
"2" = "";
|
||||
"3" = "";
|
||||
"4" = "";
|
||||
"5" = "";
|
||||
};
|
||||
all-outputs = true;
|
||||
persistent_workspaces = {
|
||||
"1" = [ ];
|
||||
"2" = [ ];
|
||||
"3" = [ ];
|
||||
"4" = [ ];
|
||||
"5" = [ ];
|
||||
};
|
||||
};
|
||||
"wlr/workspaces" = {
|
||||
format = "<span font='11'>{name}</span>";
|
||||
#format = "<span font='12'>{icon}</span>";
|
||||
#format-icons = {
|
||||
# "1"="";
|
||||
# "2"="";
|
||||
# "3"="";
|
||||
# "4"="";
|
||||
# "5"="";
|
||||
# "6"="";
|
||||
# "7"="";
|
||||
# "8"="";
|
||||
# "9"="";
|
||||
# "10"="";
|
||||
#};
|
||||
#all-outputs = true;
|
||||
active-only = false;
|
||||
on-click = "activate";
|
||||
};
|
||||
clock = {
|
||||
format = "{:%b %d %H:%M} ";
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
#format-alt = "{:%A, %B %d, %Y} ";
|
||||
};
|
||||
cpu = {
|
||||
format = " {usage}% <span font='11'></span> ";
|
||||
interval = 1;
|
||||
};
|
||||
disk = {
|
||||
format = "{percentage_used}% <span font='11'></span>";
|
||||
path = "/";
|
||||
interval = 30;
|
||||
};
|
||||
memory = {
|
||||
format = "{}% <span font='11'></span>";
|
||||
interval = 1;
|
||||
};
|
||||
backlight = {
|
||||
device = "intel_backlight";
|
||||
format = "{percent}% <span font='11'>{icon}</span>";
|
||||
format-icons = [ "" "" ];
|
||||
on-scroll-down = "${pkgs.light}/bin/light -U 5";
|
||||
on-scroll-up = "${pkgs.light}/bin/light -A 5";
|
||||
};
|
||||
battery = {
|
||||
interval = 60;
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% <span font='11'>{icon}</span>";
|
||||
format-charging = "{capacity}% <span font='11'></span>";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
max-length = 25;
|
||||
};
|
||||
network = {
|
||||
format-wifi = "<span font='11'></span>";
|
||||
format-ethernet = "<span font='11'></span>";
|
||||
#format-ethernet = "<span font='11'></span> {ifname}: {ipaddr}/{cidr}";
|
||||
format-linked = "<span font='11'></span> {ifname} (No IP)";
|
||||
format-disconnected = "<span font='11'></span> Not connected";
|
||||
#format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
tooltip-format = "{essid} {ipaddr}/{cidr}";
|
||||
#on-click-right = "${pkgs.alacritty}/bin/alacritty -e nmtui";
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "<span font='11'>{icon}</span> {volume}% {format_source} ";
|
||||
format-bluetooth = "<span font='11'>{icon}</span> {volume}% {format_source} ";
|
||||
format-bluetooth-muted = "<span font='11'>x</span> {volume}% {format_source} ";
|
||||
format-muted = "<span font='11'>x</span> {volume}% {format_source} ";
|
||||
#format-source = "{volume}% <span font='11'></span>";
|
||||
format-source = "<span font='10'></span> ";
|
||||
format-source-muted = "<span font='11'> </span> ";
|
||||
format-icons = {
|
||||
default = [ "" "" "" ];
|
||||
headphone = "";
|
||||
#hands-free = "";
|
||||
#headset = "";
|
||||
#phone = "";
|
||||
#portable = "";
|
||||
#car = "";
|
||||
};
|
||||
tooltip-format = "{desc}, {volume}%";
|
||||
on-click = "${pkgs.pamixer}/bin/pamixer -t";
|
||||
on-click-right = "${pkgs.pamixer}/bin/pamixer --default-source -t";
|
||||
on-click-middle = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
};
|
||||
"custom/sink" = {
|
||||
format = "{}";
|
||||
exec = "$HOME/.config/waybar/script/sink.sh";
|
||||
interval = 2;
|
||||
on-click = "$HOME/.config/waybar/script/switch.sh";
|
||||
tooltip = false;
|
||||
};
|
||||
"custom/ds4" = {
|
||||
format = "{}";
|
||||
exec = "$HOME/.config/waybar/script/ds4.sh";
|
||||
interval = 60;
|
||||
};
|
||||
tray = {
|
||||
icon-size = 13;
|
||||
};
|
||||
};
|
||||
Sec =
|
||||
if hostName == "desktop" || hostName == "work" then {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 16;
|
||||
output =
|
||||
if hostName == "desktop" then [
|
||||
"${secondMonitor}"
|
||||
] else [
|
||||
"${secondMonitor}"
|
||||
"${thirdMonitor}"
|
||||
];
|
||||
modules-left = [ "custom/menu" "wlr/workspaces" ];
|
||||
|
||||
modules-right =
|
||||
if hostName == "desktop" then
|
||||
[ "custom/ds4" "custom/pad" "pulseaudio" "custom/sink" "custom/pad" "clock" ]
|
||||
else
|
||||
[ "cpu" "memory" "custom/pad" "battery" "custom/pad" "backlight" "custom/pad" "pulseaudio" "custom/pad" "clock" ];
|
||||
|
||||
"custom/pad" = {
|
||||
format = " ";
|
||||
tooltip = false;
|
||||
};
|
||||
"custom/menu" = {
|
||||
format = "<span font='16'></span>";
|
||||
#on-click = "${pkgs.rofi}/bin/rofi -show p -modi p:${pkgs.rofi-power-menu}/bin/rofi-power-menu -theme $HOME/.config/rofi/config.rasi";
|
||||
#on-click-right = "${pkgs.rofi}/bin/rofi -show drun";
|
||||
on-click = ''~/.config/wofi/power.sh'';
|
||||
on-click-right = "${pkgs.wofi}/bin/wofi --show drun";
|
||||
tooltip = false;
|
||||
};
|
||||
"wlr/workspaces" = {
|
||||
format = "<span font='11'>{name}</span>";
|
||||
#format = "<span font='12'>{icon}</span>";
|
||||
#format-icons = {
|
||||
# "1"="";
|
||||
# "2"="";
|
||||
# "3"="";
|
||||
# "4"="";
|
||||
# "5"="";
|
||||
# "6"="";
|
||||
# "7"="";
|
||||
# "8"="";
|
||||
# "9"="";
|
||||
# "10"="";
|
||||
#};
|
||||
active-only = false;
|
||||
on-click = "activate";
|
||||
#on-scroll-up = "hyprctl dispatch workspace e+1";
|
||||
#on-scroll-down = "hyprctl dispatch workspace e-1";
|
||||
};
|
||||
clock = {
|
||||
format = "{:%b %d %H:%M}";
|
||||
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
|
||||
#format-alt = "{:%A, %B %d, %Y} ";
|
||||
};
|
||||
cpu = {
|
||||
format = " {usage}% <span font='11'></span> ";
|
||||
interval = 1;
|
||||
};
|
||||
disk = {
|
||||
format = "{percentage_used}% <span font='11'></span>";
|
||||
path = "/";
|
||||
interval = 30;
|
||||
};
|
||||
memory = {
|
||||
format = "{}% <span font='11'></span>";
|
||||
interval = 1;
|
||||
};
|
||||
backlight = {
|
||||
device = "intel_backlight";
|
||||
format = "{percent}% <span font='11'>{icon}</span>";
|
||||
format-icons = [ "" "" ];
|
||||
on-scroll-down = "${pkgs.light}/bin/light -U 5";
|
||||
on-scroll-up = "${pkgs.light}/bin/light -A 5";
|
||||
};
|
||||
battery = {
|
||||
interval = 60;
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% <span font='11'>{icon}</span>";
|
||||
format-charging = "{capacity}% <span font='11'></span>";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
max-length = 25;
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "<span font='11'>{icon}</span> {volume}% {format_source} ";
|
||||
format-bluetooth = "<span font='11'>{icon}</span> {volume}% {format_source} ";
|
||||
format-bluetooth-muted = "<span font='11'>x</span> {volume}% {format_source} ";
|
||||
format-muted = "<span font='11'>x</span> {volume}% {format_source} ";
|
||||
#format-source = "{volume}% <span font='11'></span> ";
|
||||
format-source = "<span font='10'></span> ";
|
||||
format-source-muted = "<span font='11'></span> ";
|
||||
format-icons = {
|
||||
default = [ "" "" "" ];
|
||||
headphone = "";
|
||||
#hands-free = "";
|
||||
#headset = "";
|
||||
#phone = "";
|
||||
#portable = "";
|
||||
#car = "";
|
||||
};
|
||||
tooltip-format = "{desc}, {volume}%";
|
||||
on-click = "${pkgs.pamixer}/bin/pamixer -t";
|
||||
on-click-right = "${pkgs.pamixer}/bin/pamixer --default-source -t";
|
||||
on-click-middle = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
};
|
||||
"custom/sink" = {
|
||||
#format = "<span font='10'>蓼</span>";
|
||||
format = "{}";
|
||||
exec = "$HOME/.config/waybar/script/sink.sh";
|
||||
interval = 2;
|
||||
on-click = "$HOME/.config/waybar/script/switch.sh";
|
||||
tooltip = false;
|
||||
};
|
||||
"custom/ds4" = {
|
||||
format = "{}";
|
||||
exec = "$HOME/.config/waybar/script/ds4.sh";
|
||||
interval = 60;
|
||||
};
|
||||
} else { };
|
||||
};
|
||||
};
|
||||
home.file = {
|
||||
".config/waybar/script/sink.sh" = {
|
||||
# Custom script: Toggle speaker/headset
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
HEAD=$(awk '/ Built-in Audio Analog Stereo/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | sed -n 2p)
|
||||
SPEAK=$(awk '/ S10 Bluetooth Speaker/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1)
|
||||
|
||||
if [[ $HEAD = "*" ]]; then
|
||||
printf "<span font='13'></span>\n"
|
||||
elif [[ $SPEAK = "*" ]]; then
|
||||
printf "<span font='10'></span>\n"
|
||||
fi
|
||||
exit 0
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
".config/waybar/script/switch.sh" = {
|
||||
# Custom script: Toggle speaker/headset
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
ID1=$(awk '/ Built-in Audio Analog Stereo/ {sub(/.$/,"",$2); print $2 }' <(${pkgs.wireplumber}/bin/wpctl status) | head -n 1)
|
||||
ID2=$(awk '/ S10 Bluetooth Speaker/ {sub(/.$/,"",$2); print $2 }' <(${pkgs.wireplumber}/bin/wpctl status) | sed -n 2p)
|
||||
|
||||
HEAD=$(awk '/ Built-in Audio Analog Stereo/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | sed -n 2p)
|
||||
SPEAK=$(awk '/ S10 Bluetooth Speaker/ { print $2 }' <(${pkgs.wireplumber}/bin/wpctl status | grep "*") | head -n 1)
|
||||
|
||||
if [[ $HEAD = "*" ]]; then
|
||||
${pkgs.wireplumber}/bin/wpctl set-default $ID2
|
||||
elif [[ $SPEAK = "*" ]]; then
|
||||
${pkgs.wireplumber}/bin/wpctl set-default $ID1
|
||||
fi
|
||||
exit 0
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
".config/waybar/script/ds4.sh" = {
|
||||
# Custom script: Dualshock battery indicator
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
FILE=/sys/class/power_supply/sony_controller_battery_e8:47:3a:05:c0:2b/capacity
|
||||
FILE2=/sys/class/power_supply/ps-controller-battery-e8:47:3a:05:c0:2b/capacity
|
||||
|
||||
if [[ -f $FILE ]] then
|
||||
DS4BATT=$(cat $FILE)
|
||||
printf "<span font='13'></span> $DS4BATT%%\n"
|
||||
elif [[ -f $FILE2 ]] then
|
||||
DS4BATT=$(cat $FILE2)
|
||||
printf "<span font='13'></span> $DS4BATT%%\n"
|
||||
else
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
98
modules/programs/wofi.nix
Normal file
98
modules/programs/wofi.nix
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (config.lib.formats.rasi) mkLiteral;# Theme.rasi alternative. Add Theme here
|
||||
colors = import ../themes/colors.nix;
|
||||
in
|
||||
{
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
wofi
|
||||
];
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".config/wofi/config" = {
|
||||
text = ''
|
||||
width=280
|
||||
lines=10
|
||||
xoffset=5
|
||||
yoffset=5
|
||||
location=1
|
||||
prompt=Search...
|
||||
filter_rate=100
|
||||
allow_markup=false
|
||||
no_actions=true
|
||||
halign=fill
|
||||
orientation=vertical
|
||||
content_halign=fill
|
||||
insensitive=true
|
||||
allow_images=true
|
||||
image_size=20
|
||||
hide_scroll=true
|
||||
'';
|
||||
};
|
||||
".config/wofi/style.css" = with colors.scheme.doom; {
|
||||
text = ''
|
||||
window {
|
||||
margin: 0px;
|
||||
background-color: #${bg};
|
||||
}
|
||||
|
||||
#input {
|
||||
all: unset;
|
||||
min-height: 20px;
|
||||
padding: 4px 10px;
|
||||
margin: 4px;
|
||||
border: none;
|
||||
color: #dfdfdf;
|
||||
font-weight: bold;
|
||||
background-color: #${bg};
|
||||
outline: #dfdfdf;
|
||||
}
|
||||
|
||||
#inner-box {
|
||||
font-weight: bold;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
#outer-box {
|
||||
margin: 0px;
|
||||
padding: 3px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
border: 3px solid #${text};
|
||||
}
|
||||
|
||||
#text:selected {
|
||||
color: #282c34;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#entry:selected {
|
||||
background-color: #${text};
|
||||
}
|
||||
'';
|
||||
};
|
||||
".config/wofi/power.sh" = with colors.scheme.doom; {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
entries="⏾ Suspend\n⭮ Reboot\n⏻ Shutdown"
|
||||
|
||||
selected=$(echo -e $entries|wofi --dmenu --cache-file /dev/null | awk '{print tolower($2)}')
|
||||
|
||||
case $selected in
|
||||
suspend)
|
||||
exec systemctl suspend;;
|
||||
reboot)
|
||||
exec systemctl reboot;;
|
||||
shutdown)
|
||||
exec systemctl poweroff -i;;
|
||||
esac
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
5
modules/shell/default.nix
Normal file
5
modules/shell/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[
|
||||
# ./git.nix
|
||||
./zsh.nix
|
||||
# ./direnv.nix
|
||||
]
|
||||
20
modules/shell/git/home.nix
Normal file
20
modules/shell/git/home.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, lib, pkgs, user, ... }: {
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Glen Goodwin";
|
||||
userEmail = "glen.goodwin1992@gmail.com";
|
||||
extraConfig = {
|
||||
merge = {
|
||||
ff = "only";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
cocogitto
|
||||
lazygit
|
||||
gh
|
||||
pre-commit
|
||||
];
|
||||
}
|
||||
34
modules/shell/zsh.nix
Normal file
34
modules/shell/zsh.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
autosuggestions.enable = true; # Auto suggest options and highlights syntax, searches in history for options
|
||||
syntaxHighlighting.enable = true;
|
||||
enableCompletion = true;
|
||||
histSize = 100000;
|
||||
|
||||
ohMyZsh = {
|
||||
# Extra plugins for zsh
|
||||
enable = true;
|
||||
plugins = [ "git" ];
|
||||
};
|
||||
|
||||
shellInit = '' # Zsh theme
|
||||
# Spaceship
|
||||
source ${pkgs.spaceship-prompt}/share/zsh/site-functions/prompt_spaceship_setup
|
||||
autoload -U promptinit; promptinit
|
||||
# Hook direnv
|
||||
#emulate zsh -c "$(direnv hook zsh)"
|
||||
# Swag
|
||||
${pkgs.nitch}/bin/nitch
|
||||
|
||||
#eval "$(direnv hook zsh)"
|
||||
eval "$(atuin init zsh)"
|
||||
clear
|
||||
pfetch
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
76
modules/shell/zsh/home.nix
Normal file
76
modules/shell/zsh/home.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{ config, lib, pkgs, user, ... }: {
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
shellAliases = {
|
||||
update = "sudo nixos-rebuild switch";
|
||||
reload = "source ~/.zshrc";
|
||||
|
||||
"." = "cd ../";
|
||||
".." = "cd ../../";
|
||||
"..." = "cd ../../../";
|
||||
"...." = "cd ../../../../";
|
||||
|
||||
ls = "exa --icons";
|
||||
l = "exa -al --icons";
|
||||
la = "exa -a --color=always --group-directories-first --icons"; # all files and dirs
|
||||
ll = "exa -l --color=always --group-directories-first --icons"; # long format
|
||||
lt = "exa -aT --color=always --group-directories-first --icons"; # tree listing
|
||||
|
||||
cat = "bat";
|
||||
ps = "procs";
|
||||
grep = "rg";
|
||||
|
||||
# Default flags
|
||||
rm = "rm -i";
|
||||
chmod = "chmod -R";
|
||||
cp = "cp -R -i -v";
|
||||
mv = "mv -i -v";
|
||||
mkdir = "mkdir -p -v";
|
||||
df = "df -h";
|
||||
du = "du -h -s";
|
||||
dd = "dd status=progress bs=4M conv=fdatasync ";
|
||||
wgetpaste = "wgetpaste -Xx";
|
||||
sudo = "sudo "; # Makes sudo work with es
|
||||
ssh = "TERM=xterm ssh"; # Fixes some issues with ssh on some terminals
|
||||
wget = "wget -c";
|
||||
ping = "ping -c 5";
|
||||
|
||||
# Misc alieses I use often
|
||||
|
||||
ports = "netstat -tulanp";
|
||||
rmd = "rm -rf";
|
||||
mine = "sudo chown -R $(whoami):users";
|
||||
benchmark = "hyperfine --warmup 3 ";
|
||||
c = "clear";
|
||||
listen = "lsof -P -i -n";
|
||||
nc = "nordvpn connect sweden";
|
||||
nd = "nordvpn disconnect";
|
||||
tra = "transmission-remote -a";
|
||||
clock = "sudo ntpd -gq";
|
||||
octal = "stat -c '%a %n'";
|
||||
|
||||
};
|
||||
|
||||
zplug = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
{ name = "zsh-users/zsh-autosuggestions"; }
|
||||
{ name = "zsh-users/zsh-completions"; }
|
||||
{ name = "zsh-users/zsh-syntax-highlighting"; }
|
||||
{ name = "MichaelAquilina/zsh-you-should-use"; }
|
||||
];
|
||||
};
|
||||
|
||||
history = {
|
||||
size = 10000;
|
||||
path = "${config.xdg.dataHome}/zsh/history";
|
||||
};
|
||||
initExtra = ''
|
||||
#clear
|
||||
#neofetch
|
||||
eval "$(atuin init zsh)"
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
49
modules/themes/colors.nix
Normal file
49
modules/themes/colors.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#
|
||||
# System themes
|
||||
#
|
||||
|
||||
{
|
||||
scheme = {
|
||||
doom = {
|
||||
scheme = "Doom One Dark";
|
||||
black = "000000";
|
||||
red = "ff6c6b";
|
||||
orange = "da8548";
|
||||
yellow = "ecbe7b";
|
||||
green = "95be65";
|
||||
teal = "4db5bd";
|
||||
blue = "6eaafb";
|
||||
dark-blue = "2257a0";
|
||||
magenta = "c678dd";
|
||||
violet = "a9a1e1";
|
||||
cyan = "6cdcf7";
|
||||
dark-cyan = "5699af";
|
||||
emphasis = "50536b";
|
||||
text = "dfdfdf";
|
||||
text-alt = "b2b2b2";
|
||||
fg = "abb2bf";
|
||||
bg = "282c34";
|
||||
};
|
||||
|
||||
dracula = {
|
||||
scheme = "Dracula";
|
||||
base00 = "282936"; #background
|
||||
base01 = "3a3c4e";
|
||||
base02 = "4d4f68";
|
||||
base03 = "626483";
|
||||
base04 = "62d6e8";
|
||||
base05 = "e9e9f4"; #foreground
|
||||
base06 = "f1f2f8";
|
||||
base07 = "f7f7fb";
|
||||
base08 = "ea51b2";
|
||||
base09 = "b45bcf";
|
||||
base0A = "00f769";
|
||||
base0B = "ebff87";
|
||||
base0C = "a1efe4";
|
||||
base0D = "62d6e8";
|
||||
base0E = "b45bcf";
|
||||
base0F = "00f769";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue