create public release

This commit is contained in:
2023-07-03 22:35:58 +02:00
commit e24157a614
19 changed files with 1864 additions and 0 deletions

260
home/home.nix Normal file
View File

@@ -0,0 +1,260 @@
{
pkgs,
config,
lib,
...
}:
with lib; let
vimrc = import ./vimrc.nix {inherit pkgs vimUtils fetchFromGitHub;};
in {
imports = [./zsh.nix ./i3status-rust.nix ./sway.nix ./i3.nix ./home_packages.nix ./whatsapp-for-linux.nix];
home.stateVersion = "22.11";
home.username = "akill";
home.homeDirectory = "/home/akill";
xdg.enable = true;
xdg.mimeApps = {
enable = true;
defaultApplications = {
"application/pdf" = ["sioyek.desktop"];
};
};
fonts.fontconfig.enable = true;
home.sessionVariables = {
BROWSER = "qutebrowser";
EDITOR = "nvim";
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_ENABLE_WAYLAND = "1";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SUDO_EDITOR = "nvim";
WLR_RENDERER = "vulkan";
};
wayland.windowManager.sway = {enable = true;};
programs = {
home-manager.enable = true;
librewolf = {
enable = true;
package = pkgs.librewolf-wayland;
settings = {
"webgl.disable" = true;
"middlemouse.paste" = false;
};
};
mpv = {
enable = true;
package = pkgs.mpv;
config = {
slang = "eng,en";
alang = "eng,en";
hwdec = "auto";
vo = "gpu-next";
ao = "pipewire";
script-opts-set = "sponsorblock-local_database=no,sponsorblock-skip_categories=[sponsor,intro,selfpromo]";
ytdl-format = "bestvideo[height<=?1080]+bestaudio/best";
};
bindings = {
WHEEL_UP = "ignore";
WHEEL_DOWN = "ignore";
WHEEL_LEFT = "ignore";
WHEEL_RIGHT = "ignore";
};
};
alacritty = {
enable = true;
settings = {
font = {
normal.family = "JetBrainsMono";
italic.family = "JetBrainsMono";
bold.family = "JetBrainsMono";
bold_italic.family = "JetBrainsMono";
size = 14.0;
};
selection = {
text = "0xcfcfc2";
background = "0x232629";
normal = {
black = "0x1c1b19";
red = "0xef2f27";
green = "0x519f50";
yellow = "0xfbb829";
blue = "0x2c78bf";
magenta = "0xe02c6d";
cyan = "0x0aaeb3";
white = "0x918175";
};
bright = {
black = "0x2D2C29";
red = "0xf75341";
green = "0x98bc37";
yellow = "0xfed06e";
blue = "0x68A8E4";
magenta = "0xff5c8f";
cyan = "0x53fde9";
white = "0xfce8c3";
};
};
};
};
rofi = {
enable = true;
theme = "gruvbox-dark";
};
foot = {
enable = true;
server.enable = true;
settings = {
main = {
font = "JetBrainsMono:size=10";
dpi-aware = "yes";
};
mouse = {hide-when-typing = "yes";};
};
};
qutebrowser = {
enable = true;
package = pkgs.qutebrowser-qt6;
keyBindings = {
normal = {
"j" = "scroll-px 0 25";
"k" = "scroll-px 0 -25";
"u" = "undo --window";
";v" = "hint links userscript view_in_mpv";
};
};
settings = {
content.notifications.enabled = false;
content.pdfjs = true;
content.webgl = false;
fonts.completion.category = "14pt monospace";
fonts.completion.entry = "14pt monospace";
fonts.contextmenu = "14pt monospace";
fonts.debug_console = "14pt monospace";
fonts.downloads = "14pt monospace";
fonts.hints = "14pt monospace";
fonts.keyhint = "14pt monospace";
fonts.messages.info = "14pt monospace";
fonts.prompts = "14pt monospace";
fonts.statusbar = "14pt monospace";
hints.chars = "1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9ol0p";
tabs.last_close = "close";
tabs.position = "left";
tabs.show = "multiple";
tabs.tabs_are_windows = true;
tabs.width = "12%";
zoom.default = "125%";
};
};
git = {
enable = true;
userName = "Asmir A";
userEmail = "asmir.abdulahovic@gmail.com";
extraConfig = {
pull = {rebase = true;};
credential = {helper = "store";};
};
};
neovim = {
enable = true;
vimAlias = true;
vimdiffAlias = true;
plugins = vimrc.plugins;
extraConfig = "";
extraPackages = vimrc.extraPackages;
};
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [obs-vkcapture input-overlay obs-multi-rtmp obs-pipewire-audio-capture wlrobs obs-vaapi];
};
i3status-rust.enable = true;
z-lua.enable = true;
zsh.enable = true;
};
xdg.configFile."nvim/init.lua" = {
source = ./vimrc.lua;
recursive = true;
};
services = {
lorri.enable = false;
mako.enable = true;
gammastep = {
enable = true;
latitude = "44.53";
longitude = "18.67";
temperature.day = 5500;
temperature.night = 2900;
};
gnome-keyring.enable = true;
gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "swaylock_bg_blur.sh";
}
{
event = "lock";
command = "swaylock_bg_blur.sh";
}
{
event = "after-resume";
command = "pkill -USR1 i3status-rs";
}
];
timeouts = [
{
timeout = 15 * 60;
command = "swaylock_bg_blur.sh";
}
];
};
};
systemd.user = {
services = {
/*
himalaya = {
Unit.Description = "Himalaya new messages notifier";
Service = {
ExecStart = "himalaya notify";
Restart = "always";
RestartSec = 10;
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
*/
};
};
}

