Compare commits
36 Commits
0ec1ab22a6
...
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 | |||
| a059882831 | |||
| 4d550731af |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
result
|
||||
76
flake.nix
76
flake.nix
@@ -24,18 +24,73 @@
|
||||
in
|
||||
{
|
||||
nixosModules = {
|
||||
vim = modules/vim.nix;
|
||||
zsh = modules/zsh.nix;
|
||||
editor = modules/editor.nix;
|
||||
git = modules/git.nix;
|
||||
udiskie = modules/udiskie.nix;
|
||||
desktop = modules/desktop.nix;
|
||||
nix = modules/nix.nix;
|
||||
shell = modules/shell;
|
||||
};
|
||||
|
||||
overlays.default = final: prev: {
|
||||
vim-kmein = prev.callPackage packages/vim { };
|
||||
git-kmein = import packages/git.nix {
|
||||
niphas-terminal = prev.alacritty;
|
||||
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;
|
||||
pkgs = prev;
|
||||
};
|
||||
niphas-git = import packages/git.nix {
|
||||
inherit (inputs) wrappers;
|
||||
pkgs = prev;
|
||||
};
|
||||
niphas-niri = import packages/niri.nix {
|
||||
inherit (inputs) wrappers;
|
||||
pkgs = final;
|
||||
};
|
||||
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 (
|
||||
@@ -47,7 +102,18 @@
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit (pkgs) vim-kmein git-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, ... }:
|
||||
{
|
||||
environment.variables.EDITOR = lib.getExe pkgs.vim-kmein;
|
||||
environment.variables.EDITOR = lib.getExe pkgs.niphas-editor;
|
||||
environment.shellAliases.vi = "nvim";
|
||||
environment.shellAliases.vim = "nvim";
|
||||
environment.shellAliases.view = "nvim -R";
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.vim-kmein
|
||||
pkgs.niphas-editor
|
||||
];
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
environment.shellAliases.g = "git";
|
||||
environment.systemPackages = [
|
||||
pkgs.git-kmein
|
||||
pkgs.niphas-git
|
||||
pkgs.git-absorb
|
||||
pkgs.git-crypt
|
||||
pkgs.git-lfs
|
||||
|
||||
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 =
|
||||
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
|
||||
{
|
||||
FZF_DEFAULT_COMMAND = defaultFzf;
|
||||
FZF_DEFAULT_OPTS = "--height 40%";
|
||||
FZF_CTRL_T_COMMAND = defaultFzf;
|
||||
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 =
|
||||
let
|
||||
zsh-completions = pkgs.fetchFromGitHub {
|
||||
49
packages/ashell.nix
Normal file
49
packages/ashell.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ wrappers, pkgs }:
|
||||
let
|
||||
config = {
|
||||
clock.format = "%Y-%m-%d (%j %a %W) %H:%M";
|
||||
appearance.scale_factor = 0.8;
|
||||
modules = {
|
||||
center = [ "Clock" ];
|
||||
left = [
|
||||
"Workspaces"
|
||||
[ "WindowTitle" ]
|
||||
];
|
||||
right = [
|
||||
"KeyboardLayout"
|
||||
[
|
||||
"Tray"
|
||||
"SystemInfo"
|
||||
"Settings"
|
||||
]
|
||||
];
|
||||
};
|
||||
settings.indicators = [
|
||||
"IdleInhibitor"
|
||||
"PowerProfile"
|
||||
"Audio"
|
||||
"Bluetooth"
|
||||
"Network"
|
||||
"Vpn"
|
||||
"Battery"
|
||||
];
|
||||
system_info.indicators = [
|
||||
"Cpu"
|
||||
"Memory"
|
||||
{ "Disk" = "/"; }
|
||||
];
|
||||
workspaces = {
|
||||
disable_special_workspaces = true;
|
||||
enable_workspace_filling = false;
|
||||
visibility_mode = "MonitorSpecific";
|
||||
};
|
||||
};
|
||||
configFile = (pkgs.formats.toml { }).generate "config.toml" config;
|
||||
in
|
||||
wrappers.lib.wrapPackage {
|
||||
inherit pkgs;
|
||||
package = pkgs.ashell;
|
||||
flags = {
|
||||
"--config-path" = toString configFile;
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
{ wrappers, pkgs }:
|
||||
{
|
||||
wrappers,
|
||||
pkgs,
|
||||
}:
|
||||
let
|
||||
git = wrappers.wrapperModules.git.apply {
|
||||
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,5 +1,6 @@
|
||||
{
|
||||
neovim,
|
||||
nodejs,
|
||||
vimPlugins,
|
||||
fetchFromGitHub,
|
||||
vimUtils,
|
||||
@@ -14,28 +15,41 @@ neovim.override {
|
||||
configure = {
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
customRC = ''
|
||||
source ${./shared.vim}
|
||||
source ${./init.vim}
|
||||
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
||||
luafile ${./init.lua}
|
||||
''
|
||||
+ lib.optionalString (stylixColors != null) (
|
||||
with stylixColors.withHashtag;
|
||||
''
|
||||
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}'
|
||||
customRC =
|
||||
|
||||
lib.optionalString withCopilot (''
|
||||
luafile ${writeText "copilot.lua" ''
|
||||
require("copilot").setup({
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
copilot_node_command = '${lib.getExe nodejs}'
|
||||
})
|
||||
|
||||
require("copilot_cmp").setup()
|
||||
''}
|
||||
'')
|
||||
+ ''
|
||||
source ${./shared.vim}
|
||||
source ${./init.vim}
|
||||
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
||||
luafile ${./init.lua}
|
||||
''
|
||||
)
|
||||
+ lib.optionalString (colorscheme != null) ''
|
||||
colorscheme ${colorscheme}
|
||||
'';
|
||||
+ lib.optionalString (stylixColors != null) (
|
||||
with stylixColors.withHashtag;
|
||||
''
|
||||
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; {
|
||||
start = [
|
||||
base16-nvim
|
||||
@@ -81,7 +95,10 @@ neovim.override {
|
||||
}
|
||||
)
|
||||
]
|
||||
++ lib.optional withCopilot vimPlugins.copilot.nvim;
|
||||
++ lib.optionals withCopilot [
|
||||
vimPlugins.copilot-lua
|
||||
vimPlugins.copilot-cmp
|
||||
];
|
||||
opt = [
|
||||
csv
|
||||
dhall-vim
|
||||
|
||||
@@ -19,17 +19,23 @@ cmp.setup({
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
autocomplete = { require("cmp.types").cmp.TriggerEvent.TextChanged },
|
||||
},
|
||||
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)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
cmp.complete()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
@@ -41,8 +47,11 @@ cmp.setup({
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "copilot", priority = 1000 },
|
||||
{ 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
|
||||
-- tsserver = {}, -- typescript-language-server
|
||||
cssls = {},
|
||||
elmls = {}, -- elm-language-server
|
||||
gopls = {}, -- gopls
|
||||
elmls = {}, -- elm-language-server
|
||||
gopls = {}, -- gopls
|
||||
denols = {}, -- deno built in
|
||||
bashls = {}, -- bash-language-server
|
||||
ocamllsp = {}, -- ocamllsp
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
@@ -112,9 +122,9 @@ local language_servers = {
|
||||
},
|
||||
},
|
||||
},
|
||||
hls = {}, -- haskell-language-server
|
||||
html = {}, -- vscode-langservers-extracted
|
||||
jsonls = {}, -- vscode-langservers-extracted
|
||||
hls = {}, -- haskell-language-server
|
||||
html = {}, -- vscode-langservers-extracted
|
||||
jsonls = {}, -- vscode-langservers-extracted
|
||||
lemminx = {}, -- lemminx (for xml)
|
||||
nil_ls = {
|
||||
["nil"] = {
|
||||
@@ -122,10 +132,10 @@ local language_servers = {
|
||||
command = { "nixfmt" },
|
||||
},
|
||||
},
|
||||
}, -- github:oxalica/nil
|
||||
}, -- github:oxalica/nil
|
||||
dhall_lsp_server = {}, -- dhall-lsp-server
|
||||
-- rnix = {}, -- rnix-lsp
|
||||
jqls = {}, -- jq-lsp
|
||||
jqls = {}, -- jq-lsp
|
||||
rust_analyzer = { ["rust-analyzer"] = {} },
|
||||
-- eslint = {},
|
||||
-- volar? vls?
|
||||
|
||||
@@ -45,6 +45,17 @@ let g:netrw_winsize = 25
|
||||
call matchadd('colorcolumn', '\%101v', 100)
|
||||
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
|
||||
" This, like swap and backups, uses .vim-undo first, then ~/.vim/undo
|
||||
" :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