Up
This commit is contained in:
parent
fc06455cbf
commit
720c6a3dbb
3
home/homepage/default.nix
Normal file
3
home/homepage/default.nix
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, ... }: {
|
{ pkgs, config, ... }: {
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
xdg-desktop-portal-hyprland
|
xdg-desktop-portal-hyprland
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
"$mod" = "SUPER";
|
"$mod" = "SUPER";
|
||||||
"$menu" = "~/scripts/menu.sh";
|
"$menu" = "menu";
|
||||||
"$powermenu" = "${pkgs.wlogout}/bin/wlogout";
|
"$powermenu" = "${pkgs.wlogout}/bin/wlogout";
|
||||||
|
|
||||||
exec-once = [
|
exec-once = [
|
||||||
|
@ -1,24 +1,11 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
# TODO:
|
imports = [ ./scripts.nix ./sshconfig.nix ];
|
||||||
# choose output sound
|
|
||||||
# choose wallpaper
|
# TODO:
|
||||||
# import wireguard config
|
# custom colors on all config files
|
||||||
# powermenu
|
# auto update
|
||||||
# menu
|
# auto remove old
|
||||||
# custom colors on all config files
|
# script to edit, rebuild, push
|
||||||
# vim format on save
|
|
||||||
|
|
||||||
home.file = {
|
|
||||||
".ssh/config" = {
|
|
||||||
text = ''
|
|
||||||
Host github.com
|
|
||||||
User git
|
|
||||||
Hostname github.com
|
|
||||||
PreferredAuthentications publickey
|
|
||||||
IdentityFile ~/.ssh/github
|
|
||||||
'';
|
|
||||||
executable = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
87
home/misc/scripts.nix
Normal file
87
home/misc/scripts.nix
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
{ pkgs, config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
homedir = config.home.homeDirectory;
|
||||||
|
|
||||||
|
wallpaper = pkgs.writeShellScriptBin "wallpaper" ''
|
||||||
|
WALLPAPER_FOLDER="${homedir}/Nextcloud/wallpaper"
|
||||||
|
|
||||||
|
cd $WALLPAPER_FOLDER
|
||||||
|
|
||||||
|
choosed_wallpaper=$(fd . |
|
||||||
|
fzf \
|
||||||
|
--preview='kitty icat --clear --transfer-mode=memory --stdin=no --place=''${FZF_PREVIEW_COLUMNS}x''${FZF_PREVIEW_LINES}@0x0 {}' \
|
||||||
|
--preview-window=bottom,border-top \
|
||||||
|
--margin=1 \
|
||||||
|
--layout=reverse \
|
||||||
|
--border --border-label "Wallpaper" \
|
||||||
|
--info="hidden" \
|
||||||
|
--header="" \
|
||||||
|
--prompt='/ ' \
|
||||||
|
--color="dark,fg+:white,bg+:-1,fg:white,bg:-1"\
|
||||||
|
--color='prompt:grey,pointer:magenta,fg+:regular') || exit 1
|
||||||
|
|
||||||
|
swww img $choosed_wallpaper
|
||||||
|
'';
|
||||||
|
|
||||||
|
menu = pkgs.writeShellScriptBin "menu" ''
|
||||||
|
if pgrep wofi; then
|
||||||
|
pkill wofi
|
||||||
|
else
|
||||||
|
wofi --show drun
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
wireguard-import = pkgs.writeShellScriptBin "wireguard-import" ''
|
||||||
|
nmcli connection import type wireguard file "$0"
|
||||||
|
'';
|
||||||
|
|
||||||
|
choose-output = pkgs.writeShellScriptBin "choose-output" ''
|
||||||
|
function parse_sinks(){
|
||||||
|
output=$(wpctl status)
|
||||||
|
sinks=($(echo "$output" | sed 's/ │ //' | awk '/Sinks:/ {flag=1; next} /^$/ {flag=0} flag' | sed 's/ /-/g'))
|
||||||
|
|
||||||
|
for sink in "''${sinks[@]}"; do
|
||||||
|
|
||||||
|
id=""
|
||||||
|
default=false
|
||||||
|
sink=$(echo "$sink" | sed 's/-/ /g')
|
||||||
|
sink_name=$(echo "$sink" | sed 's/\[vol:.*$//')
|
||||||
|
|
||||||
|
if [[ $sink_name == "*"* ]]; then
|
||||||
|
sink_name=$(echo "$sink_name" | sed 's/*//')
|
||||||
|
default=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
id=$(echo "$sink_name" | cut -d'.' -f1)
|
||||||
|
sink_name=$(echo "$sink_name" | sed 's/^[ ]*//;s/[ ]*$//' )
|
||||||
|
sink_name=$(echo "$sink_name" | cut -d'.' -f2 )
|
||||||
|
|
||||||
|
if [[ $default == true ]];then
|
||||||
|
printf "*%s (%d)" "$sink_name" "$id"
|
||||||
|
else
|
||||||
|
printf " %s (%d)" "$sink_name" "$id"
|
||||||
|
fi
|
||||||
|
printf "\n"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
choosed_sink=$(echo "$(parse_sinks)" | fzf \
|
||||||
|
--margin=1 \
|
||||||
|
--layout=reverse \
|
||||||
|
--border --border-label "Wallpaper" \
|
||||||
|
--info="hidden" \
|
||||||
|
--header="" \
|
||||||
|
--prompt='/ ' \
|
||||||
|
--color="dark,fg+:white,bg+:-1,fg:white,bg:-1"\
|
||||||
|
--color='prompt:grey,pointer:magenta,fg+:regular') || exit 1
|
||||||
|
|
||||||
|
choosed_sink_id=$(echo "$choosed_sink" | sed 's/.*(\(.*\))/\1/')
|
||||||
|
|
||||||
|
wpctl set-default $choosed_sink_id
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
|
home.packages = with pkgs; [ wallpaper menu wireguard-import choose-output ];
|
||||||
|
}
|
14
home/misc/sshconfig.nix
Normal file
14
home/misc/sshconfig.nix
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
home.file = {
|
||||||
|
".ssh/config" = {
|
||||||
|
text = ''
|
||||||
|
Host github.com
|
||||||
|
User git
|
||||||
|
Hostname github.com
|
||||||
|
PreferredAuthentications publickey
|
||||||
|
IdentityFile ~/.ssh/github
|
||||||
|
'';
|
||||||
|
executable = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -79,8 +79,8 @@
|
|||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
winhighlight =
|
winhighlight =
|
||||||
"FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
"FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel";
|
||||||
scrollbar = false;
|
scrollbar = true;
|
||||||
sidePadding = 0;
|
sidePadding = 0;
|
||||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
||||||
};
|
};
|
||||||
@ -88,7 +88,7 @@
|
|||||||
documentation = {
|
documentation = {
|
||||||
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ];
|
||||||
winhighlight =
|
winhighlight =
|
||||||
"FloatBorder:CmpBorder,Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel";
|
"FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,27 +20,22 @@
|
|||||||
|
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
|
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
colorschemes.catppuccin.enable = true;
|
colorschemes.catppuccin.enable = true;
|
||||||
|
|
||||||
keymaps = [
|
keymaps = [
|
||||||
# Global Mappings
|
|
||||||
# Default mode is "" which means normal-visual-op
|
|
||||||
{
|
{
|
||||||
# Toggle NvimTree
|
|
||||||
key = "<leader>e";
|
key = "<leader>e";
|
||||||
action = "<CMD>Neotree toggle<CR>";
|
action = "<CMD>Neotree toggle<CR>";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
# Format file
|
|
||||||
key = "<space>fm";
|
key = "<space>fm";
|
||||||
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
action = "<CMD>lua vim.lsp.buf.format()<CR>";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Terminal Mappings
|
# Terminal Mappings
|
||||||
{
|
{
|
||||||
# Escape terminal mode using ESC
|
|
||||||
mode = "t";
|
mode = "t";
|
||||||
key = "<esc>";
|
key = "<esc>";
|
||||||
action = "<C-\\><C-n>";
|
action = "<C-\\><C-n>";
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
clangd.enable = true;
|
clangd.enable = true;
|
||||||
gopls.enable = true;
|
gopls.enable = true;
|
||||||
nixd.enable = true;
|
nixd.enable = true;
|
||||||
|
tailwindcss.enable = true;
|
||||||
};
|
};
|
||||||
keymaps.lspBuf = {
|
keymaps.lspBuf = {
|
||||||
"gd" = "definition";
|
"gd" = "definition";
|
||||||
|
@ -2,24 +2,35 @@
|
|||||||
|
|
||||||
programs.nixvim.globals.mapleader = " ";
|
programs.nixvim.globals.mapleader = " ";
|
||||||
programs.nixvim.options = {
|
programs.nixvim.options = {
|
||||||
updatetime = 100; # Faster completion
|
updatetime = 50; # Faster completion
|
||||||
|
|
||||||
number = true;
|
number = true;
|
||||||
relativenumber = true;
|
relativenumber = true;
|
||||||
|
|
||||||
autoindent = true;
|
autoindent = true;
|
||||||
clipboard = "unnamedplus";
|
clipboard = "unnamed,unnamedplus";
|
||||||
|
|
||||||
expandtab = true;
|
expandtab = true;
|
||||||
|
tabstop = 2;
|
||||||
|
softtabstop = 2;
|
||||||
shiftwidth = 2;
|
shiftwidth = 2;
|
||||||
smartindent = true;
|
smartindent = true;
|
||||||
tabstop = 2;
|
breakindent = true;
|
||||||
|
|
||||||
ignorecase = true;
|
ignorecase = true;
|
||||||
incsearch = true;
|
incsearch = true;
|
||||||
|
hlsearch = true;
|
||||||
smartcase = true;
|
smartcase = true;
|
||||||
wildmode = "list:longest";
|
wildmode = "list:longest";
|
||||||
|
completeopt = [ "menuone" "noselect" ];
|
||||||
|
signcolumn = "yes";
|
||||||
|
cursorline = true;
|
||||||
|
scrolloff = 8;
|
||||||
|
mouse = "a";
|
||||||
|
|
||||||
|
wrap = false;
|
||||||
|
|
||||||
swapfile = false;
|
swapfile = false;
|
||||||
undofile = true; # Build-in persistent undo
|
undofile = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user