79
home/home_packages.nix Normal file
View File

@@ -0,0 +1,79 @@
{
config,
pkgs,
...
}: {
home.packages = with pkgs; [
alejandra
appimage-run
arp-scan
blackmagic
btop
cached-nix-shell
caddy
cargo
ccls
cemu
compsize
cura
deluge
ffmpeg-full
firefox
gcc
gdb
glab
glaxnimate
gnumake
grim
hyperfine
imagemagick
imv
jellyfin-media-player
kdenlive
kicad
kodi-wayland
libnotify
libreoffice
libva-utils
mediainfo
ncdu
neovide
ngspice
nodePackages.peerflix
openocd
pandoc
pass
patchelf
pavucontrol
pirate-get
powertop
pulsemixer
python3
python3Packages.west
remmina
river
rtorrent
rustc
screen
seer
sioyek
skypeforlinux
slurp
texlive.combined.scheme-full
thunderbird
upx
waybar
wdisplays
whatsapp-for-linux
wireshark
wl-clipboard
wlr-randr
wofi
x2goclient
yt-dlp
zathura
zeal-qt6
zig
zls
];
}

106
home/i3.nix Normal file
View File

@@ -0,0 +1,106 @@
{
config,
lib,
pkgs,
...
}: let
scratchpad_cmd = "floating enable, resize set 1502 845, move position center, move scratchpad, scratchpad show";
in {
xsession.windowManager.i3 = {
enable = true;
package = pkgs.i3;
extraConfig = ''
new_window pixel 3
hide_edge_borders smart
'';
config = rec {
modifier = "Mod1";
keybindings = lib.mkOptionDefault {
"${modifier}+Shift+Return" = "exec alacritty";
"${modifier}+m" = "layout toggle splith tabbed";
"${modifier}+t" = "split toggle";
"${modifier}+s" = "layout toggle split";
"${modifier}+1" = "workspace 1";
"${modifier}+2" = "workspace 2";
"${modifier}+3" = "workspace 3";
"${modifier}+4" = "workspace 4";
"${modifier}+5" = "workspace 5";
"${modifier}+6" = "workspace 6";
"${modifier}+7" = "workspace 7";
"${modifier}+8" = "workspace 8";
"${modifier}+9" = "workspace 9";
"${modifier}+0" = "workspace 10";
"${modifier}+Shift+1" = "move container to workspace 1";
"${modifier}+Shift+2" = "move container to workspace 2";
"${modifier}+Shift+3" = "move container to workspace 3";
"${modifier}+Shift+4" = "move container to workspace 4";
"${modifier}+Shift+5" = "move container to workspace 5";
"${modifier}+Shift+6" = "move container to workspace 6";
"${modifier}+Shift+7" = "move container to workspace 7";
"${modifier}+Shift+8" = "move container to workspace 8";
"${modifier}+Shift+9" = "move container to workspace 9";
"${modifier}+Shift+0" = "move container to workspace 10";
"${modifier}+h" = "focus left";
"${modifier}+j" = "focus down";
"${modifier}+k" = "focus up";
"${modifier}+l" = "focus right";
"${modifier}+slash" = "exec ${pkgs.rofi}/bin/rofi -show window";
"${modifier}+Escape" = "workspace back_and_forth";
"${modifier}+p" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"Mod4+l" = "exec i3-msg [instance=\"python3_scr\"] scratchpad show || exec alacritty --class python3_scr -e python3";
"Mod4+j" = "exec i3-msg [class=\"ViberPC\"] scratchpad show || exec viber";
"Mod4+m" = "exec i3-msg [class=\"Thunderbird\"] scratchpad show || exec thunderbird";
"Mod4+y" = "exec i3-msg [instance=\"pulsemixer_scr\"] scratchpad show || exec alacritty --class pulsemixer_scr -e pulsemixer";
};
window = {
/*
border = 4;
*/
commands = [
{
command = scratchpad_cmd;
criteria = {instance = "pulsemixer_scr|python3_scr";};
}
{
command = scratchpad_cmd;
criteria = {class = "Thunderbird";};
}
{
command = scratchpad_cmd;
criteria = {
class = "ViberPC";
title = "Viber";
};
}
{
command = "focus child, layout tabbed, focus";
criteria = {class = "qutebrowser";};
}
];
};
bars = [
{
position = "top";
fonts = {
names = ["DejaVu Sans Mono" "FontAwesome5Free"];
style = "Fixed Bold SemiCondensed";
size = 7.0;
};
statusCommand = "i3status-rs /home/akill/.config/i3status-rust/config-top.toml";
extraConfig = ''
workspace_min_width 30
'';
}
];
};
};
}

64
home/i3status-rust.nix Normal file
View File

@@ -0,0 +1,64 @@
{
config,
lib,
pkgs,
...
}: {
programs.i3status-rust = {
bars.top = {
icons = "awesome5";
theme = "gruvbox-dark";
settings.theme = {
theme = "plain";
overrides = {
separator_fg = "#3287a8";
};
};
blocks = [
{
block = "battery";
interval = 10;
format = "$icon $percentage $time";
}
{
block = "disk_space";
path = "/";
info_type = "available";
interval = 20;
warning = 20.0;
alert = 10.0;
}
{
block = "net";
device = "wlan0";
interval = 2;
}
{
block = "net";
device = "enp5s0";
interval = 2;
}
{
block = "memory";
}
{
block = "cpu";
interval = 1;
format = "$utilization $barchart $frequency";
}
{
block = "temperature";
interval = 3;
}
{
block = "sound";
}
{
block = "time";
interval = 60;
}
];
};
};
}

116
home/sway.nix Normal file
View File

@@ -0,0 +1,116 @@
{
config,
lib,
pkgs,
...
}: {
wayland.windowManager.sway = {
enable = true;
extraSessionCommands = "";
config = {
fonts = {
names = ["JetBrainsMono"];
style = "Bold Semi-Condensed";
size = 11.0;
};
window.commands = [
{
command = "move scratchpad, resize set 1152 648";
criteria = {app_id = "pulsemixer|python3|whatsapp-for-linux|com.viber.Viber";};
}
{
command = "move scratchpad, resize set 1502 845";
criteria = {class = "ViberPC";};
}
{
command = "floating enable";
criteria = {app_id = "sws_cli";};
}
];
modifier = "Mod4";
output = {
eDP-1 = {
bg = "~/pic/weird_dragon.jpg stretch";
/*
scale = "1.4";
*/
};
};
input = {
"1:1:AT_Translated_Set_2_keyboard" = {repeat_delay = "150";};
"1:1:AT_Translated_Set_2_keyboard" = {repeat_rate = "70";};
"2:7:SynPS/2_Synaptics_TouchPad" = {tap = "enabled";};
};
bars = [
{
position = "top";
fonts = {
names = ["Iosevka" "FontAwesome"];
style = "Bold Semi-Condensed";
size = 12.0;
};
statusCommand = "i3status-rs ~/.config/i3status-rust/config-top.toml";
}
];
keybindings = {
"Alt+Shift+q" = "kill";
"Alt+Shift+Return" = "exec ${pkgs.foot}/bin/footclient";
"Alt+p" = "exec ${pkgs.dmenu-wayland}/bin/dmenu-wl_run -fn \"mono 14\"";
"Alt+Shift+space" = "floating toggle";
"Alt+space" = "focus mode_toggle";
"Alt+m" = "layout toggle splith tabbed";
"Alt+t" = "split toggle";
"Alt+s" = "layout toggle split";
"Alt+1" = "workspace 1";
"Alt+2" = "workspace 2";
"Alt+3" = "workspace 3";
"Alt+4" = "workspace 4";
"Alt+5" = "workspace 5";
"Alt+6" = "workspace 6";
"Alt+7" = "workspace 7";
"Alt+8" = "workspace 8";
"Alt+9" = "workspace 9";
"Alt+0" = "workspace 10";
"Alt+Shift+1" = "move container to workspace 1";
"Alt+Shift+2" = "move container to workspace 2";
"Alt+Shift+3" = "move container to workspace 3";
"Alt+Shift+4" = "move container to workspace 4";
"Alt+Shift+5" = "move container to workspace 5";
"Alt+Shift+6" = "move container to workspace 6";
"Alt+Shift+7" = "move container to workspace 7";
"Alt+Shift+8" = "move container to workspace 8";
"Alt+Shift+9" = "move container to workspace 9";
"Alt+Shift+0" = "move container to workspace 10";
"Alt+h" = "focus left";
"Alt+j" = "focus down";
"Alt+k" = "focus up";
"Alt+l" = "focus right";
"Alt+slash" = "exec lckdo /tmp/.sws_cli_lock footclient -a sws_cli -- sws_cli.sh";
"Alt+Escape" = "workspace back_and_forth";
"Alt+f" = "fullscreen enable";
"Mod4+l" = ''
exec swaymsg [app_id="python3"] scratchpad show || exec foot -a python3 python3'';
"Mod4+h" = "exec swaymsg [app_id=whatsapp-for-linux] scratchpad show || exec whatsapp-for-linux";
"Mod4+j" = "exec swaymsg [app_id=com.viber.Viber] scratchpad show";
"Mod4+y" = ''
exec swaymsg [app_id="pulsemixer"] scratchpad show || exec foot -a pulsemixer pulsemixer'';
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%";
"XF86AudioMute" = "exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle";
"XF86AudioMicMute" = "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle";
};
};
};
}

