restructure
- users/rin/default.nix -> users/rin.nix - users/rin/home.nix +-> users/rin.nix - users/rin/*.nix -> modules/user/*.nix - users/rin/scripts/ -> scripts/ - hosts/winter/default.nix -> hosts/winter.nix - hosts/winter/*.nix -> modules/system/*.nix - modules are dynamically imported as sets for system and user
This commit is contained in:
parent
84f08a3a1c
commit
c86be50084
30 changed files with 178 additions and 157 deletions
|
|
@ -1,16 +0,0 @@
|
|||
{ config, ... }: {
|
||||
xsession.windowManager.bspwm = {
|
||||
enable = true;
|
||||
monitors = { eDP-1 = [ "I" "II" "III" "IV" "V" "VI" "VII" "VIII" "XI" "X" ]; };
|
||||
settings = {
|
||||
window_gap = 10;
|
||||
border_width = 0;
|
||||
split_ratio = 0.5;
|
||||
top_padding = 25;
|
||||
};
|
||||
extraConfig = ''
|
||||
feh --no-fehbg --bg-fill ${config.xdg.configHome}/xorg/wallpaper.png
|
||||
systemctl --user restart polybar # home-manager loads this too early
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
users.users.rin = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "audio" "video" "wheel" ];
|
||||
shell = pkgs.zsh;
|
||||
uid = 1001;
|
||||
};
|
||||
home-manager.users.rin = import ./home.nix;
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
# TODO: i've literally never configured dunst ever since i first installed it (the rc was copypasted from somewhere i forgot im sorry), should play around with it later
|
||||
{ config, ... }: {
|
||||
services.dunst = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
monitor = 0;
|
||||
follow = "mouse";
|
||||
#geometry = "250x50-24+24";
|
||||
geometry = "600x50-24+24";
|
||||
indicate_hidden = true;
|
||||
shrink = true;
|
||||
separator_height = 0;
|
||||
padding = 16;
|
||||
horizontal_padding = 24;
|
||||
frame_width = 2;
|
||||
sort = false;
|
||||
idle_threshold = 120;
|
||||
font = "Open Sans 8";
|
||||
line_height = 4;
|
||||
markup = "full";
|
||||
format = "<b>%s</b>\\n%b";
|
||||
alignment = "left";
|
||||
show_age_threshold = 60;
|
||||
word_wrap = true;
|
||||
ignore_newline = false;
|
||||
stack_duplicates = false;
|
||||
hide_duplicate_count = true;
|
||||
show_indicators = false;
|
||||
icon_position = "left";
|
||||
max_icon_size = 32;
|
||||
sticky_history = true;
|
||||
history_length = 20;
|
||||
browser = "/run/current-system/sw/bin/firefox -new-tab";
|
||||
always_run_script = true;
|
||||
title = "Dunst";
|
||||
class = "Dunst";
|
||||
corner_radius = 5;
|
||||
};
|
||||
|
||||
shortcuts = {
|
||||
close = "ctrl+space";
|
||||
close_all = "ctrl+shift+space";
|
||||
history = "ctrl+grave";
|
||||
context = "ctrl+shift+period";
|
||||
};
|
||||
|
||||
urgency_low = {
|
||||
background = "#2f343f";
|
||||
foreground = "#d8dee8";
|
||||
timeout = 2;
|
||||
};
|
||||
|
||||
urgency_normal = {
|
||||
background = "#2f343f";
|
||||
foreground = "#d8dee8";
|
||||
timeout = 4;
|
||||
};
|
||||
|
||||
urgency_critical = {
|
||||
background = "#2f343f";
|
||||
foreground = "#d8dee8";
|
||||
frame_color = "#bf616a";
|
||||
timeout = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
{ config, enableGUI, lib, pkgs, ... }: {
|
||||
home = {
|
||||
username = "rin";
|
||||
homeDirectory = "/home/rin";
|
||||
stateVersion = "21.05";
|
||||
packages = with pkgs; [
|
||||
ffmpeg
|
||||
gnupg
|
||||
neofetch
|
||||
nodejs-16_x
|
||||
pamixer
|
||||
rnix-lsp
|
||||
transcrypt
|
||||
unrar
|
||||
wine-osu
|
||||
(winetricks.override { wine = wine-osu; })
|
||||
youtube-dl
|
||||
|
||||
nodePackages_latest.pnpm
|
||||
] ++ lib.optionals enableGUI [
|
||||
brave
|
||||
discord-canary
|
||||
element-desktop
|
||||
feh
|
||||
gnome.file-roller
|
||||
gimp
|
||||
kotatogram-desktop
|
||||
lxappearance
|
||||
maim
|
||||
pavucontrol
|
||||
tor-browser-bundle-bin
|
||||
transmission-remote-gtk
|
||||
xclip
|
||||
xorg.xgamma
|
||||
];
|
||||
|
||||
sessionVariables = {
|
||||
PATH = builtins.concatStringsSep ":" [
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
"${config.xdg.dataHome}/npm/bin"
|
||||
"$PATH"
|
||||
];
|
||||
|
||||
XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority";
|
||||
EDITOR = "nvim";
|
||||
|
||||
_JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java";
|
||||
CARGO_HOME = "${config.xdg.dataHome}/cargo";
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
GNUPGHOME = "${config.xdg.dataHome}/gnupg";
|
||||
GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
LESSHISTFILE = "-";
|
||||
NODE_REPL_HISTORY="${config.xdg.dataHome}/nodejs/repl_history";
|
||||
NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc";
|
||||
PUB_CACHE = "${config.xdg.cacheHome}/dart";
|
||||
WGETRC = "${config.xdg.configHome}/wgetrc";
|
||||
XINITRC = "${config.xdg.configHome}/xorg/xinitrc";
|
||||
|
||||
WINEPREFIX = "${config.xdg.dataHome}/wine64";
|
||||
WINEARCH = "win64";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./neovim.nix
|
||||
./npm.nix
|
||||
./zsh.nix
|
||||
] ++ lib.optionals enableGUI [
|
||||
./theming.nix
|
||||
./xdg.nix
|
||||
|
||||
./kitty.nix
|
||||
./mpv.nix
|
||||
./rofi.nix
|
||||
|
||||
./dunst.nix
|
||||
./picom.nix
|
||||
./polybar.nix
|
||||
|
||||
./xorg.nix
|
||||
./sxhkd.nix
|
||||
./bspwm.nix
|
||||
];
|
||||
|
||||
programs = {
|
||||
feh.enable = enableGUI;
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv = {
|
||||
enable = true;
|
||||
enableFlakes = true;
|
||||
};
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "LavaDesu";
|
||||
userEmail = "me@lava.moe";
|
||||
signing = {
|
||||
key = "059F098EBF0E9A13E10A46BF6500251E087653C9";
|
||||
signByDefault = true;
|
||||
};
|
||||
extraConfig = {
|
||||
core.abbrev = 11;
|
||||
};
|
||||
};
|
||||
gpg = {
|
||||
enable = true;
|
||||
homedir = "${config.xdg.dataHome}/gnupg";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
# TODO: borked
|
||||
clipmenu.enable = false;
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = if enableGUI then "gnome3" else "tty";
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".local/bin/ipc-bridge.exe".source = builtins.fetchurl {
|
||||
url = "https://github.com/0e4ef622/wine-discord-ipc-bridge/releases/download/v0.0.1/winediscordipcbridge.exe";
|
||||
sha256 = "1swn9spxpq6blm74kjmfz4ipq6a8qjzccvb2msb25pf5b1z7jnns";
|
||||
};
|
||||
home.file.".local/bin/osu" = {
|
||||
executable = true;
|
||||
source = ./scripts/osu;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
font = {
|
||||
package = pkgs.cascadia-code;
|
||||
name = "Cascadia Code PL";
|
||||
size = 13;
|
||||
};
|
||||
settings = {
|
||||
font_features = "-ss01 +ss19";
|
||||
enable_audio_bell = false;
|
||||
};
|
||||
extraConfig = builtins.readFile (builtins.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/folke/tokyonight.nvim/main/extras/kitty_tokyonight_night.conf";
|
||||
sha256 = "0mgjkmn4grr7rrxc5rrs1n0cghf03gp0v55hf3phll6czjavjldf";
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
package = pkgs.wrapMpv pkgs.mpv-unwrapped {
|
||||
youtubeSupport = true;
|
||||
scripts = [ pkgs.mpvScripts.mpris ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
package = pkgs.neovim-nightly;
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
coc-nvim
|
||||
coc-eslint
|
||||
coc-json
|
||||
coc-rust-analyzer
|
||||
coc-tsserver
|
||||
|
||||
ctrlp-vim
|
||||
lualine-nvim
|
||||
nerdtree
|
||||
tokyonight-nvim
|
||||
vim-nix
|
||||
vim-repeat
|
||||
vim-surround
|
||||
|
||||
(nvim-treesitter.withPlugins (p: with p; [
|
||||
tree-sitter-javascript
|
||||
tree-sitter-nix
|
||||
tree-sitter-rust
|
||||
tree-sitter-toml
|
||||
tree-sitter-typescript
|
||||
tree-sitter-yaml
|
||||
]))
|
||||
];
|
||||
withNodeJs = true;
|
||||
|
||||
extraConfig = ''
|
||||
" configuration
|
||||
syntax enable
|
||||
set relativenumber number
|
||||
set cursorline
|
||||
set noswapfile
|
||||
set hlsearch
|
||||
set ignorecase
|
||||
set incsearch
|
||||
set title
|
||||
set clipboard^=unnamed
|
||||
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
|
||||
set expandtab
|
||||
let g:yaml_recommended_style=0
|
||||
|
||||
" theming
|
||||
let g:tokyonight_style='night'
|
||||
colorscheme tokyonight
|
||||
|
||||
" using tab for trigger completion
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
endfunction
|
||||
|
||||
inoremap <silent><expr> <Tab>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<Tab>" :
|
||||
\ coc#refresh()
|
||||
|
||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
|
||||
" various aliases
|
||||
nnoremap <c-h> :NERDTreeToggle
|
||||
nnoremap <leader>rs :source $MYVIMRC<CR>
|
||||
nmap <leader>rn <Plug>(coc-rename)
|
||||
command! -nargs=0 Sw w !doas tee % > /dev/null
|
||||
|
||||
" disable read-only warning
|
||||
au BufEnter * set noro
|
||||
|
||||
" disable empty line tildes
|
||||
set fcs=eob:\
|
||||
|
||||
lua <<EOF
|
||||
require('nvim-treesitter.configs').setup {
|
||||
highlight = { enable = true }
|
||||
}
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'tokyonight'
|
||||
}
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON {
|
||||
languageserver = {
|
||||
nix = {
|
||||
command = "rnix-lsp";
|
||||
filetypes = [ "nix" ];
|
||||
};
|
||||
};
|
||||
"eslint.enable" = true;
|
||||
"eslint.options" = {
|
||||
configFile = "./.eslintrc.json";
|
||||
};
|
||||
"rust-analyzer.lens.enable" = false;
|
||||
"rust-analyzer.inlayHints.enable" = false;
|
||||
"rust-analyzer.serverPath" = pkgs.rust-analyzer + "/bin/rust-analyzer";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
xdg.configFile."npm/npmrc".text = ''
|
||||
cache=${config.xdg.dataHome}/npm/cache
|
||||
prefix=${config.xdg.dataHome}/npm
|
||||
store-dir=${config.xdg.dataHome}/npm/pnpm-store
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
{ config, ... }: {
|
||||
services.picom = {
|
||||
enable = true;
|
||||
experimentalBackends = true;
|
||||
|
||||
blur = true;
|
||||
blurExclude = [
|
||||
(builtins.concatStringsSep " && " [
|
||||
"class_g != 'Alacritty'"
|
||||
"class_g != 'kitty'"
|
||||
#"class_g != 'Polybar'"
|
||||
"class_g != 'URxvt'"
|
||||
])
|
||||
];
|
||||
fade = true;
|
||||
fadeDelta = 5;
|
||||
fadeSteps = [ "0.05" "0.05" ];
|
||||
|
||||
opacityRule = [
|
||||
"80:class_g = 'Alacritty' && !focused"
|
||||
"95:class_g = 'kitty' && !focused"
|
||||
];
|
||||
vSync = true;
|
||||
|
||||
extraOptions = ''
|
||||
glx-no-stencil = true;
|
||||
glx-copy-from-front = false;
|
||||
glx-no-rebind-pixmap = true;
|
||||
use-damage = true;
|
||||
|
||||
blur-method = "dual_kawase";
|
||||
blur-strength = 15;
|
||||
|
||||
detect-transient = true;
|
||||
detect-client-leader = true;
|
||||
detect-client-opacity = true;
|
||||
detect-rounded-corners = true;
|
||||
use-ewmh-active-win = true;
|
||||
mark-wmwin-focused = true;
|
||||
mark-ovredir-focused = true;
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
{ config, ... }: {
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
script = builtins.readFile ./scripts/polybar.sh;
|
||||
settings = {
|
||||
"bar/top" = {
|
||||
monitor = "eDP-1";
|
||||
width = "100%";
|
||||
height = 35;
|
||||
#background = "#64506c";
|
||||
background = "#00000000";
|
||||
foreground = "#fff";
|
||||
|
||||
spacing = 2;
|
||||
padding = {
|
||||
left = 5;
|
||||
right = 5;
|
||||
bottom = 5;
|
||||
};
|
||||
override-redirect = true;
|
||||
wm-restack = "bspwm";
|
||||
|
||||
font = [
|
||||
"NotoSans:style=SemiBold:size=11:antialias=true;2"
|
||||
"NotoSans:size=11:antialias=true;2"
|
||||
"MaterialIcons:size=17:antialias=true;6"
|
||||
|
||||
"HanaMinA:size=9.8;1"
|
||||
"HanaMinB:size=9.8;1"
|
||||
];
|
||||
|
||||
modules = {
|
||||
left = "workspaces";
|
||||
center = "title";
|
||||
right = "datetime";
|
||||
};
|
||||
|
||||
enable-ipc = true;
|
||||
scroll = {
|
||||
up = "#workspaces.prev";
|
||||
down = "#workspaces.next";
|
||||
};
|
||||
};
|
||||
|
||||
"module/workspaces" = {
|
||||
type = "internal/bspwm";
|
||||
|
||||
pin-workspaces = true;
|
||||
enable-click = true;
|
||||
enable-scroll = false;
|
||||
reverse-scroll = false;
|
||||
|
||||
#ws-icon.default = "%{T3}"; # ef4a
|
||||
label = {
|
||||
monitor = "";
|
||||
focused = "%{T3}"; # ef4a
|
||||
occupied = {
|
||||
text = "%{T3}"; # e837
|
||||
foreground = "#80FFFFFF";
|
||||
};
|
||||
empty = {
|
||||
text = "%{T3}"; # ef4a
|
||||
foreground = "#80FFFFFF";
|
||||
};
|
||||
urgent = {
|
||||
text = "%{T3}"; # e837
|
||||
foreground = "#EE1012";
|
||||
};
|
||||
|
||||
separator = {
|
||||
text = " ";
|
||||
padding = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"module/title" = {
|
||||
type = "internal/xwindow";
|
||||
format = {
|
||||
text = "%{T1}<label>";
|
||||
padding = 4;
|
||||
};
|
||||
};
|
||||
|
||||
"module/datetime" = {
|
||||
type = "internal/date";
|
||||
date = {
|
||||
text = "%{T1}%%{F#fff}%H:%M%%{F-}";
|
||||
alt = "%{T2}%%{F#ccc}%A, %d %B %Y %{T1}%%{F#fff}%H:%M%%{F#666}:%{T2}%%{F#ccc}%S%%{F-}";
|
||||
};
|
||||
format = {
|
||||
padding = 4;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, ... }: {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
font = "Open Sans 10";
|
||||
scrollbar = false;
|
||||
terminal = "kitty";
|
||||
#theme = builtins.fetchUrl {};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd ~/Games/osu
|
||||
|
||||
export DRI_PRIME=1
|
||||
export vblank_mode=0
|
||||
export STAGING_AUDIO_DURATION=400000
|
||||
|
||||
wine ~/.local/bin/ipc-bridge.exe &
|
||||
wine osu\!.exe
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
polybar top >>/tmp/bar-top.log 2>&1 &
|
||||
polybar bottom >>/tmp/bar-bottom.log 2>&1 &
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
|
||||
eval $(dbus-launch --exit-with-session --sh-syntax)
|
||||
fi
|
||||
systemctl --user import-environment DISPLAY XAUTHORITY
|
||||
|
||||
if command -v dbus-update-activation-environment > /dev/null 2>&1; then
|
||||
dbus-update-activation-environment DISPLAY XAUTHORITY
|
||||
fi
|
||||
|
||||
xrdb ${XDG_CONFIG_HOME}/xorg/xresources
|
||||
exec ${XDG_CONFIG_HOME}/xorg/xsession
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
super = "Mod4";
|
||||
alt = "Mod1";
|
||||
in {
|
||||
services.sxhkd = {
|
||||
enable = true;
|
||||
keybindings = {
|
||||
# Rofi (App launcher)
|
||||
"super + Return" = "rofi -lines 12 -padding 18 -width 60 -location 0 -show drun -sidebar-mode -columns 3 -font 'Noto Sans 8'";
|
||||
|
||||
# Printscreen
|
||||
"Print" = "maim -us | tee ~/Pictures/Screenshots/$(date +%s)c.png | xclip -selection clipboard -t image/png";
|
||||
"shift + Print" = "maim -u | tee ~/Pictures/Screenshots/$(date +%s).png | xclip -selection clipboard -t image/png";
|
||||
|
||||
# Quick-kill picom
|
||||
"super + p" = "systemctl --user stop picom";
|
||||
"super + shift + p" = "systemctl --user restart picom";
|
||||
|
||||
# Volume
|
||||
"XF86Audio{RaiseVolume,LowerVolume,Mute}" = "pamixer -{i 5,d 5,t}";
|
||||
|
||||
# Brightness
|
||||
"XF86MonBrightness{Up,Down}" = "light -{A,U} 10";
|
||||
"shift + XF86MonBrightness{Up,Down}" = "light -{A,U} 1";
|
||||
|
||||
# Gamma
|
||||
"ctrl + XF86MonBrightness{Up,Down}" = "xgamma -gamma {1.3,1}";
|
||||
|
||||
# Kill focused window
|
||||
"super + {_,shift + }c" = "bspc node -{c,k}";
|
||||
|
||||
# Change focus
|
||||
"super + {h,j,k,l}" = "bspc node -f {west,south,north,east}";
|
||||
"super + {Left,Down,Up,Right}" = "bspc node -f {west,south,north,east}";
|
||||
|
||||
# Switch windows
|
||||
"super + shift + {h,j,k,l}" = "bspc node -s {west,south,north,east}";
|
||||
"super + shift + {Left,Down,Up,Right}" = "bspc node -s {west,south,north,east}";
|
||||
|
||||
# Move focused window
|
||||
"super + shift + {1-9,0}" = "bspc node -d ^{1-9,10}";
|
||||
|
||||
# Toggle tiled/fullscreen/floating
|
||||
"super + {t,f,space}" = "bspc node -t '~{tiled,fullscreen,floating}'";
|
||||
|
||||
# Exit / Restart bspwm
|
||||
"super + shift + {q,r}" = "bspc {quit,wm -r}";
|
||||
|
||||
# Restart sxhkd
|
||||
"super + shift + s" = "pkill -USR1 -x sxhkd";
|
||||
|
||||
# Workspace switching
|
||||
"super + {1-9,0}" = "bspc desktop -f ^{1-9,10}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
gtk = {
|
||||
enable = true;
|
||||
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
font = {
|
||||
package = pkgs.open-sans;
|
||||
name = "Open Sans";
|
||||
size = 11;
|
||||
};
|
||||
iconTheme = {
|
||||
package = pkgs.yaru-theme;
|
||||
name = "Yaru";
|
||||
};
|
||||
theme = {
|
||||
name = "Materia-dark";
|
||||
package = pkgs.materia-theme;
|
||||
};
|
||||
};
|
||||
|
||||
xsession.pointerCursor = {
|
||||
package = pkgs.yaru-theme;
|
||||
name = "Yaru";
|
||||
size = 16;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
genMimes = mimeTypes: builtins.listToAttrs (builtins.map (mimeType: {
|
||||
name = mimeType;
|
||||
value = "brave-browser.desktop";
|
||||
}) mimeTypes);
|
||||
|
||||
mimes = genMimes [
|
||||
"x-scheme-handler/http"
|
||||
"x-scheme-handler/https"
|
||||
"x-scheme-handler/chrome"
|
||||
"text/html"
|
||||
"application/x-extension-htm"
|
||||
"application/x-extension-html"
|
||||
"application/x-extension-shtml"
|
||||
"application/xhtml+xml"
|
||||
"application/x-extension-xhtml"
|
||||
"application/x-extension-xht"
|
||||
] // {
|
||||
"x-scheme-handler/tg" = "userapp-Kotatogram Desktop-CHJI40.desktop";
|
||||
"image/png" = "feh.desktop";
|
||||
"image/jpeg" = "feh.desktop";
|
||||
};
|
||||
in {
|
||||
xdg = {
|
||||
enable = true;
|
||||
mime.enable = true;
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
|
||||
associations.added = mimes;
|
||||
defaultApplications = mimes;
|
||||
};
|
||||
};
|
||||
|
||||
# XXX: might need to be moved
|
||||
xdg.configFile."wgetrc".text = ''
|
||||
hsts-file = ${config.xdg.cacheHome}/wget-hsts
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
{ config, ... }: {
|
||||
|
||||
xsession = {
|
||||
enable = true;
|
||||
profilePath = ".config/xorg/xprofile";
|
||||
scriptPath = ".config/xorg/xsession";
|
||||
};
|
||||
|
||||
xdg.configFile."xorg/xinitrc".source = ./scripts/xinitrc;
|
||||
xdg.configFile."xorg/wallpaper.png".source = ../../res/wallpaper.png;
|
||||
xresources = {
|
||||
path = "${config.xdg.configHome}/xorg/xresources";
|
||||
properties = {
|
||||
# special
|
||||
"*.foreground" = "#c5c8c6";
|
||||
"*.background" = "#1d1f21";
|
||||
"*.cursorColor" = "#c5c8c6";
|
||||
|
||||
# black
|
||||
"*.color0" = "#1d1f21";
|
||||
"*.color8" = "#969896";
|
||||
|
||||
# red
|
||||
"*.color1" = "#cc342b";
|
||||
"*.color9" = "#cc342b";
|
||||
|
||||
# green
|
||||
"*.color2" = "#198844";
|
||||
"*.color10" = "#198844";
|
||||
|
||||
# yellow
|
||||
"*.color3" = "#fba922";
|
||||
"*.color11" = "#fba922";
|
||||
|
||||
# blue
|
||||
"*.color4" = "#3971ed";
|
||||
"*.color12" = "#3971ed";
|
||||
|
||||
# magenta
|
||||
"*.color5" = "#a36ac7";
|
||||
"*.color13" = "#a36ac7";
|
||||
|
||||
# cyan
|
||||
"*.color6" = "#3971ed";
|
||||
"*.color14" = "#3971ed";
|
||||
|
||||
# white
|
||||
"*.color7" = "#c5c8c6";
|
||||
"*.color15" = "#ffffff";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
# vim: ft=nix
|
||||
{ config, inputs, pkgs, ... }:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
|
||||
pluginFromInput = name: {
|
||||
inherit name;
|
||||
src = inputs.${name};
|
||||
};
|
||||
|
||||
abbrs = {
|
||||
e = "$EDITOR";
|
||||
rs = "source ~/.config/zsh/.zshrc";
|
||||
|
||||
ll = "ls -al";
|
||||
q = "exit";
|
||||
|
||||
peach = "ssh lava@peach";
|
||||
bunny = "ssh bunny@peach";
|
||||
|
||||
fa = "grep -Inr";
|
||||
fai = "grep -Iinr";
|
||||
|
||||
g1 = "xgamma -gamma 1";
|
||||
g3 = "xgamma -gamma 1.3";
|
||||
|
||||
bat = "echo 'battery' | doas tee /sys/class/drm/card1/device/power_dpm_state";
|
||||
bal = "echo 'balanced' | doas tee /sys/class/drm/card1/device/power_dpm_state";
|
||||
sclk = "doas setclock 50000 70000 800";
|
||||
|
||||
sysu = "doas systemctl restart";
|
||||
sysd = "doas systemctl stop";
|
||||
syss = "doas systemctl status";
|
||||
usysu = "systemctl --user restart";
|
||||
usysd = "systemctl --user stop";
|
||||
usyss = "systemctl --user status";
|
||||
j = "doas journalctl -b";
|
||||
jf = "doas journalctl -f";
|
||||
|
||||
fl = "cd ~/Projects/flakes";
|
||||
nr = "doas nixos-rebuild switch --flake .#winter -v";
|
||||
|
||||
gs = "git status";
|
||||
ga = "git add";
|
||||
gaa = "git add .";
|
||||
gc = "git commit";
|
||||
gac = "git add .; git commit";
|
||||
gcm = "git commit -m";
|
||||
gco = "git checkout";
|
||||
gd = "git diff";
|
||||
gds = "git diff --staged";
|
||||
gf = "git commit --amend --no-edit";
|
||||
gl = "git log";
|
||||
gr = "git rebase -i";
|
||||
};
|
||||
|
||||
genAbbrs = lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "abbr add -S --quiet ${k}=${lib.escapeShellArg v}") abbrs);
|
||||
cursorShape = ''
|
||||
function zle-keymap-select {
|
||||
if [[ $KEYMAP == vicmd ]] ||
|
||||
[[ $1 = 'block' ]]; then
|
||||
echo -ne '\e[1 q'
|
||||
elif [[ $KEYMAP == main ]] ||
|
||||
[[ $KEYMAP == viins ]] ||
|
||||
[[ $KEYMAP = "" ]] ||
|
||||
[[ $1 = 'beam' ]]; then
|
||||
echo -ne '\e[5 q'
|
||||
fi
|
||||
}
|
||||
zle -N zle-keymap-select
|
||||
zle-line-init() {
|
||||
zle -K viins
|
||||
echo -ne "\e[5 q"
|
||||
}
|
||||
zle -N zle-line-init
|
||||
echo -ne '\e[5 q'
|
||||
preexec() { echo -ne '\e[5 q' ;}
|
||||
'';
|
||||
direnv = ''
|
||||
eval "$(direnv hook zsh)"
|
||||
'';
|
||||
pure = ''
|
||||
autoload -U promptinit; promptinit
|
||||
prompt pure
|
||||
'';
|
||||
viExtraNav = ''
|
||||
bindkey -M menuselect 'h' vi-backward-char
|
||||
bindkey -M menuselect 'k' vi-up-line-or-history
|
||||
bindkey -M menuselect 'l' vi-forward-char
|
||||
bindkey -M menuselect 'j' vi-down-line-or-history
|
||||
|
||||
bindkey -v '^?' backward-delete-char
|
||||
bindkey -v '^R' history-incremental-pattern-search-backward
|
||||
bindkey '^[[A' history-substring-search-up
|
||||
bindkey '^[[B' history-substring-search-down
|
||||
bindkey -M vicmd 'k' history-substring-search-up
|
||||
bindkey -M vicmd 'j' history-substring-search-down
|
||||
'';
|
||||
in {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
|
||||
enableAutosuggestions = true;
|
||||
autocd = true;
|
||||
defaultKeymap = "viins";
|
||||
|
||||
history = {
|
||||
extended = true;
|
||||
path = "${config.xdg.dataHome}/zsh/history";
|
||||
save = 10000000;
|
||||
size = 10000000;
|
||||
};
|
||||
|
||||
enableCompletion = true;
|
||||
initExtraBeforeCompInit = ''
|
||||
fpath+=(/run/current-system/sw/share/zsh/site-functions)
|
||||
zstyle ':completion:*' completer _complete
|
||||
zstyle ':completion:*' matcher-list "" 'm:{[:lower:][:upper:]-_}={[:upper:][:lower:]_-}' '+l:|=* r:|=*'
|
||||
zstyle ':completion:*' menu select
|
||||
_comp_options+=(globdots)
|
||||
zmodload zsh/complist
|
||||
'';
|
||||
|
||||
localVariables = {
|
||||
KEYTIMEOUT = "1";
|
||||
#PS1 = "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b ";
|
||||
ZSH_AUTOSUGGEST_STRATEGY = ["completion"];
|
||||
ZSH_AUTOSUGGEST_USE_ASYNC = true;
|
||||
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE = 40;
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
ls = "ls --color=auto --group-directories-first -v";
|
||||
diff = "diff -Naur --color=auto";
|
||||
};
|
||||
initExtraFirst = ''
|
||||
autoload -U colors && colors
|
||||
'';
|
||||
initExtra = lib.concatStringsSep "\n" [
|
||||
pure
|
||||
cursorShape
|
||||
direnv
|
||||
genAbbrs
|
||||
viExtraNav
|
||||
];
|
||||
|
||||
plugins = builtins.map (e: pluginFromInput e) [
|
||||
"zsh-abbr"
|
||||
"zsh-history-substring-search"
|
||||
"fast-syntax-highlighting"
|
||||
"pure"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue