Compare commits
34 Commits
a059882831
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cd55626328 | |||
| 0f8167282e | |||
| 234e29f367 | |||
| 13ee868d5d | |||
| d9d6418d6a | |||
| a39f1f7967 | |||
| 4637065e94 | |||
| 86bf2150a7 | |||
| dd6f9a89cb | |||
| bad97a55bd | |||
| da68e328a3 | |||
| 378cb564d2 | |||
| 095efdd402 | |||
| 3df2335241 | |||
| be64579c34 | |||
| c8c3936fa0 | |||
| 740a76f6ce | |||
| fb8f6dff03 | |||
| 4064fc4ace | |||
| 6193436c31 | |||
| 1e510a68c8 | |||
| 2c2f817459 | |||
| 3ee0c62a2e | |||
| bf7ba01119 | |||
| d131586705 | |||
| b0230b0f36 | |||
| 44e8ada47b | |||
| dc52bd8277 | |||
| 23120f379e | |||
| 48027eb89b | |||
| c2b6197b82 | |||
| 7c63deb8e5 | |||
| 4de1c6f3ed | |||
| 4d9906b59c |
74
flake.nix
74
flake.nix
@@ -24,28 +24,73 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosModules = {
|
nixosModules = {
|
||||||
vim = modules/vim.nix;
|
editor = modules/editor.nix;
|
||||||
zsh = modules/zsh.nix;
|
|
||||||
git = modules/git.nix;
|
git = modules/git.nix;
|
||||||
udiskie = modules/udiskie.nix;
|
udiskie = modules/udiskie.nix;
|
||||||
niri = modules/niri;
|
desktop = modules/desktop.nix;
|
||||||
|
nix = modules/nix.nix;
|
||||||
|
shell = modules/shell;
|
||||||
};
|
};
|
||||||
|
|
||||||
overlays.default = final: prev: {
|
overlays.default = final: prev: {
|
||||||
vim-kmein = prev.callPackage packages/vim { };
|
niphas-terminal = prev.alacritty;
|
||||||
ashell-kmein = import packages/ashell.nix {
|
niphas-web-browser = prev.firefox;
|
||||||
|
niphas-file-browser = prev.pcmanfm;
|
||||||
|
niphas-runner = prev.writers.writeDashBin "niphas-runner" "${prev.lib.getExe prev.rofi} -show run";
|
||||||
|
niphas-locker = prev.swaylock;
|
||||||
|
niphas-screenshot = prev.writers.writeDashBin "niphas-screenshot" ''
|
||||||
|
${prev.lib.getExe prev.grim} -g "$(${prev.lib.getExe prev.slurp})" - | ${prev.lib.getExe prev.satty} -f -
|
||||||
|
'';
|
||||||
|
|
||||||
|
niphas-editor = prev.lib.makeOverridable (prev.callPackage packages/vim) { };
|
||||||
|
niphas-bar = import packages/ashell.nix {
|
||||||
inherit (inputs) wrappers;
|
inherit (inputs) wrappers;
|
||||||
pkgs = prev;
|
pkgs = prev;
|
||||||
};
|
};
|
||||||
git-kmein = import packages/git.nix {
|
niphas-git = import packages/git.nix {
|
||||||
inherit (inputs) wrappers;
|
inherit (inputs) wrappers;
|
||||||
pkgs = prev;
|
pkgs = prev;
|
||||||
};
|
};
|
||||||
niri-kmein = import packages/niri {
|
niphas-niri = import packages/niri.nix {
|
||||||
inherit (inputs) wrappers;
|
inherit (inputs) wrappers;
|
||||||
pkgs = final;
|
pkgs = final;
|
||||||
lib = inputs.nixpkgs.lib;
|
|
||||||
};
|
};
|
||||||
|
niphas-wallpaper =
|
||||||
|
prev.runCommand "niphas-wallpaper.png"
|
||||||
|
{
|
||||||
|
buildInputs = [ prev.imagemagick ];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
# solid white
|
||||||
|
convert -size 1920x1080 xc:white $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
niphas-set-wallpaper = prev.writers.writeDashBin "niphas-set-wallpaper" ''
|
||||||
|
exec ${lib.getExe prev.swaybg} --mode fill --image ${toString final.niphas-wallpaper}
|
||||||
|
'';
|
||||||
|
|
||||||
|
niphas-clipboard-watcher = prev.writers.writeDashBin "niphas-clipboard-watcher" ''
|
||||||
|
exec ${lib.getExe' prev.wl-clipboard "wl-paste"} -t text --watch ${lib.getExe prev.clipman} store
|
||||||
|
'';
|
||||||
|
|
||||||
|
niphas-clipman = prev.writers.writeDashBin "niphas-clipman" ''
|
||||||
|
exec ${lib.getExe prev.clipman} pick --tool rofi
|
||||||
|
'';
|
||||||
|
|
||||||
|
niphas-redshift =
|
||||||
|
let
|
||||||
|
geolocation = [
|
||||||
|
52.5244
|
||||||
|
13.4105
|
||||||
|
];
|
||||||
|
latitude = builtins.elemAt geolocation 0;
|
||||||
|
longitude = builtins.elemAt geolocation 1;
|
||||||
|
in
|
||||||
|
prev.writers.writeDashBin "niphas-redshift" ''
|
||||||
|
exec ${lib.getExe prev.wlsunset} -l ${toString latitude} -L ${toString longitude}
|
||||||
|
'';
|
||||||
|
|
||||||
|
vimv = prev.callPackage packages/vimv.nix { };
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = eachSupportedSystem (
|
packages = eachSupportedSystem (
|
||||||
@@ -57,7 +102,18 @@
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit (pkgs) vim-kmein git-kmein niri-kmein;
|
inherit (pkgs)
|
||||||
|
niphas-bar
|
||||||
|
niphas-git
|
||||||
|
niphas-niri
|
||||||
|
niphas-editor
|
||||||
|
niphas-wallpaper
|
||||||
|
niphas-set-wallpaper
|
||||||
|
niphas-clipboard-watcher
|
||||||
|
niphas-clipman
|
||||||
|
niphas-redshift
|
||||||
|
vimv
|
||||||
|
;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
52
modules/desktop.nix
Normal file
52
modules/desktop.nix
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
environment.variables.TERMINAL = lib.getExe pkgs.alacritty;
|
||||||
|
|
||||||
|
programs.ydotool.enable = true;
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
extraPortals = [
|
||||||
|
pkgs.xdg-desktop-portal-gnome
|
||||||
|
];
|
||||||
|
config.common.default = "*";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.dbus = {
|
||||||
|
# implementation = "broker";
|
||||||
|
# packages = [ pkgs.gcr ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# the status bar needs upower to show battery status
|
||||||
|
services.upower.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.dragon-drop
|
||||||
|
pkgs.wmctrl
|
||||||
|
pkgs.wl-clipboard
|
||||||
|
pkgs.libnotify
|
||||||
|
pkgs.wdisplays
|
||||||
|
pkgs.nsxiv
|
||||||
|
pkgs.xdg-desktop-portal
|
||||||
|
pkgs.clipman
|
||||||
|
pkgs.xdg-desktop-portal-gnome
|
||||||
|
|
||||||
|
pkgs.rofi # to provide rofi-sensible-terminal
|
||||||
|
|
||||||
|
pkgs.niphas-bar
|
||||||
|
pkgs.niphas-file-browser
|
||||||
|
pkgs.niphas-terminal
|
||||||
|
pkgs.niphas-web-browser
|
||||||
|
pkgs.niphas-set-wallpaper
|
||||||
|
pkgs.niphas-redshift
|
||||||
|
pkgs.niphas-screenshot
|
||||||
|
pkgs.niphas-clipboard-watcher
|
||||||
|
pkgs.niphas-runner
|
||||||
|
pkgs.niphas-locker
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.niri = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.niphas-niri;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.variables.EDITOR = lib.getExe pkgs.vim-kmein;
|
environment.variables.EDITOR = lib.getExe pkgs.niphas-editor;
|
||||||
environment.shellAliases.vi = "nvim";
|
environment.shellAliases.vi = "nvim";
|
||||||
environment.shellAliases.vim = "nvim";
|
environment.shellAliases.vim = "nvim";
|
||||||
environment.shellAliases.view = "nvim -R";
|
environment.shellAliases.view = "nvim -R";
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.vim-kmein
|
pkgs.niphas-editor
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
environment.shellAliases.g = "git";
|
environment.shellAliases.g = "git";
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.git-kmein
|
pkgs.niphas-git
|
||||||
pkgs.git-absorb
|
pkgs.git-absorb
|
||||||
pkgs.git-crypt
|
pkgs.git-crypt
|
||||||
pkgs.git-lfs
|
pkgs.git-lfs
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
programs.niri = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.niri-kmein;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
23
modules/nix.nix
Normal file
23
modules/nix.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
nix = {
|
||||||
|
package = pkgs.nixVersions.stable;
|
||||||
|
settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.nix-index.enable = true;
|
||||||
|
programs.direnv.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.nil
|
||||||
|
pkgs.nixfmt
|
||||||
|
pkgs.nix-prefetch-git
|
||||||
|
];
|
||||||
|
}
|
||||||
10
modules/shell/bash.nix
Normal file
10
modules/shell/bash.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.bash = {
|
||||||
|
promptInit = ''PS1="$(${pkgs.ncurses}/bin/tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(${pkgs.ncurses}/bin/tput sgr0) "'';
|
||||||
|
interactiveShellInit = ''
|
||||||
|
set -o vi
|
||||||
|
'';
|
||||||
|
completion.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
8
modules/shell/default.nix
Normal file
8
modules/shell/default.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./tools.nix
|
||||||
|
./bash.nix
|
||||||
|
./zsh.nix
|
||||||
|
./tmux.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
38
modules/shell/tmux.nix
Normal file
38
modules/shell/tmux.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
keyMode = "vi";
|
||||||
|
clock24 = true;
|
||||||
|
terminal = "screen-256color";
|
||||||
|
baseIndex = 1;
|
||||||
|
aggressiveResize = true;
|
||||||
|
escapeTime = 50;
|
||||||
|
historyLimit = 7000;
|
||||||
|
shortcut = "b";
|
||||||
|
extraConfig = ''
|
||||||
|
set -g mouse on
|
||||||
|
|
||||||
|
unbind *
|
||||||
|
bind * list-clients
|
||||||
|
|
||||||
|
# naVIgate
|
||||||
|
bind h select-pane -L
|
||||||
|
bind j select-pane -D
|
||||||
|
bind k select-pane -U
|
||||||
|
bind l select-pane -R
|
||||||
|
|
||||||
|
# Use C-h and C-l to cycle through panes
|
||||||
|
bind -r C-h select-window -t :-
|
||||||
|
bind -r C-l select-window -t :+
|
||||||
|
|
||||||
|
setw -g monitor-activity on
|
||||||
|
set -g visual-activity on
|
||||||
|
|
||||||
|
set -g status-interval 2
|
||||||
|
set -g status-left-length 32
|
||||||
|
set -g status-right-length 150
|
||||||
|
|
||||||
|
set -g status-position bottom
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
137
modules/shell/tools.nix
Normal file
137
modules/shell/tools.nix
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
isDarwin = lib.strings.hasSuffix "darwin" pkgs.stdenv.hostPlatform.system;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.htop
|
||||||
|
pkgs.btop
|
||||||
|
pkgs.iftop
|
||||||
|
pkgs.lsof
|
||||||
|
|
||||||
|
pkgs.wget
|
||||||
|
pkgs.curl
|
||||||
|
|
||||||
|
pkgs.zip
|
||||||
|
pkgs.unzip
|
||||||
|
pkgs.unrar
|
||||||
|
pkgs.p7zip
|
||||||
|
|
||||||
|
pkgs.fd
|
||||||
|
pkgs.ripgrep
|
||||||
|
pkgs.bat
|
||||||
|
pkgs.findutils
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.tree
|
||||||
|
|
||||||
|
pkgs.rlwrap
|
||||||
|
|
||||||
|
pkgs.file
|
||||||
|
pkgs.progress
|
||||||
|
pkgs.gdu
|
||||||
|
pkgs.rmlint
|
||||||
|
|
||||||
|
pkgs.binutils # for objdump, strings, etc.
|
||||||
|
pkgs.gnumake # for make
|
||||||
|
pkgs.tokei # for code statistics
|
||||||
|
|
||||||
|
pkgs.man-pages
|
||||||
|
pkgs.man-pages-posix
|
||||||
|
pkgs.dos2unix
|
||||||
|
|
||||||
|
pkgs.whois
|
||||||
|
pkgs.dnsutils
|
||||||
|
pkgs.aria2
|
||||||
|
|
||||||
|
pkgs.jq
|
||||||
|
pkgs.yq
|
||||||
|
pkgs.bc
|
||||||
|
|
||||||
|
pkgs.vimv
|
||||||
|
|
||||||
|
pkgs.pciutils # for lspci
|
||||||
|
|
||||||
|
pkgs.tmux
|
||||||
|
]
|
||||||
|
++ lib.optionals (!isDarwin) [
|
||||||
|
pkgs.usbutils # for lsusb
|
||||||
|
pkgs.lshw
|
||||||
|
pkgs.iotop
|
||||||
|
pkgs.psmisc # killall, pstree
|
||||||
|
];
|
||||||
|
|
||||||
|
security.wrappers = {
|
||||||
|
pmount = {
|
||||||
|
setuid = true;
|
||||||
|
owner = "root";
|
||||||
|
group = "root";
|
||||||
|
source = "${pkgs.pmount}/bin/pmount";
|
||||||
|
};
|
||||||
|
pumount = {
|
||||||
|
setuid = true;
|
||||||
|
owner = "root";
|
||||||
|
group = "root";
|
||||||
|
source = "${pkgs.pmount}/bin/pumount";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.interactiveShellInit = ''
|
||||||
|
# Use XDG_RUNTIME_DIR for temporary files if available
|
||||||
|
if [ -d "$XDG_RUNTIME_DIR" ]; then
|
||||||
|
export TMPDIR="$XDG_RUNTIME_DIR"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
environment.shellAliases =
|
||||||
|
let
|
||||||
|
take = pkgs.writers.writeDash "take" ''
|
||||||
|
mkdir "$1" && cd "$1"
|
||||||
|
'';
|
||||||
|
cdt = pkgs.writers.writeDash "cdt" ''
|
||||||
|
cd $(mktemp -p "$XDG_RUNTIME_DIR" -d "cdt-XXXXXX")
|
||||||
|
pwd
|
||||||
|
'';
|
||||||
|
wcd = pkgs.writers.writeDash "wcd" ''
|
||||||
|
cd "$(readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname)/.."
|
||||||
|
'';
|
||||||
|
where = pkgs.writers.writeDash "where" ''
|
||||||
|
readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
nixi = "nix repl nixpkgs";
|
||||||
|
take = "source ${take}";
|
||||||
|
wcd = "source ${wcd}";
|
||||||
|
where = "source ${where}";
|
||||||
|
# temporary files and directories
|
||||||
|
cdt = "source ${cdt}";
|
||||||
|
vit = "$EDITOR $(mktemp)";
|
||||||
|
# file safety
|
||||||
|
mv = "${pkgs.coreutils}/bin/mv --interactive";
|
||||||
|
rm = "${pkgs.coreutils}/bin/rm --interactive --verbose";
|
||||||
|
cp = "${pkgs.coreutils}/bin/cp --interactive";
|
||||||
|
# colours
|
||||||
|
cat = "${pkgs.bat}/bin/bat --theme=ansi --style=plain";
|
||||||
|
l = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all";
|
||||||
|
ls = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso";
|
||||||
|
ll = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso -l";
|
||||||
|
la = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all -l";
|
||||||
|
|
||||||
|
o = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||||
|
ns = "nix-shell --run zsh";
|
||||||
|
}
|
||||||
|
// (
|
||||||
|
if isDarwin then
|
||||||
|
{ }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
"ß" = "${pkgs.util-linux}/bin/setsid";
|
||||||
|
ip = "${pkgs.iproute2}/bin/ip -c";
|
||||||
|
# systemd
|
||||||
|
s = "${pkgs.systemd}/bin/systemctl";
|
||||||
|
us = "${pkgs.systemd}/bin/systemctl --user";
|
||||||
|
j = "${pkgs.systemd}/bin/journalctl";
|
||||||
|
uj = "${pkgs.systemd}/bin/journalctl --user";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -11,16 +11,18 @@ in
|
|||||||
|
|
||||||
environment.variables =
|
environment.variables =
|
||||||
let
|
let
|
||||||
defaultFzf = "${lib.getExe pkgs.fd}/bin/fd --type f --strip-cwd-prefix --no-ignore-vcs --exclude .git";
|
defaultFzf = "${lib.getExe pkgs.fd} --type f --strip-cwd-prefix --no-ignore-vcs --exclude .git";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
FZF_DEFAULT_COMMAND = defaultFzf;
|
FZF_DEFAULT_COMMAND = defaultFzf;
|
||||||
FZF_DEFAULT_OPTS = "--height 40%";
|
FZF_DEFAULT_OPTS = "--height 40%";
|
||||||
FZF_CTRL_T_COMMAND = defaultFzf;
|
FZF_CTRL_T_COMMAND = defaultFzf;
|
||||||
FZF_CTRL_T_OPTS = "--preview='head -$LINES {}'";
|
FZF_CTRL_T_OPTS = "--preview='head -$LINES {}'";
|
||||||
FZF_ALT_C_COMMAND = "${lib.getExe pkgs.fd}/bin/fd --type d";
|
FZF_ALT_C_COMMAND = "${lib.getExe pkgs.fd} --type d";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
|
||||||
programs.zsh =
|
programs.zsh =
|
||||||
let
|
let
|
||||||
zsh-completions = pkgs.fetchFromGitHub {
|
zsh-completions = pkgs.fetchFromGitHub {
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
let
|
let
|
||||||
config = {
|
config = {
|
||||||
clock.format = "%Y-%m-%d (%j %a %W) %H:%M";
|
clock.format = "%Y-%m-%d (%j %a %W) %H:%M";
|
||||||
|
appearance.scale_factor = 0.8;
|
||||||
modules = {
|
modules = {
|
||||||
center = [ "Clock" ];
|
center = [ "Clock" ];
|
||||||
left = [
|
left = [
|
||||||
@@ -12,7 +13,7 @@ let
|
|||||||
"KeyboardLayout"
|
"KeyboardLayout"
|
||||||
[
|
[
|
||||||
"Tray"
|
"Tray"
|
||||||
"SystemTray"
|
"SystemInfo"
|
||||||
"Settings"
|
"Settings"
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
{ wrappers, pkgs }:
|
{
|
||||||
|
wrappers,
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
git = wrappers.wrapperModules.git.apply {
|
git = wrappers.wrapperModules.git.apply {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|||||||
161
packages/niri.nix
Normal file
161
packages/niri.nix
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
{
|
||||||
|
wrappers,
|
||||||
|
pkgs,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
lib = pkgs.lib;
|
||||||
|
colors = {
|
||||||
|
active-color = "#7fc8ff";
|
||||||
|
inactive-color = "#505050";
|
||||||
|
shadow-color = "#0007";
|
||||||
|
};
|
||||||
|
|
||||||
|
niri = wrappers.wrapperModules.niri.apply {
|
||||||
|
inherit pkgs;
|
||||||
|
settings = builtins.foldl' lib.recursiveUpdate { } ([
|
||||||
|
{
|
||||||
|
input = {
|
||||||
|
keyboard = {
|
||||||
|
xkb.layout = "de";
|
||||||
|
xkb.variant = "T3";
|
||||||
|
xkb.options = "compose:caps";
|
||||||
|
numlock = null;
|
||||||
|
};
|
||||||
|
touchpad = {
|
||||||
|
tap = null;
|
||||||
|
drag = true;
|
||||||
|
};
|
||||||
|
mouse = null;
|
||||||
|
trackpoint = null;
|
||||||
|
warp-mouse-to-focus = null;
|
||||||
|
focus-follows-mouse = null;
|
||||||
|
};
|
||||||
|
layout = {
|
||||||
|
gaps = 8;
|
||||||
|
center-focused-column = "never";
|
||||||
|
preset-column-widths = [
|
||||||
|
{ proportion = 1. / 3.; }
|
||||||
|
{ proportion = 1. / 2.; }
|
||||||
|
{ proportion = 2. / 3.; }
|
||||||
|
];
|
||||||
|
default-column-width = {
|
||||||
|
proportion = 1. / 2.;
|
||||||
|
};
|
||||||
|
focus-ring = {
|
||||||
|
width = 2;
|
||||||
|
active-color = colors.active-color;
|
||||||
|
inactive-color = colors.inactive-color;
|
||||||
|
};
|
||||||
|
shadow = {
|
||||||
|
on = null;
|
||||||
|
draw-behind-window = true;
|
||||||
|
softness = 30;
|
||||||
|
spread = 5;
|
||||||
|
color = colors.shadow-color;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
spawn-at-startup = [
|
||||||
|
(lib.getExe pkgs.niphas-bar)
|
||||||
|
(lib.getExe pkgs.niphas-set-wallpaper)
|
||||||
|
(lib.getExe pkgs.niphas-clipboard-watcher)
|
||||||
|
(lib.getExe pkgs.niphas-redshift)
|
||||||
|
];
|
||||||
|
hotkey-overlay.skip-at-startup = null;
|
||||||
|
prefer-no-csd = null;
|
||||||
|
animations.slowdown = 0.5; # twice as fast
|
||||||
|
binds =
|
||||||
|
let
|
||||||
|
wpctl = lib.getExe' pkgs.wireplumber "wpctl";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"Mod+Shift+Slash".show-hotkey-overlay = null;
|
||||||
|
"Mod+Y".spawn = lib.getExe pkgs.niphas-web-browser;
|
||||||
|
"Mod+T".spawn = lib.getExe pkgs.niphas-file-browser;
|
||||||
|
"Mod+Return".spawn = lib.getExe pkgs.niphas-terminal;
|
||||||
|
"Mod+D".spawn = lib.getExe pkgs.niphas-runner;
|
||||||
|
"Mod+Shift+W".spawn = lib.getExe pkgs.niphas-locker;
|
||||||
|
"Print".spawn = lib.getExe pkgs.niphas-screenshot;
|
||||||
|
"Mod+Q".spawn = lib.getExe pkgs.niphas-clipman;
|
||||||
|
|
||||||
|
# TODO allow-when-locked
|
||||||
|
"XF86AudioRaiseVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0";
|
||||||
|
"XF86AudioLowerVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
|
||||||
|
"XF86AudioMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
|
"XF86AudioMicMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
||||||
|
"XF86AudioPlay".spawn-sh = "${lib.getExe pkgs.playerctl} play-pause";
|
||||||
|
"XF86AudioStop".spawn-sh = "${lib.getExe pkgs.playerctl} stop";
|
||||||
|
"XF86AudioPrev".spawn-sh = "${lib.getExe pkgs.playerctl} previous";
|
||||||
|
"XF86AudioNext".spawn-sh = "${lib.getExe pkgs.playerctl} next";
|
||||||
|
"XF86MonBrightnessUp".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set +25%";
|
||||||
|
"XF86MonBrightnessDown".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set 25%-";
|
||||||
|
|
||||||
|
# TODO repeat=false
|
||||||
|
"Mod+O".toggle-overview = null;
|
||||||
|
"Mod+Shift+Q".close-window = null;
|
||||||
|
|
||||||
|
"Mod+H".focus-column-left = null;
|
||||||
|
"Mod+J".focus-window-or-workspace-down = null;
|
||||||
|
"Mod+K".focus-window-or-workspace-up = null;
|
||||||
|
"Mod+L".focus-column-right = null;
|
||||||
|
"Mod+Shift+H".move-column-left = null;
|
||||||
|
"Mod+Shift+J".move-window-down-or-to-workspace-down = null;
|
||||||
|
"Mod+Shift+K".move-window-up-or-to-workspace-up = null;
|
||||||
|
"Mod+Shift+L".move-column-right = null;
|
||||||
|
"Mod+Home".focus-column-first = null;
|
||||||
|
"Mod+End".focus-column-last = null;
|
||||||
|
"Mod+Shift+Home".move-column-to-first = null;
|
||||||
|
"Mod+Shift+End".move-column-to-last = null;
|
||||||
|
|
||||||
|
# TODO cooldown-ms=150
|
||||||
|
"Mod+WheelScrollDown".focus-workspace-down = null;
|
||||||
|
"Mod+WheelScrollUp".focus-workspace-up = null;
|
||||||
|
"Mod+Shift+WheelScrollDown".move-column-to-workspace-down = null;
|
||||||
|
"Mod+Shift+WheelScrollUp".move-column-to-workspace-up = null;
|
||||||
|
|
||||||
|
"Mod+WheelScrollRight".focus-column-right = null;
|
||||||
|
"Mod+WheelScrollLeft".focus-column-left = null;
|
||||||
|
"Mod+Shift+WheelScrollRight".move-column-right = null;
|
||||||
|
"Mod+Shift+WheelScrollLeft".move-column-left = null;
|
||||||
|
|
||||||
|
"Mod+1".focus-workspace = 1;
|
||||||
|
"Mod+2".focus-workspace = 2;
|
||||||
|
"Mod+3".focus-workspace = 3;
|
||||||
|
"Mod+4".focus-workspace = 4;
|
||||||
|
"Mod+5".focus-workspace = 5;
|
||||||
|
"Mod+6".focus-workspace = 6;
|
||||||
|
"Mod+7".focus-workspace = 7;
|
||||||
|
"Mod+8".focus-workspace = 8;
|
||||||
|
"Mod+9".focus-workspace = 9;
|
||||||
|
"Mod+Shift+1".move-window-to-workspace = 1;
|
||||||
|
"Mod+Shift+2".move-window-to-workspace = 2;
|
||||||
|
"Mod+Shift+3".move-window-to-workspace = 3;
|
||||||
|
"Mod+Shift+4".move-window-to-workspace = 4;
|
||||||
|
"Mod+Shift+5".move-window-to-workspace = 5;
|
||||||
|
"Mod+Shift+6".move-window-to-workspace = 6;
|
||||||
|
"Mod+Shift+7".move-window-to-workspace = 7;
|
||||||
|
"Mod+Shift+8".move-window-to-workspace = 8;
|
||||||
|
"Mod+Shift+9".move-window-to-workspace = 9;
|
||||||
|
"Mod+Tab".focus-workspace-previous = null;
|
||||||
|
"Mod+Comma".consume-window-into-column = null;
|
||||||
|
"Mod+Period".expel-window-from-column = null;
|
||||||
|
"Mod+R".switch-preset-column-width = null;
|
||||||
|
"Mod+F".maximize-column = null;
|
||||||
|
"Mod+Shift+F".fullscreen-window = null;
|
||||||
|
"Mod+Ctrl+F".expand-column-to-available-width = null;
|
||||||
|
"Mod+Minus".set-column-width = "-10%";
|
||||||
|
"Mod+Plus".set-column-width = "+10%";
|
||||||
|
|
||||||
|
"Mod+V".toggle-window-floating = null;
|
||||||
|
"Mod+Shift+V".switch-focus-between-floating-and-tiling = null;
|
||||||
|
|
||||||
|
# allow-inhibiting=false
|
||||||
|
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = null;
|
||||||
|
|
||||||
|
"Mod+Shift+E".quit = null;
|
||||||
|
"Ctrl+Alt+Delete".quit = null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
in
|
||||||
|
niri.wrapper
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
{
|
|
||||||
wrappers,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
screenshotPath ? null,
|
|
||||||
fileManager ? lib.getExe pkgs.pcmanfm,
|
|
||||||
browser ? lib.getExe pkgs.firefox,
|
|
||||||
terminal ? lib.getExe pkgs.alacritty,
|
|
||||||
runnerCommand ? "${lib.getExe pkgs.rofi} -show run",
|
|
||||||
locker ? lib.getExe pkgs.swaylock,
|
|
||||||
wallpaperPath ? null,
|
|
||||||
geolocation ? [
|
|
||||||
52.5244
|
|
||||||
13.4105
|
|
||||||
],
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
colors = {
|
|
||||||
active-color = "#7fc8ff";
|
|
||||||
inactive-color = "#505050";
|
|
||||||
shadow-color = "#0007";
|
|
||||||
};
|
|
||||||
|
|
||||||
niri = wrappers.wrapperModules.niri.apply {
|
|
||||||
inherit pkgs;
|
|
||||||
settings = builtins.foldl' lib.recursiveUpdate { } (
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input = {
|
|
||||||
keyboard = {
|
|
||||||
xkb.layout = "de";
|
|
||||||
numlock = null;
|
|
||||||
};
|
|
||||||
touchpad = {
|
|
||||||
tap = null;
|
|
||||||
drag = true;
|
|
||||||
};
|
|
||||||
mouse = null;
|
|
||||||
trackpoint = null;
|
|
||||||
warp-mouse-to-focus = null;
|
|
||||||
focus-follows-mouse = null;
|
|
||||||
};
|
|
||||||
layout = {
|
|
||||||
gaps = 8;
|
|
||||||
center-focused-column = "never";
|
|
||||||
preset-column-widths = [
|
|
||||||
{ proportion = 1. / 3.; }
|
|
||||||
{ proportion = 1. / 2.; }
|
|
||||||
{ proportion = 2. / 3.; }
|
|
||||||
];
|
|
||||||
default-column-width = {
|
|
||||||
proportion = 1. / 2.;
|
|
||||||
};
|
|
||||||
focus-ring = {
|
|
||||||
width = 2;
|
|
||||||
active-color = colors.active-color;
|
|
||||||
inactive-color = colors.inactive-color;
|
|
||||||
};
|
|
||||||
shadow = {
|
|
||||||
on = null;
|
|
||||||
draw-behind-window = true;
|
|
||||||
softness = 30;
|
|
||||||
spread = 5;
|
|
||||||
color = colors.shadow-color;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
spawn-at-startup = [
|
|
||||||
(lib.getExe pkgs.ashell-kmein)
|
|
||||||
]
|
|
||||||
++ lib.optional (wallpaperPath != null) [
|
|
||||||
(lib.getExe pkgs.swaybg)
|
|
||||||
"--mode"
|
|
||||||
"fill"
|
|
||||||
"--image"
|
|
||||||
wallpaperPath
|
|
||||||
]
|
|
||||||
++ lib.optional (geolocation != null) (
|
|
||||||
let
|
|
||||||
latitude = builtins.elemAt geolocation 0;
|
|
||||||
longitude = builtins.elemAt geolocation 1;
|
|
||||||
in
|
|
||||||
[
|
|
||||||
(lib.getExe pkgs.wlsunset)
|
|
||||||
"-l"
|
|
||||||
(toString latitude)
|
|
||||||
"-L"
|
|
||||||
(toString longitude)
|
|
||||||
]
|
|
||||||
);
|
|
||||||
hotkey-overlay.skip-at-startup = null;
|
|
||||||
prefer-no-csd = null;
|
|
||||||
animations.slowdown = 0.5; # twice as fast
|
|
||||||
binds =
|
|
||||||
let
|
|
||||||
wpctl = lib.getExe' pkgs.wireplumber "wpctl";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
"Mod+Shift+Slash".show-hotkey-overlay = null;
|
|
||||||
"Mod+Y".spawn = browser;
|
|
||||||
"Mod+T".spawn = fileManager;
|
|
||||||
"Mod+Return".spawn = terminal;
|
|
||||||
"Mod+D".spawn-sh = runnerCommand;
|
|
||||||
"Mod+Shift+W".spawn = locker;
|
|
||||||
|
|
||||||
# TODO allow-when-locked
|
|
||||||
"XF86AudioRaiseVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0";
|
|
||||||
"XF86AudioLowerVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
|
|
||||||
"XF86AudioMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
|
||||||
"XF86AudioMicMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
|
|
||||||
"XF86AudioPlay".spawn-sh = "${lib.getExe pkgs.playerctl} play-pause";
|
|
||||||
"XF86AudioStop".spawn-sh = "${lib.getExe pkgs.playerctl} stop";
|
|
||||||
"XF86AudioPrev".spawn-sh = "${lib.getExe pkgs.playerctl} previous";
|
|
||||||
"XF86AudioNext".spawn-sh = "${lib.getExe pkgs.playerctl} next";
|
|
||||||
"XF86MonBrightnessUp".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set +10%";
|
|
||||||
"XF86MonBrightnessDown".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set 10%-";
|
|
||||||
|
|
||||||
# TODO repeat=false
|
|
||||||
"Mod+O".toggle-overview = null;
|
|
||||||
"Mod+Shift+Q".close-window = null;
|
|
||||||
|
|
||||||
"Mod+H".focus-column-left = null;
|
|
||||||
"Mod+J".focus-window-or-workspace-down = null;
|
|
||||||
"Mod+K".focus-window-or-workspace-up = null;
|
|
||||||
"Mod+L".focus-column-right = null;
|
|
||||||
"Mod+Shift+H".move-column-left = null;
|
|
||||||
"Mod+Shift+J".move-window-down-or-to-workspace-down = null;
|
|
||||||
"Mod+Shift+K".move-window-up-or-to-workspace-up = null;
|
|
||||||
"Mod+Shift+L".move-column-right = null;
|
|
||||||
"Mod+Home".focus-column-first = null;
|
|
||||||
"Mod+End".focus-column-last = null;
|
|
||||||
"Mod+Shift+Home".move-column-to-first = null;
|
|
||||||
"Mod+Shift+End".move-column-to-last = null;
|
|
||||||
|
|
||||||
# TODO cooldown-ms=150
|
|
||||||
"Mod+WheelScrollDown".focus-workspace-down = null;
|
|
||||||
"Mod+WheelScrollUp".focus-workspace-up = null;
|
|
||||||
"Mod+Shift+WheelScrollDown".move-column-to-workspace-down = null;
|
|
||||||
"Mod+Shift+WheelScrollUp".move-column-to-workspace-up = null;
|
|
||||||
|
|
||||||
"Mod+WheelScrollRight".focus-column-right = null;
|
|
||||||
"Mod+WheelScrollLeft".focus-column-left = null;
|
|
||||||
"Mod+Shift+WheelScrollRight".move-column-right = null;
|
|
||||||
"Mod+Shift+WheelScrollLeft".move-column-left = null;
|
|
||||||
|
|
||||||
"Mod+1".focus-workspace = 1;
|
|
||||||
"Mod+2".focus-workspace = 2;
|
|
||||||
"Mod+3".focus-workspace = 3;
|
|
||||||
"Mod+4".focus-workspace = 4;
|
|
||||||
"Mod+5".focus-workspace = 5;
|
|
||||||
"Mod+6".focus-workspace = 6;
|
|
||||||
"Mod+7".focus-workspace = 7;
|
|
||||||
"Mod+8".focus-workspace = 8;
|
|
||||||
"Mod+9".focus-workspace = 9;
|
|
||||||
"Mod+Shift+1".move-window-to-workspace = 1;
|
|
||||||
"Mod+Shift+2".move-window-to-workspace = 2;
|
|
||||||
"Mod+Shift+3".move-window-to-workspace = 3;
|
|
||||||
"Mod+Shift+4".move-window-to-workspace = 4;
|
|
||||||
"Mod+Shift+5".move-window-to-workspace = 5;
|
|
||||||
"Mod+Shift+6".move-window-to-workspace = 6;
|
|
||||||
"Mod+Shift+7".move-window-to-workspace = 7;
|
|
||||||
"Mod+Shift+8".move-window-to-workspace = 8;
|
|
||||||
"Mod+Shift+9".move-window-to-workspace = 9;
|
|
||||||
"Mod+Tab".focus-workspace-previous = null;
|
|
||||||
"Mod+Comma".consume-window-into-column = null;
|
|
||||||
"Mod+Period".expel-window-from-column = null;
|
|
||||||
"Mod+R".switch-preset-column-width = null;
|
|
||||||
"Mod+F".maximize-column = null;
|
|
||||||
"Mod+Shift+F".fullscreen-window = null;
|
|
||||||
"Mod+Ctrl+F".expand-column-to-available-width = null;
|
|
||||||
"Mod+Minus".set-column-width = "-10%";
|
|
||||||
"Mod+Plus".set-column-width = "+10%";
|
|
||||||
|
|
||||||
"Mod+V".toggle-window-floating = null;
|
|
||||||
"Mod+Shift+V".switch-focus-between-floating-and-tiling = null;
|
|
||||||
|
|
||||||
# allow-inhibiting=false
|
|
||||||
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = null;
|
|
||||||
|
|
||||||
"Mod+Shift+E".quit = null;
|
|
||||||
"Ctrl+Alt+Delete".quit = null;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
]
|
|
||||||
++ lib.optional (screenshotPath != null) [
|
|
||||||
{
|
|
||||||
screenshot-path = screenshotPath;
|
|
||||||
binds = {
|
|
||||||
"Print".screenshot = null;
|
|
||||||
"Ctrl+Print".screenshot-screen = null;
|
|
||||||
"Alt+Print".screenshot-window = null;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
]
|
|
||||||
);
|
|
||||||
};
|
|
||||||
in
|
|
||||||
niri.wrapper
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
neovim,
|
neovim,
|
||||||
|
nodejs,
|
||||||
vimPlugins,
|
vimPlugins,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
vimUtils,
|
vimUtils,
|
||||||
@@ -14,28 +15,41 @@ neovim.override {
|
|||||||
configure = {
|
configure = {
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
viAlias = true;
|
viAlias = true;
|
||||||
customRC = ''
|
customRC =
|
||||||
source ${./shared.vim}
|
|
||||||
source ${./init.vim}
|
lib.optionalString withCopilot (''
|
||||||
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
luafile ${writeText "copilot.lua" ''
|
||||||
luafile ${./init.lua}
|
require("copilot").setup({
|
||||||
''
|
suggestion = { enabled = false },
|
||||||
+ lib.optionalString (stylixColors != null) (
|
panel = { enabled = false },
|
||||||
with stylixColors.withHashtag;
|
copilot_node_command = '${lib.getExe nodejs}'
|
||||||
''
|
|
||||||
luafile ${writeText "colors.lua" ''
|
|
||||||
require('base16-colorscheme').setup({
|
|
||||||
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
|
|
||||||
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
|
|
||||||
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
|
|
||||||
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require("copilot_cmp").setup()
|
||||||
''}
|
''}
|
||||||
|
'')
|
||||||
|
+ ''
|
||||||
|
source ${./shared.vim}
|
||||||
|
source ${./init.vim}
|
||||||
|
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
||||||
|
luafile ${./init.lua}
|
||||||
''
|
''
|
||||||
)
|
+ lib.optionalString (stylixColors != null) (
|
||||||
+ lib.optionalString (colorscheme != null) ''
|
with stylixColors.withHashtag;
|
||||||
colorscheme ${colorscheme}
|
''
|
||||||
'';
|
luafile ${writeText "colors.lua" ''
|
||||||
|
require('base16-colorscheme').setup({
|
||||||
|
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
|
||||||
|
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
|
||||||
|
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
|
||||||
|
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
|
||||||
|
})
|
||||||
|
''}
|
||||||
|
''
|
||||||
|
)
|
||||||
|
+ lib.optionalString (colorscheme != null) ''
|
||||||
|
colorscheme ${colorscheme}
|
||||||
|
'';
|
||||||
packages.nvim = with vimPlugins; {
|
packages.nvim = with vimPlugins; {
|
||||||
start = [
|
start = [
|
||||||
base16-nvim
|
base16-nvim
|
||||||
@@ -81,7 +95,10 @@ neovim.override {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
++ lib.optional withCopilot vimPlugins.copilot.nvim;
|
++ lib.optionals withCopilot [
|
||||||
|
vimPlugins.copilot-lua
|
||||||
|
vimPlugins.copilot-cmp
|
||||||
|
];
|
||||||
opt = [
|
opt = [
|
||||||
csv
|
csv
|
||||||
dhall-vim
|
dhall-vim
|
||||||
|
|||||||
@@ -19,17 +19,23 @@ cmp.setup({
|
|||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
completion = {
|
||||||
|
autocomplete = { require("cmp.types").cmp.TriggerEvent.TextChanged },
|
||||||
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
-- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#super-tab-like-mapping
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
else
|
else
|
||||||
fallback()
|
cmp.complete()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
@@ -41,8 +47,11 @@ cmp.setup({
|
|||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = "nvim_lsp" },
|
{ name = "copilot", priority = 1000 },
|
||||||
{ name = "luasnip" },
|
{ name = "nvim_lsp", priority = 800 },
|
||||||
|
{ name = "luasnip", priority = 700 },
|
||||||
|
{ name = "path", priority = 500 },
|
||||||
|
{ name = "buffer", priority = 300 },
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -92,10 +101,11 @@ local language_servers = {
|
|||||||
pyright = {}, -- pyright
|
pyright = {}, -- pyright
|
||||||
-- tsserver = {}, -- typescript-language-server
|
-- tsserver = {}, -- typescript-language-server
|
||||||
cssls = {},
|
cssls = {},
|
||||||
elmls = {}, -- elm-language-server
|
elmls = {}, -- elm-language-server
|
||||||
gopls = {}, -- gopls
|
gopls = {}, -- gopls
|
||||||
denols = {}, -- deno built in
|
denols = {}, -- deno built in
|
||||||
bashls = {}, -- bash-language-server
|
bashls = {}, -- bash-language-server
|
||||||
|
ocamllsp = {}, -- ocamllsp
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = {
|
runtime = {
|
||||||
@@ -112,9 +122,9 @@ local language_servers = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
hls = {}, -- haskell-language-server
|
hls = {}, -- haskell-language-server
|
||||||
html = {}, -- vscode-langservers-extracted
|
html = {}, -- vscode-langservers-extracted
|
||||||
jsonls = {}, -- vscode-langservers-extracted
|
jsonls = {}, -- vscode-langservers-extracted
|
||||||
lemminx = {}, -- lemminx (for xml)
|
lemminx = {}, -- lemminx (for xml)
|
||||||
nil_ls = {
|
nil_ls = {
|
||||||
["nil"] = {
|
["nil"] = {
|
||||||
@@ -122,10 +132,10 @@ local language_servers = {
|
|||||||
command = { "nixfmt" },
|
command = { "nixfmt" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, -- github:oxalica/nil
|
}, -- github:oxalica/nil
|
||||||
dhall_lsp_server = {}, -- dhall-lsp-server
|
dhall_lsp_server = {}, -- dhall-lsp-server
|
||||||
-- rnix = {}, -- rnix-lsp
|
-- rnix = {}, -- rnix-lsp
|
||||||
jqls = {}, -- jq-lsp
|
jqls = {}, -- jq-lsp
|
||||||
rust_analyzer = { ["rust-analyzer"] = {} },
|
rust_analyzer = { ["rust-analyzer"] = {} },
|
||||||
-- eslint = {},
|
-- eslint = {},
|
||||||
-- volar? vls?
|
-- volar? vls?
|
||||||
|
|||||||
@@ -45,6 +45,17 @@ let g:netrw_winsize = 25
|
|||||||
call matchadd('colorcolumn', '\%101v', 100)
|
call matchadd('colorcolumn', '\%101v', 100)
|
||||||
highlight colorcolumn ctermbg=red
|
highlight colorcolumn ctermbg=red
|
||||||
|
|
||||||
|
fun! TrimWhitespace()
|
||||||
|
" Skip if the filetype is markdown
|
||||||
|
if &ft =~ 'markdown'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let l:save = winsaveview()
|
||||||
|
keeppatterns %s/\s\+$//e
|
||||||
|
call winrestview(l:save)
|
||||||
|
endfun
|
||||||
|
autocmd BufWritePre * call TrimWhitespace()
|
||||||
|
|
||||||
" undofile - This allows you to use undos after exiting and restarting
|
" undofile - This allows you to use undos after exiting and restarting
|
||||||
" This, like swap and backups, uses .vim-undo first, then ~/.vim/undo
|
" This, like swap and backups, uses .vim-undo first, then ~/.vim/undo
|
||||||
" :help undo-persistence
|
" :help undo-persistence
|
||||||
|
|||||||
27
packages/vimv.nix
Normal file
27
packages/vimv.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
bash,
|
||||||
|
fetchFromGitHub,
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "vimv";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "thameera";
|
||||||
|
repo = "vimv";
|
||||||
|
rev = "4152496c1946f68a13c648fb7e583ef23dac4eb8";
|
||||||
|
sha256 = "1fsrfx2gs6bqx7wk7pgcji2i2x4alqpsi66aif4kqvnpqfhcfzjd";
|
||||||
|
};
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
sed 's:#!/bin/bash:#!${bash}/bin/bash:' $src/vimv > $out/bin/vimv
|
||||||
|
chmod 755 $out/bin/vimv
|
||||||
|
'';
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/thameera/vimv";
|
||||||
|
description = "Batch-rename files using Vim";
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.all;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user