195
home/vimrc.lua Normal file
View File

@@ -0,0 +1,195 @@
-- Basic settings
vim.g.loaded_matchparen = true
vim.g.netrw_liststyle = 3
vim.go.background = 'dark'
vim.go.belloff = 'all'
vim.go.breakindent = true
vim.go.hlsearch = false
vim.go.laststatus = 0
vim.go.lazyredraw = true
vim.go.showcmd = true
vim.go.synmaxcol = 800
vim.go.syntax = 'on'
vim.go.termguicolors = true
vim.go.titleold = vim.fn.getcwd()
vim.go.title = true
vim.go.wildmenu = true
vim.go.wrap = true
vim.wo.number = true
vim.cmd([[colorscheme gruvbox]])
-- Defines a read-write directory for treesitters in nvim's cache dir
local parser_install_dir = vim.fn.stdpath("cache") .. "/treesitters"
if vim.fn.isdirectory(parser_install_dir) == 0 then
vim.fn.mkdir(parser_install_dir, "p")
end
-- Adding runtime needed for Nix setup on non NixOS
vim.o.runtimepath = vim.o.runtimepath .. "," .. parser_install_dir
require 'nvim-treesitter.install'.compilers = { 'gcc' }
require 'nvim-treesitter.configs'.setup {
ensure_installed = { "c", "cpp", "zig", "python", "verilog", "nix", "lua", "latex" },
parser_install_dir = parser_install_dir,
highlight = { enable = true, disable = {} },
indent = { enable = false, disable = {} },
rainbow = {
enable = true,
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
colors = {
'#ff0000', '#ffa500', '#ffff00', '#008000', '#0051a0', '#8003f2'
} -- table of hex strings
}
}
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap = true, silent = true }
vim.api.nvim_set_keymap('n', '<space>e',
'<cmd>lua vim.diagnostic.open_float()<CR>', opts)
vim.api.nvim_set_keymap('n', '<space>q',
'<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
vim.api.nvim_set_keymap('n', 'Q', '<cmd>nohl<CR>', opts)
vim.api.nvim_set_keymap('n', 'j', 'gj', opts)
vim.api.nvim_set_keymap('n', 'k', 'gk', opts)
vim.api.nvim_set_keymap('v', 'j', 'gj', opts)
vim.api.nvim_set_keymap('v', 'k', 'gk', opts)
vim.api.nvim_set_keymap('n', '<C-J>', '<C-W><C-J>', opts)
vim.api.nvim_set_keymap('n', '<C-K>', '<C-W><C-K>', opts)
vim.api.nvim_set_keymap('n', '<C-L>', '<C-W><C-L>', opts)
vim.api.nvim_set_keymap('n', '<C-H>', '<C-W><C-H>', opts)
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function()
local bufmap = function(mode, lhs, rhs)
vim.keymap.set(mode, lhs, rhs, { buffer = true })
end
-- Displays hover information about the symbol under the cursor
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
-- Jump to the definition
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
-- Jump to declaration
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
-- Lists all the implementations for the symbol under the cursor
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
-- Jumps to the definition of the type symbol
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
-- Lists all the references
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
-- Displays a function's signature information
bufmap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
-- Renames all references to the symbol under the cursor
bufmap('n', 'rn', '<cmd>lua vim.lsp.buf.rename()<cr>')
-- Selects a code action available at the current cursor position
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_code_action()<cr>')
-- Show diagnostics in a floating window
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
-- Move to the previous diagnostic
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
-- Move to the next diagnostic
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
-- Format current buffer
bufmap('n', '<space>f', function() vim.lsp.buf.format { async = true } end)
end
})
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local cmp = require 'cmp'
cmp.setup({
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'buffer' },
{ name = 'path' },
}),
mapping = {
["<Tab>"] = cmp.mapping({
i = function(fallback)
if cmp.visible() then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert })
else
fallback()
end
end,
}),
["<S-Tab>"] = cmp.mapping({
i = function(fallback)
if cmp.visible() then
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Insert })
else
fallback()
end
end,
}),
['<Down>'] = cmp.mapping(cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), { 'i' }),
['<Up>'] = cmp.mapping(cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), { 'i' }),
['<C-n>'] = cmp.mapping({
i = function(fallback)
if cmp.visible() then
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
else
fallback()
end
end
}),
['<C-p>'] = cmp.mapping({
i = function(fallback)
if cmp.visible() then
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
else
fallback()
end
end
}),
['<C-b>'] = 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-e>'] = cmp.mapping({ i = cmp.mapping.close(), c = cmp.mapping.close() }),
['<CR>'] = cmp.mapping({
i = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }),
}),
}
})
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'lua_ls', 'rnix', 'texlab', 'verible' }
local capabilities = require('cmp_nvim_lsp').default_capabilities()
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {
capabilities = capabilities
}
end
require('lspconfig').lua_ls.setup({
single_file_support = true,
})
require('lspconfig').verible.setup({
root_dir = function() return vim.loop.cwd() end
})
if vim.fn.exists('+undofile') ~= 0 then
local undo_dir = vim.env.HOME .. '/.config/nvim/undo'
if vim.fn.isdirectory(undo_dir) == 0 then vim.fn.mkdir(undo_dir, 'p') end
vim.o.undodir = undo_dir
vim.o.undofile = true
end
vim.cmd([[syntax sync minlines=100]])
vim.cmd([[syntax sync maxlines=140]])

44
home/vimrc.nix Normal file
View File

@@ -0,0 +1,44 @@
{
pkgs,
vimUtils,
fetchFromGitHub,
}: {
extraPackages = [
pkgs.ccls
pkgs.clang
pkgs.luaformatter
pkgs.nil
pkgs.pyright
pkgs.rnix-lsp
pkgs.rust-analyzer
pkgs.sumneko-lua-language-server
pkgs.svls
pkgs.texlab
pkgs.tree-sitter
pkgs.zls
pkgs.verible
];
plugins = with pkgs.vimPlugins; [
colorizer
fugitive
fzf-vim
gruvbox
nvim-lspconfig
nvim-treesitter
nvim-ts-rainbow
repeat
targets-vim
UltiSnips
vim-addon-nix
vim-signify
vim-slime
vim-snippets
zig-vim
cmp-nvim-lsp
cmp-buffer
cmp-path
cmp-cmdline
nvim-cmp
];
}

View File

@@ -0,0 +1,35 @@
{
config,
pkgs,
lib,
...
}:
with lib; {
xdg.configFile."whatsapp-for-linux/settings.conf".source = builtins.toFile "settings.conf" (
generators.toINI {} {
General = {
zoom_level = 1;
close_to_tray = false;
};
Network = {
allow_permissions = true;
};
web = {
allow-permissions = true;
hw-accel = 1;
};
general = {
notification-sounds = true;
close-to-tray = true;
start-in-tray = false;
};
appearance = {
prefer-dark-theme = true;
};
}
);
}

104
home/zsh.nix Normal file
View File

@@ -0,0 +1,104 @@
{
config,
lib,
pkgs,
...
}: {
programs.z-lua = {
enableAliases = true;
enableZshIntegration = true;
};
programs.zsh = {
autocd = true;
enableCompletion = false;
syntaxHighlighting.enable = true;
defaultKeymap = "viins";
shellAliases = {
cfind = "cscope -C -R -L1";
chmod = "chmod -v";
chown = "chown -v";
cp = "cp -v";
rm = "rm -v";
ip = "ip --color=auto";
};
history = {
expireDuplicatesFirst = true;
extended = true;
save = 100000;
size = 100000;
};
plugins = [
{
name = "nix_shell";
src = pkgs.zsh-nix-shell;
file = "share/zsh-nix-shell/nix-shell.plugin.zsh";
}
{
name = "nix_completion";
src = pkgs.nix-zsh-completions;
file = "share/zsh/plugins/nix/nix-zsh-completions.plugin.zsh";
}
{
name = "fast_syntax_highlight";
src = pkgs.zsh-fast-syntax-highlighting;
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
}
{
name = "pure_prompt";
src = pkgs.fetchFromGitHub {
owner = "sindresorhus";
repo = "pure";
rev = "47c0c881f0e7cfdb5eaccd335f52ad17b897c060";
sha256 = "15xdhi72pq88ls5gx1h0k23jvb41j6kq6ar17dqmd5d38zsgwl3v";
};
file = "pure.plugin.zsh";
}
{
name = "fzf";
src = pkgs.fzf-zsh;
file = "share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh";
}
{
name = "zsh-sudo";
src = pkgs.fetchFromGitHub {
owner = "hcgraf";
repo = "zsh-sudo";
rev = "d8084def6bb1bde2482e7aa636743f40c69d9b32";
sha256 = "1dpm51w3wjxil8sxqw4qxim5kmf6afmkwz1yfhldpdlqm7rfwpi3";
};
file = "sudo.plugin.zsh";
}
];
envExtra = '''';
initExtra = ''
# binds
bindkey '^K' fzf-file-widget
# options
setopt nobeep
setopt nopromptcr
setopt c_bases
setopt completeinword
setopt completealiases
setopt extendedglob
setopt notify
#
RPS1=""
#
function chpwd() {
ls;
}
eval "$(direnv hook zsh)"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
'';
};
}