diff --git a/configuration.nix b/configuration.nix
index a240eef5e8937499bbded4f9fd85287ec8f3e1a2..2156fd286e27efa1cee72e1859eed32bf1f37ac5 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -2,75 +2,69 @@ # Edit this configuration file to define what should be installed on
{ config, pkgs, user, ... }:
-{
+let
+in {
services = {
resolved = {
enable = true;
};
cloudflare-dyndns = {
domains = [ "nix.ait.place" ];
ipv4 = true;
ipv6 = true;
};
xserver = {
enable = true;
enable = true;
mouse = {
accelProfile = "flat";
middleEmulation = false;
};
videoDrivers = [ "nvidia" ];
desktopManager.xterm.enable = false;
dwm = {
enable = true;
package = pkgs.dwm.overrideAttrs (attrs: rec{ patches = [ ./extra/dwm.diff ]; });
};
leftwm.enable = true;
enable = true;
package = pkgs.dwm.overrideAttrs (attrs: { patches = [
./extra/dwm-warp-6.4.diff
./extra/dwm-toggleborder-6.3.diff
./extra/dwm.diff
]; });
};
setupCommands = ''
${pkgs.xorg.xrandr}/bin/xrandr --output DP-4 --primary --mode 1920x1080 --rate 240
${pkgs.xorg.xsetroot}/bin/xsetroot -solid "#111111" -cursor_name left_ptr
${pkgs.hsetroot} -solid "#111111"
${pkgs.xorg.xset} r rate 250 50 &
'';
sx.enable = true;
autoLogin = {
enable = true;
user = "${user}";
};
layout = "gb";
variant = "";
};
};
journald.extraConfig = ''SystemMaxUse=300MB'';
getty.autologinUser = "${user}";
pipewire = {
enable = true;
alsa.enable = true;
@@ -78,6 +72,8 @@ alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
fstrim.enable = true;
@@ -98,111 +94,50 @@ };
transmission = {
enable = true;
settings = {
download-dir = "/home/${user}/Downloads/torrents";
incomplete-dir-enabled = false;
};
};
openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
nginx = {
enable = false;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
-};
-## Enabled to fix nvidia docker: https://github.com/YodaEmbedding/nixos/commit/a2b35962e82eba6c0e1492a81bc98d3e6f7184be
-#systemd.enableUnifiedCgroupHierarchy = false;
-systemd = {
enableACME = true;
acmeRoot = null;
addSSL = true;
locations."/" = {
proxyWebsockets = true;
proxyPass = "http://127.0.0.1:8096";
};
};
'';
-};
-xdg = {
};
virtualisation = {
@@ -217,21 +152,64 @@ #waydroid.enable = true;
#oci-containers.backend = "podman";
data-root = "/home/${user}/.local/share/docker";
+};
+systemd = {
matchConfig.Name = "enp36s0";
networkConfig.DHCP = "yes";
+};
+xdg = {
#};
};
@@ -271,27 +249,16 @@ "FFFFFF" #bold-white
];
};
-# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
-#systemd.services."getty@tty1".enable = false;
-#systemd.services."autovt@tty1".enable = false;
-fonts.fonts = with pkgs; [
+fonts.packages = with pkgs; [
fira
rounded-mgenplus
noto-fonts-emoji
];
sound.enable = true;
security = {
doas = {
enable = true;
@@ -315,13 +282,15 @@ };
qt = {
enable = true;
platformTheme = "qt5ct";
};
boot = {
loader = {
systemd-boot = {
enable = true;
@@ -333,54 +302,50 @@ canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
};
bootspec.enable = true;
};
#systemd.network.enable = true;
networking = {
hostName = "nixos"; # Define your hostname.
search = [ "tailf09e4.ts.net" ];
firewall = {
allowedTCPPorts = [];
allowedUDPPorts = [];
};
};
hardware = {
General = {
ControllerMode = "bredr";
};
nvidia = {
nvidiaSettings = false;
};
opengl = {
enable = true;
driSupport32Bit = true;
mangohud
};
};
nix = {
@@ -394,7 +359,10 @@ experimental-features = nix-command flakes
min-free = ${toString (100 * 1024 * 1024)}
max-free = ${toString (1024 * 1024 * 1024)}
'';
gc = {
automatic = true;
dates = "weekly";
diff --git a/environment.nix b/environment.nix
deleted file mode 100644
index 70d87056fbf8e726334fd7a2df2a23e7c45fc2c3..0000000000000000000000000000000000000000
--- a/environment.nix
+++ /dev/null
@@ -1,158 +0,0 @@
-{ pkgs, ... }:
-let
${pkgs.which}/bin/which "$@"
&& grep "not signed$" | cut -d " " -f2 | \
xargs -I{} doas ${pkgs.sbctl}/bin/sbctl sign {}
-in {
-environment = {
-systemPackages = with pkgs; [
-];
-shellAliases = {
-};
-sessionVariables = {
-};
-}
diff --git a/environment/default.nix b/environment/default.nix
new file mode 100644
index 0000000000000000000000000000000000000000..f749991feaf0bec3f5daf3a475f243799a105504
--- /dev/null
+++ b/environment/default.nix
@@ -0,0 +1,235 @@
+{ pkgs, ... }:
+let
${pkgs.which}/bin/which "$@"
&& grep "not signed$" | cut -d " " -f2 | \
xargs -I{} doas ${pkgs.sbctl}/bin/sbctl sign {}
grep -qP -m1 '[^un]bind.+\/[^:]+\(usb\)' <(udevadm monitor -u -t seat -s input -s usb)
wayland) ${pkgs.wl-clipboard}/bin/wl-copy;;
x11) ${pkgs.xclip}/bin/xclip -sel c;;
owner = "aandrew-me";
repo = "tgpt";
rev = "refs/tags/v${version}";
hash = "sha256-+Lu1+DcJ46BTGhLJBgxYJSxlqFbKVHmnpi5rAsGjLmo=";
+in {
+environment = rec {
'');
+}
+))) sxhkd
+;
+shellAliases = {
+};
+sessionVariables = rec {
+};
+}
diff --git a/extra/dwm-toggleborder-6.3.diff b/extra/dwm-toggleborder-6.3.diff
new file mode 100644
index 0000000000000000000000000000000000000000..24172a282a35d8da53be6940a86496f95926f39c
--- /dev/null
+++ b/extra/dwm-toggleborder-6.3.diff
@@ -0,0 +1,53 @@
+From ef85b0473590615fda4ba4b20a717e42c99e3f99 Mon Sep 17 00:00:00 2001
+From: Stanisław Bitner sbitner420@tutanota.com
+Date: Tue, 9 Aug 2022 23:17:47 +0200
+Subject: [PATCH] toggleborder
+This patch allows you to toggle client border. It works by setting the
+border of the client to 0 or to borderpx defined in configuration file.
+---
+diff --git a/config.def.h b/config.def.h
+index a2ac963..60b811f 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -65,6 +65,7 @@ static Key keys[] = {
++ { MODKEY|ShiftMask, XK_b, toggleborder, {0} },
+diff --git a/dwm.c b/dwm.c
+index 967c9e8..91d00f6 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -211,6 +211,7 @@ static void tag(const Arg *arg);
++static void toggleborder(const Arg *arg);
+@@ -1707,6 +1708,13 @@ togglebar(const Arg *arg)
++void
++toggleborder(const Arg *arg)
++{
++ selmon->sel->bw = (selmon->sel->bw == borderpx ? 0 : borderpx);
++ arrange(selmon);
++}
++
+--
+2.37.1
diff --git a/extra/dwm-warp-6.4.diff b/extra/dwm-warp-6.4.diff
new file mode 100644
index 0000000000000000000000000000000000000000..02fcdba1aa27250559135684eb4da530baa0b0e6
--- /dev/null
+++ b/extra/dwm-warp-6.4.diff
@@ -0,0 +1,79 @@
+From a229c36f51ad6f8b40109ed53c643f242351962a Mon Sep 17 00:00:00 2001
+From: Jonas Dujava jonas.dujava@gmail.com
+Date: Fri, 26 May 2023 22:14:48 +0200
+Subject: [PATCH] Warp patch
+Warps the mouse cursor to the center of the currently focused
+window or screen when the mouse cursor is
+This version properly handles warping to windows that have not been
+mapped yet (before it resulted in a change of the stack order).
+See the discussion in (thanks goes to Bakkeby):
+---
+diff --git a/dwm.c b/dwm.c
+index e5efb6a..7ea6c14 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -228,6 +228,7 @@ static void updatetitle(Client *c);
++static void warp(const Client *c);
+@@ -834,6 +835,7 @@ focusmon(const Arg *arg)
++ warp(selmon->sel);
+@@ -1366,6 +1368,8 @@ restack(Monitor *m)
wc.sibling = c->win;
}
++ if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && m->lt[m->sellt]->arrange != &monocle)
++ warp(m->sel);
+@@ -2044,6 +2048,28 @@ view(const Arg *arg)
++void
++warp(const Client *c)
++{
++ int x, y;
++
++ if (!c) {
++ XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww / 2, selmon->wy + selmon->wh / 2);
++ return;
++ }
++
++ if (!getrootptr(&x, &y) ||
++ (x > c->x - c->bw &&
++ y > c->y - c->bw &&
++ x < c->x + c->w + c->bw*2 &&
++ y < c->y + c->h + c->bw*2) ||
++ (y > c->mon->by && y < c->mon->by + bh) ||
++ (c->mon->topbar && !y))
++ return;
++
++ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
++}
++
+--
+2.40.1
diff --git a/extra/dwm.diff b/extra/dwm.diff
index 766014097f9ef5a1cdda91fff85e74903c843ada..21c655eca0215ac3571aff73f9c93f0aa082e42e 100644
--- a/extra/dwm.diff
+++ b/extra/dwm.diff
@@ -3,7 +3,7 @@ new file mode 100644
index 0000000..eea458a
--- /dev/null
+++ b/config.h
-@@ -0,0 +1,171 @@
+@@ -0,0 +1,172 @@
+/* See LICENSE file for copyright and license details. */
+/* appearance */
@@ -33,26 +33,26 @@ + /* xprop(1):
-+ /* class instance title tags mask isfloating monitor */
-+ { "qutebrowser",NULL, NULL, 1 << 8, 0, -1 },
-+ { "obs", NULL, NULL, 1 << 4, 0, -1 },
-+ { "discord", NULL,"Discord Updater", 1 << 6, 0, -1 },
-+ { "discord", NULL, NULL, 1 << 6, 0, -1 },
-+ { "Steam", NULL, NULL, 1 << 7, 0, -1 },
-+ { "Steam", NULL,"Friends List", 0, 1, -1 },
-+ { "Mumble", NULL, NULL, 1 << 5, 0, -1 },
-+ { "QjackCtl", NULL, "JACK Audio Connection Kit [(default)] Active.", 0, 1, -1 },
-+ { NULL,"chatterino", NULL, 0, 1, -1 },
-+ { NULL, "newsboat", NULL, 1 << 4, 0, -1 },
-+ { NULL,"pulsemixer", NULL, 0, 1, -1 },
-+ { NULL, "ncmpc", NULL, 0, 1, -1 },
++ /* class instance title tags mask isfloating monitor */
++ { "qutebrowser",NULL, NULL, 1 << 8, 0, -1 },
++ { "librewolf", NULL, NULL, 1 << 7, 0, -1 },
++ { "mpv", NULL, NULL, 1 << 2, 0, -1 },
++ { "obs", NULL, NULL, 1 << 4, 0, -1 },
++ { "WebCord", NULL, NULL, 1 << 6, 0, -1 },
++ { "steam", NULL, NULL, 1 << 7, 0, -1 },
++ { "steam", NULL,"Friends List", 0, 1, -1 },
++ { "Mumble", NULL, NULL, 1 << 5, 0, -1 },
++ { "newsboat", NULL, NULL, 1 << 4, 0, -1 },
++ { "chatterino", NULL, NULL, 0, 1, -1 },
++ { "pulsemixer", NULL, NULL, 0, 1, -1 },
++ { "ncmpc", NULL, NULL, 0, 1, -1 },
+};
+/* layout(s) */
+static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
+static const int nmaster = 1; /* number of clients in master area */
+static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
-+static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
++static const int lockfullscreen = 0; /* 1 will force focus on the fullscreen window */
+static const Layout layouts[] = {
@@ -65,23 +65,23 @@ +
+#include <X11/XF86keysym.h>
+/* key definitions */
+#define MODKEY Mod4Mask
-+#define Hyper Mod1Mask
++#define Hyper Mod3Mask
+#define TAGKEYS(KEY,TAG) \
-+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
++ { MODKEY|Hyper, KEY, toggletag, {.ui = 1 << TAG} },
+/* helper for spawning shell commands in the pre dwm-5.0 fashion */
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+/* commands */
-+static const char *dmenucmd[] = { "dmenu_run", NULL };
++static const char *dmenucmd[] = { "bemenu-run", "-W", "0.3", NULL };
+static const char *termcmd[] = { "alacritty", NULL };
++static const char *browsercmd[] = { "jumpapp", "-C", "qutebrowser", NULL };
+static const char *quitcmd[] = { "pkill", "sx", NULL };
+static const char *passcmd[] = { "passmenu", NULL };
+static const char *passtypecmd[] = { "passmenu", "--type", NULL };
-+static const char *handlercmd[] = { "dhandler", NULL };
+static const char *togglecmd[] = { "mpc", "toggle", NULL };
+static const char *nextcmd[] = { "mpc", "next", NULL };
+static const char *prevcmd[] = { "mpc", "prev", NULL };
@@ -90,11 +90,13 @@ +static const char *volupcmd[] = { "pulsemixer", "--change-volume", "+2", NULL };
+static const char *voldowncmd[] = { "pulsemixer", "--change-volume", "-2", NULL };
+static const char *mondowncmd[] = { "monbrightness", "-65", NULL };
+static const char *monupcmd[] = { "monbrightness", "+65", NULL };
++static const char *rsscmd[] = { "jumpapp", "newsboat", NULL };
+static Key keys[] = {
++ { MODKEY, XK_w, spawn, {.v = browsercmd } },
@@ -130,12 +132,11 @@ + { MODKEY, XK_p, spawn, {.v = passcmd } },
-+ { MODKEY, XK_s, spawn,SHCMD("pkill -x ncmpc || $TERMINAL -n ncmpc -e ncmpc") },
-+ { MODKEY, XK_y, spawn,SHCMD("pkill -x picom || picom --experimental-backends") },
-+ { MODKEY, XK_a, spawn, {.v = handlercmd } },
-+ { MODKEY, XK_v, spawn,SHCMD("pkill -x pulsemixer || $TERMINAL -n pulsemixer -e pulsemixer") },
-+ { MODKEY, XK_n, spawn,SHCMD("wmctrl -a newsboat || $TERMINAL -n newsboat -e newsboat") },
-+ { MODKEY, XK_m, spawn,SHCMD("wmctrl -a mutt || $TERMINAL -n mutt -e mutt") },
++ { 0,XF86XK_Calculator, spawn,SHCMD("$TERMINAL -e clac") },
++ { MODKEY, XK_s, spawn,SHCMD("pkill -x ncmpc || $TERMINAL --class ncmpc -e ncmpc") },
++ { MODKEY, XK_a, spawn,SHCMD("xclip -o -sel c | dhandler") },
++ { MODKEY, XK_v, spawn,SHCMD("pkill -x pulsemixer || $TERMINAL --class pulsemixer -e pulsemixer") },
++ { MODKEY, XK_n, spawn, {.v = rsscmd } },
diff --git a/extra/twitch b/extra/twitch
index 4f32d42756528d3512dc376412d2671caa3f92dc..c477c261385bc035092384330294f418a7fd97a5 100755
--- a/extra/twitch
+++ b/extra/twitch
@@ -43,7 +43,7 @@ esac
done
-#[ ! -t 0 ] && [ -s /dev/stdin ] && TWITCH_NAMES=/dev/stdin && send=true
+[ ! -t 0 ] && [ -s /dev/stdin ] && TWITCH_NAMES=/dev/stdin && send=true
[ $send = true ] && twitch.py $arg > "$TWITCH_LIVE"
@@ -53,12 +53,12 @@ command -v streamlink >/dev/null && \
TWITCH_PLAYER="streamlink --default-stream=best --verbose-player" || \
TWITCH_PLAYER=mpv
-# Have a fallback if dmenu is not installed
-[ -z $TWITCH_MENUER ] && command -v dmenu >/dev/null && \
TWITCH_MENUER='dmenu -sb #8041DE' || MENUER="fzf"
+# Have a fallback if bemenu is not installed
+[ -z "$TWITCH_MENUER" ] && command -v bemenu >/dev/null && \
TWITCH_MENUER="bemenu -p twitch -W 0.2" || TWITCH_MENUER="fzf"
-[ -n "$SSH_TTY" ] && command -v fzf >/dev/null && MENUER="fzf"
+[ -n "$SSH_TTY" ] && command -v fzf >/dev/null && TWITCH_MENUER="fzf"
#Checks if program is piped into a shell and print output to program
if [ -p /dev/stdout ]; then cat "$TWITCH_LIVE"; else
diff --git a/flake.lock b/flake.lock
index 55ea4bb3c0c54f6c3c06937c93c54d8bcf882747..67184eabc05fed1836e0c3d5b02c9c338807caac 100644
--- a/flake.lock
+++ b/flake.lock
@@ -7,39 +7,54 @@ "nixpkgs"
]
},
"locked": {
"lastModified": 1687871164,
"narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=",
"lastModified": 1711133180,
"narHash": "sha256-WJOahf+6115+GMl3wUfURu8fszuNeJLv9qAWFQl3Vmo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38",
"rev": "1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.05",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1689956312,
"narHash": "sha256-NV9yamMhE5jgz+ZSM2IgXeYqOvmGIbIIJ+AFIhfD7Ek=",
"lastModified": 1711163522,
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6da4bc6cb07cba1b8e53d139cbf1d2fb8061d967",
"rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.05",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"unstable-nixpkgs": "unstable-nixpkgs"
}
"locked": {
"lastModified": 1711163522,
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "44d0940ea560dee511026a53f0e2e2cde489b4d4",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
}
},
diff --git a/flake.nix b/flake.nix
index 8a9581bf5a66b48a3ae1701e2e9ec80d21e3a4c6..64061a06cdc26ad5633b5969b6d6ceb73b1f92c8 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,28 +2,36 @@ {
description = "My complete nixos setup";
inputs = {
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
#nur.url = "github:nix-community/NUR";
};
let
system = "x86_64-linux";
user = "ait";
unstable = import unstable-nixpkgs {
inherit system;
};
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
#overlays = [overlay-unstable];
config = {
allowUnfreePredicate = pkg: builtins.elem (lib.strings.getName pkg) [
"nvidia-x11"
"nvidia-persistenced"
"discord"
"steam"
"steam-run"
"steam-runtime"
"steam-original"
];
};
@@ -36,10 +44,11 @@ inherit user;
};
inherit system pkgs;
modules = [
({ pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
./configuration.nix
./environment.nix
./environment
./programs.nix
./vim.nix
./mpv.nix
./hardware-configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
diff --git a/hardware-configuration.nix b/hardware-configuration.nix
index 587bf884185250e0e8d6e70a3951643044d1f476..b24ef47cd7ead0f0176540bca244f7bd5f3e8ad2 100644
--- a/hardware-configuration.nix
+++ b/hardware-configuration.nix
@@ -27,14 +27,14 @@ neededForBoot = true;
options = [ "noatime" ];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/81e3081a-0c68-47f7-bac0-2b5530216344";
fsType = "ext4";
};
fileSystems."/media/hdd" = {
diff --git a/home.nix b/home.nix
old mode 100644
new mode 100755
index da0f9b7fec430ea0459a9924ffbea1d8ddf93dc1..80317243fbdef3cdded937f4dbde4ee036313d09
--- a/home.nix
+++ b/home.nix
@@ -1,51 +1,65 @@
{ pkgs, ... }:
-{
+let
+in {
programs.home-manager.enable = true;
programs = {
helix = {
enable = true;
language-server.rust-analyzer = {
command = "${pkgs.rust-analyzer}/bin/rust-analyzer";
};
settings = {
theme = "base16_transparent";
theme = "custom";
editor = {
terminal = [ "alacritty" ];
line-number = "relative";
bufferline = "multiple";
color-modes = true;
cursor-shape.insert = "bar";
auto-save = true;
scrolloff = 999;
indent-guides.render = true;
completion-replace = true;
completion-trigger-len = 0;
lsp = {
display-messages = true;
display-inlay-hints = true;
snippets = true;
};
};
custom = {
inherits = "rose_pine";
"ui.background" = {};
};
};
};
neovim = {
#extraConfig = (builtins.readFile ./extra/neovim.vim);
extraPackages = with pkgs; [
rust-analyzer nil ccls gopls
rust-analyzer nil gopls
];
extraLuaConfig = ''
vim.g.mapleader = " "
vim.opt.nu = true
vim.opt.relativenumber = true
-vim.opt.showmode = false
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.smartindent = true
-vim.opt.swapfile = false
-vim.opt.backup = false
vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir"
vim.opt.undofile = true
@@ -57,12 +71,19 @@
vim.opt.scrolloff = 999
vim.opt.isfname:append("@-@")
-vim.opt.updatetime = 50
+vim.opt.foldlevel = 4
+vim.opt.foldmethod = "expr"
+vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.colorcolumn = "100"
-- Visual group move text up/down
vim.keymap.set("v", "J", ":m '>+1gv=gv")
vim.keymap.set("v", "K", ":m '<-2gv=gv")
+-- Set up keybindings to switch to a specific tab in normal and insert mode
+for i = 1, 9 do
-- greatest remap ever
vim.keymap.set("x", "p", [["_dP]])
@@ -87,26 +108,19 @@
vim.keymap.set("n", "b", "ls:b")
vim.keymap.set("n", "pv", vim.cmd.Ex)
-vim.keymap.set("n", "u", vim.cmd.UndotreeToggle)
vim.keymap.set("n", "g", vim.cmd.Git)
'';
plugins = with pkgs.vimPlugins; [
nvim-treesitter.withAllGrammars
undotree
plenary-nvim
vim-fugitive
firenvim
{ plugin = nvim-lspconfig; type = "lua"; config = ''
local lspconfig = require('lspconfig')
local lsp_defaults = lspconfig.util.default_config
-lsp_defaults.capabilities = vim.tbl_deep_extend(
-)
+vim.api.nvim_create_autocmd('TermOpen', {command = "setlocal nonumber norelativenumber"})
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
@@ -126,49 +140,28 @@ vim.keymap.set('n', '', 'lua vim.lsp.buf.code_action()', opts)
vim.keymap.set('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>', opts)
vim.keymap.set('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>', opts)
end
})
lspconfig.rust_analyzer.setup({})
-lspconfig.ccls.setup({})
-lspconfig.nil_ls.setup({})
-lspconfig.gopls.setup({})
+lspconfig.nil_ls.setup({})
+lspconfig.gopls.setup({})
'';
}
-{ plugin = rose-pine; type = "lua"; config = ''
-vim.cmd('colorscheme rose-pine')
-vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
-vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
-'';
-}
-{ plugin = lualine-nvim; type = "lua"; config = ''
-require('lualine').setup {
-}
-'';
-}
{ plugin = orgmode; type = "lua"; config = ''
require('orgmode').setup_ts_grammar()
require('orgmode').setup({
org_agenda_files = {'~/Documents/notes/*'},
org_default_notes_file = '~/Documents/notes/refile.org',
})
'';
}
{ plugin = telescope-nvim; type = "lua"; config = ''
local builtin = require('telescope.builtin')
vim.keymap.set("n", "f", builtin.find_files, {})
-vim.keymap.set('n', 'rg', function()
-end)
+vim.keymap.set('n', 'rg', builtin.live_grep, {})
'';
}
];
@@ -177,50 +170,488 @@
emacs = {
enable = false;
extraPackages = epkgs: with epkgs; [
all-the-icons
consult
doom-themes
doom-modeline
ednc
embark
embark-consult
emmet-mode
evil-collection
evil-leader
evil-surround
fd-dired
flycheck
git-commit
git-auto-commit-mode
google-translate
hydra
iedit
magit
magit-section
marginalia
mpv
nix-mode
ob-async
openwith
orderless
rg
s
shrink-path
undo-tree
vertico
wgrep
which-key
yaml-mode
];
all-the-icons
consult
doom-themes
doom-modeline
ednc
embark
embark-consult
emmet-mode
evil-collection
evil-leader
evil-surround
fd-dired
flycheck
git-commit
git-auto-commit-mode
google-translate
hydra
iedit
magit
magit-section
marginalia
mpv
nix-mode
ob-async
openwith
orderless
rg
s
shrink-path
undo-tree
vertico
wgrep
which-key
yaml-mode
"twitter.com": "nitter.net",
"www.twitter.com": "www.nitter.net",
"mobile.twitter.com": "nitter.net",
"www.reddit.com": "old.reddit.com",
"reddit.com": "old.reddit.com",
"i.imgur.com": "i.actionsack.com",
"tiktok.com": "proxitok.pabloferreiro.es",
"www.tiktok.com": "proxitok.pabloferreiro.es",
"imdb.com": "libremdb.iket.me",
"www.imdb.com": "libremdb.iket.me",
url = request.request_url.host()
if url in urlsubs:
request.request_url.setHost(urlsubs.get(url))
try:
request.redirect(request.request_url)
except:
pass
normal = {
"h" = "scroll left";
"j" = "scroll down";
"k" = "scroll up";
"l" = "scroll right";
"d" = "scroll-page 0 0.5";
"u" = "scroll-page 0 -0.5";
"J" = "tab-next";
"K" = "tab-prev";
"H" = "back";
"L" = "forward";
"r" = "reload";
"R" = "reload -f";
"y" = "yank";
"Y" = "yank -s";
"p" = "open -- {clipboard}";
"P" = "open --tab -- {clipboard}";
"b" = "cmd-set-text -s :quickmark-load";
"B" = "cmd-set-text -s :quickmark-load -t";
"o" = "cmd-set-text -s :open";
"O" = "cmd-set-text -s :open -t";
"go" = "cmd-set-text :open {url:pretty}";
"gO" = "cmd-set-text :open -t -r {url:pretty}";
":" = "cmd-set-text :";
"/" = "cmd-set-text /";
"<Ctrl-b>" = "quickmark-save";
"=" = "zoom-in";
"-" = "zoom-out";
"[" = "navigate prev";
"]" = "navigate next";
"}" = "navigate next -t";
"{" = "navigate prev -t";
"<Ctrl+a>" = "navigate increment";
"<Ctrl+x>" = "navigate decrement";
"x" = "tab-close";
"U" = "undo -w";
"m" = "mode-enter set_mark";
"'" = "mode-enter jump_mark";
"v" = "mode-enter caret";
"V" = "mode-enter caret ;; selection-toggle --line";
"i" = "mode-enter insert";
"gi" = "hint inputs --first";
"gg" = "scroll-to-perc 0";
"G" = "scroll-to-perc 100";
"tt" = "config-cycle -p -u *://{url:host}/* content.javascript.enabled ;; reload";
"n" = "search-next";
"N" = "search-prev";
"<ESC>" = "clear-keychain;; search;; fullscreen --leave";
",p" = "spawn --userscript qute-pass --password-only -d dmenu";
",r" = "spawn --userscript readability";
",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
"<Ctrl-m>" = "spawn mpv {url}";
"f" = "hint";
"F" = "hint all tab";
";m" = "hint links spawn --detach mpv {hint-url}";
";M" = "hint all spawn --detach mpv {hint-url}";
";H" = "hint links spawn --detach dhandler {hint-url}";
";y" = "hint links yank";
";Y" = "hint links yank-primary";
";xa" = "hint all delete";
";xi" = "hint inputs delete";
"tb" = "config-cycle -t statusbar.show always never";
"tB" = "config-cycle -t fonts.default_size 14pt 25pt";
"wB" = "set-cmd-text -s :bookmark-load -w";
"wIf" = "devtools-focus";
"wIh" = "devtools left";
"wIj" = "devtools bottom";
"wIk" = "devtools top";
"wIl" = "devtools right";
"wIw" = "devtools window";
"wO" = "set-cmd-text :open -w {url:pretty}";
"wP" = "open -w -- {primary}";
"wb" = "set-cmd-text -s :quickmark-load -w";
"wf" = "hint all window";
"wh" = "back -w";
"wi" = "devtools";
"wl" = "forward -w";
"wo" = "set-cmd-text -s :open -w";
"wp" = "open -w -- {clipboard}";
};
yesno = {
"<Alt-Shift-Y>" = "prompt-yank --sel";
"<Alt-Y>" = "prompt-yank";
"<Escape>" = "mode-leave";
"<Return>" = "prompt-accept";
"N" = "prompt-accept --save no";
"Y" = "prompt-accept --save yes";
"n" = "prompt-accept no";
"y" = "prompt-accept yes";
};
prompt = {
"<Alt-B>" = "rl-backward-word";
"<Alt-Backspace>" = "rl-backward-kill-word";
"<Alt-D>" = "rl-kill-word";
"<Alt-E>" = "prompt-fileselect-external";
"<Alt-F>" = "rl-forward-word";
"<Alt-Shift-Y>" = "prompt-yank --sel";
"<Alt-Y>" = "prompt-yank";
"<Ctrl-?>" = "rl-delete-char";
"<Ctrl-A>" = "rl-beginning-of-line";
"<Ctrl-B>" = "rl-backward-char";
"<Ctrl-E>" = "rl-end-of-line";
"<Ctrl-F>" = "rl-forward-char";
"<Ctrl-H>" = "rl-backward-delete-char";
"<Ctrl-K>" = "rl-kill-line";
"<Ctrl-P>" = "prompt-open-download --pdfjs";
"<Ctrl-Shift-W>" = "rl-filename-rubout";
"<Ctrl-U>" = "rl-unix-line-discard";
"<Ctrl-W>" = ''rl-rubout " "'';
"<Ctrl-X>" = "prompt-open-download";
"<Ctrl-Y>" = "rl-yank";
"<Down>" = "prompt-item-focus next";
"<Escape>" = "mode-leave";
"<Return>" = "prompt-accept";
"<Shift-Tab>" = "prompt-item-focus prev";
"<Tab>" = "prompt-item-focus next";
"<Up>" = "prompt-item-focus prev";
};
register = {
"<Escape>" = "mode-leave";
};
insert = {
"<Ctrl-E>" = "edit-text";
"<Escape>" = "mode-leave";
"<Shift-Escape>" = "fake-key <Escape>";
"<Shift-Ins>" = "insert-text -- {primary}";
};
command = {
"<Ctrl-e>" = "edit-command";
"<Alt-B>" = "rl-backward-word";
"<Alt-Backspace>" = "rl-backward-kill-word";
"<Alt-D>" = "rl-kill-word";
"<Alt-F>" = "rl-forward-word";
"<Ctrl-?>" = "rl-delete-char";
"<Ctrl-A>" = "rl-beginning-of-line";
"<Ctrl-B>" = "rl-backward-char";
"<Ctrl-C>" = "completion-item-yank";
"<Ctrl-D>" = "completion-item-del";
"<Ctrl-E>" = "rl-end-of-line";
"<Ctrl-F>" = "rl-forward-char";
"<Ctrl-H>" = "rl-backward-delete-char";
"<Ctrl-K>" = "rl-kill-line";
"<Ctrl-N>" = "command-history-next";
"<Ctrl-P>" = "command-history-prev";
"<Ctrl-Return>" = "command-accept --rapid";
"<Ctrl-Shift-C>" = "completion-item-yank --sel";
"<Ctrl-Shift-Tab>" = "completion-item-focus prev-category";
"<Ctrl-Shift-W>" = "rl-filename-rubout";
"<Ctrl-Tab>" = "completion-item-focus next-category";
"<Ctrl-U>" = "rl-unix-line-discard";
"<Ctrl-W>" = ''rl-rubout " "'';
"<Ctrl-Y>" = "rl-yank";
"<Down>" = "completion-item-focus --history next";
"<Escape>" = "mode-leave";
"<PgDown>" = "completion-item-focus next-page";
"<PgUp>" = "completion-item-focus prev-page";
"<Return>" = "command-accept";
"<Shift-Delete>" = "completion-item-del";
"<Shift-Tab>" = "completion-item-focus prev";
"<Tab>" = "completion-item-focus next";
"<Up>" = "completion-item-focus --history prev";
};
caret ={
"$" = "move-to-end-of-line";
"0" = "move-to-start-of-line";
"<Ctrl-Space>" = "selection-drop";
"<Escape>" = "mode-leave";
"<Return>" = "yank selection";
"<Space>" = "selection-toggle";
"G" = "move-to-end-of-document";
"H" = "scroll left";
"J" = "scroll down";
"K" = "scroll up";
"L" = "scroll right";
"V" = "selection-toggle --line";
"Y" = "yank selection -s";
"[" = "move-to-start-of-prev-block";
"]" = "move-to-start-of-next-block";
"b" = "move-to-prev-word";
"c" = "mode-enter normal";
"e" = "move-to-end-of-word";
"gg" = "move-to-start-of-document";
"h" = "move-to-prev-char";
"j" = "move-to-next-line";
"k" = "move-to-prev-line";
"l" = "move-to-next-char";
"o" = "selection-reverse";
"v" = "selection-toggle";
"w" = "move-to-next-word";
"y" = "yank selection";
"{" = "move-to-end-of-prev-block";
"}" = "move-to-end-of-next-block";
};
hint = {
"<Ctrl-B>" = "hint all tab-bg";
"<Ctrl-F>" = "hint links";
"<Ctrl-R>" = "hint --rapid links tab-bg";
"<Escape>" = "mode-leave";
"<Return>" = "hint-follow";
};
spellcheck.languages = ["en-GB" "nb-NO"];
scrolling.smooth = true;
hints = {
chars = "asdfjkl;";
#padding = {bottom = 2; left = 2; right = 2 ; top = 2;};
border = "2px solid rgba(238, 34, 34, 0.5)";
};
fonts = {
tabs = {
selected = "default_family default_family";
unselected = "default_family default_family";
};
default_size = "14pt";
};
url = {
default_page = "https://ait.place";
start_pages = "https://ait.place";
};
tabs = {
position = "top";
#padding = {bottom = 5; left = 5; right = 5; top = 5;};
indicator.width = 0;
last_close = "close";
show = "multiple";
max_width = -1;
title = {
alignment = "left";
format = "{current_title}";
};
};
completion = {
show = "always";
height = "25%";
scrollbar.width = 0;
shrink = true;
use_best_match = true;
open_categories = ["searchengines" "quickmarks" "bookmarks" "history" "filesystem"];
};
statusbar = {
show = "never";
#padding = {bottom = 5; left = 5; right = 5; top = 5;};
};
search.ignore_case = "smart";
content = {
javascript = {
enabled = false;
alert = false;
#clipboard = false;
can_open_tabs_automatically = false;
};
blocking = {
method = "both";
adblock.lists = [
"https://easylist.to/easylist/easylist.txt"
"https://easylist.to/easylist/easyprivacy.txt"
"https://secure.fanboy.co.nz/fanboy-annoyance.txt"
"https://secure.fanboy.co.nz/fanboy-cookiemonster.txt"
"https://easylist.to/easylist/fanboy-social.txt"
"https://www.i-dont-care-about-cookies.eu/abp/"
];
};
canvas_reading = false;
prefers_reduced_motion = true;
private_browsing = true;
geolocation = false;
notifications.enabled = false;
cookies.accept = "no-3rdparty";
};
colors = {
webpage = {
preferred_color_scheme = "dark";
bg = background;
darkmode = {
enabled = true;
threshold = {
background = 100;
foreground = 230;
};
};
};
hints = {
match.fg = accent;
bg = "rgba(17, 17, 17, 0.5)";
fg = foreground;
};
statusbar = {
normal = def;
private = def;
command = {
bg = background;
private = def;
};
};
tabs = {
selected = {
odd.bg = accent;
even.bg = accent;
};
odd = def;
even = def;
bar = def;
};
messages = {
info = def;
error.bg = accent;
};
prompts = {
bg = background;
selected.fg = foreground;
};
completion = {
item = {
selected = {
bg = accent;
border = {
bottom = accent;
top = accent;
};
fg = foreground;
match.fg = background;
};
};
even = def;
odd = def;
category = {
bg = accent;
border = {
bottom = accent;
top = accent;
};
};
};
downloads = {
bar = def;
start = def;
stop = def;
error.bg = accent;
system.bg = "none";
system.fg = "none";
};
contextmenu = {
menu = {
bg = background;
fg = foreground;
};
selected.bg = accent;
};
};
DEFAULT = "https://search.brave.com/search?q={}";
w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1";
aw = "https://wiki.archlinux.org/?search={}";
nw = "https://nixos.wiki/index.php?search={}";
g = "https://encrypted.google.com/search?q={}";
aur = "https://aur.archlinux.org/packages/?O=0&K={}";
pac = "https://www.archlinux.org/packages/?sort=&arch=x86_64&maintainer=&flagged=&q={}";
dic = "https://en.wiktionary.org/wiki/{}";
etym = "http://www.etymonline.com/index.php?allowed_in_frame=0&search={}";
tpb = "https://www.magnetdl.com/search/?m=1&q={}";
p = "https://www.protondb.com/search?q={}";
gt = "https://translate.google.com/#view=home&op=translate&sl=auto&tl=en&text={}";
trig = "https://trigedasleng.net/search?q={}";
rt = "https://www.rottentomatoes.com/search?search={}";
nix = "https://search.nixos.org/packages?query={}";
ng = "https://noogle.dev?search={}";
alacritty = {
enable = true;
settings = {
window.padding = {
x = 15;
y = 15;
window = {
opacity = 0.5;
dynamic_title = true;
padding = {
x = 15;
y = 15;
};
};
#env.BEMENU_BACKEND = "curses";
colors = {
@@ -262,7 +693,26 @@ default-stream=best
twitch-disable-ads
twitch-low-latency
'';
# adding rounded corners on windows
corner-radius = 10
opacity-rule = [
"70:class_g = 'chatterino' && !focused"
];
# without this line, blur won't work
unredir-if-possible = false;
backend = "glx"
vsync = true;
# animations (set fading to false if you wanna disable them)
fading = true;
fade-in-step = 0.08;
fade-out-step = 0.08;
".config/pulsemixer.cfg".text = ''
[general]
step-big = 5
[keys]
mode1 = o, KEY_F1
mode2 = i, KEY_F2
@@ -280,10 +730,13 @@ [ -f $xprofile ] && . "$xprofile" &
export XDG_SESSION_TYPE=x11
export GDK_BACKEND=x11
xset r rate 250 50 &
xsetroot -solid "#111111" -cursor_name left_ptr
hsetroot -solid "#111111"
session=$WM
case $session in
kde ) exec startplasma-x11;;
spectrwm ) exec spectrwm;;
dk ) exec dk;;
leftwm ) exec dbus-launch leftwm;;
dwm ) while true; do ssh-agent dwm >/dev/null 2>&1; done;;
xmonad ) exec xmonad;;
@@ -296,85 +749,60 @@ qtile ) exec qtile;;
esac
'';
};
#![enable(implicit_some)]
(
single_window_border: false,
insert_behavior: Top,
scratchpad: [
( name: "RSS", value: "$TERMINAL -e newsboat", x: 560, y: 390, height: 300, width: 800 ),
( name: "Volume", value: "$TERMINAL -e pulsemixer", x: 560, y: 660, height: 300, width: 800 ),
( name: "Music", value: "$TERMINAL -e ncmpc", x: 760, y: 70, height: 400, width: 400 ),
( name: "File", value: "$TERMINAL -e $FILE", x: 760, y: 660, height: 300, width: 400 ),
( name: "Terminal", value: "$TERMINAL", x: 560, y: 0, height: 300, width: 800 ),
],
window_rules: [
( window_class: "qutebrowser", spawn_on_tag: 9 ),
( window_class: "mpv", spawn_on_tag: 2 ),
( window_class: "firefox", spawn_on_tag: 8 ),
( window_class: "brave", spawn_on_tag: 8 ),
( window_class: "newsboat", spawn_on_tag: 5 ),
( window_class: "steam", spawn_on_tag: 7 ),
( window_class: "Mumble", spawn_on_tag: 6 ),
],
sloppy_mouse_follows_focus: true,
keybind: [
( command: Execute, value: "xclip -o -selection c | dhandler", modifier: ["modkey"], key: "a"),
( command: Execute, value: "leftwm-toggleborder", modifier: ["modkey"], key: "b"),
( command: Execute, value: "dmenu_run", modifier: ["modkey"], key: "d"),
( command: Execute, value: "$TERMINAL -e passmenu", modifier: ["modkey"], key: "p"),
( command: ToggleFullScreen, modifier: ["modkey"], key: "f"),
( command: SetLayout, value: "MainAndVertStack", modifier: ["modkey"], key: "t"),
( command: SetLayout, value: "MainAndHorizontalStack", modifier: ["modkey", "Shift"], key: "t"),
( command: SetLayout, value: "GridHorizontal", modifier: ["modkey"], key: "g"),
( command: ToggleSticky, modifier: ["modkey", "Shift"], key: "s"),
( command: Execute, value: "uploadscreen", modifier: [], key: "Print"),
( command: Execute, value: "$TERMINAL", modifier: ["modkey"], key: "Return"),
( command: CloseWindow, modifier: ["modkey"], key: "q"),
( command: CloseAllOtherWindows, modifier: ["modkey", "Shift"], key: "q"),
( command: SoftReload, modifier: ["modkey", "Shift"], key: "r"),
( command: Execute, value: "loginctl kill-session $XDG_SESSION_ID", modifier: ["modkey", "Shift"], key: "BackSpace"),
( command: ToggleFloating, modifier: ["modkey", "Shift"], key: "space"),
( command: ToggleScratchPad, value: "RSS", modifier: ["modkey"], key: "n"),
( command: ToggleScratchPad, value: "Terminal", modifier: ["modkey", "Shift"], key: "Return"),
( command: ToggleScratchPad, value: "Volume", modifier: ["modkey"], key: "v"),
( command: ToggleScratchPad, value: "Music", modifier: ["modkey"], key: "m"),
( command: ReturnToLastTag, modifier: ["modkey"], key: "Tab"),
( command: RotateTag, modifier: ["modkey"], key: "r"),
( command: MoveWindowUp, modifier: ["modkey", "Shift"], key: "k"),
( command: MoveWindowDown, modifier: ["modkey", "Shift"], key: "j"),
( command: MoveWindowTop, modifier: ["modkey"], key: "space"),
( command: DecreaseMainWidth, value: "5", modifier: ["modkey"], key: "h"),
( command: IncreaseMainWidth, value: "5", modifier: ["modkey"], key: "l"),
( command: SetMarginMultiplier, value: "1", modifier: ["modkey"], key: "equal"),
( command: SetMarginMultiplier, value: "0", modifier: ["modkey"], key: "minus"),
( command: FocusWindowUp, modifier: ["modkey"], key: "k"),
( command: FocusWindowDown, modifier: ["modkey"], key: "j"),
( command: FocusWorkspaceNext, modifier: ["modkey"], key: "period"),
( command: FocusWorkspacePrevious, modifier: ["modkey"], key: "comma"),
( command: MoveWindowToNextWorkspace, modifier: ["modkey", "Shift"], key: "period"),
( command: MoveWindowToPreviousWorkspace, modifier: ["modkey", "Shift"], key: "comma"),
( command: GotoTag, value: "1", modifier: ["modkey"], key: "1"),
( command: GotoTag, value: "2", modifier: ["modkey"], key: "2"),
( command: GotoTag, value: "3", modifier: ["modkey"], key: "3"),
( command: GotoTag, value: "4", modifier: ["modkey"], key: "4"),
( command: GotoTag, value: "5", modifier: ["modkey"], key: "5"),
( command: GotoTag, value: "6", modifier: ["modkey"], key: "6"),
( command: GotoTag, value: "7", modifier: ["modkey"], key: "7"),
( command: GotoTag, value: "8", modifier: ["modkey"], key: "8"),
( command: GotoTag, value: "9", modifier: ["modkey"], key: "9"),
( command: MoveToTag, value: "1", modifier: ["modkey", "Shift"], key: "1"),
( command: MoveToTag, value: "2", modifier: ["modkey", "Shift"], key: "2"),
( command: MoveToTag, value: "3", modifier: ["modkey", "Shift"], key: "3"),
( command: MoveToTag, value: "4", modifier: ["modkey", "Shift"], key: "4"),
( command: MoveToTag, value: "5", modifier: ["modkey", "Shift"], key: "5"),
( command: MoveToTag, value: "6", modifier: ["modkey", "Shift"], key: "6"),
( command: MoveToTag, value: "7", modifier: ["modkey", "Shift"], key: "7"),
( command: MoveToTag, value: "8", modifier: ["modkey", "Shift"], key: "8"),
( command: MoveToTag, value: "9", modifier: ["modkey", "Shift"], key: "9"),
],
)
'';
};
};
}
diff --git a/mpv.nix b/mpv.nix
new file mode 100644
index 0000000000000000000000000000000000000000..6b4ffcecbe19432a439b3a0b50ae57467bcdda73
--- /dev/null
+++ b/mpv.nix
@@ -0,0 +1,189 @@
+{ pkgs, ... }:
+let
+sockets="($(ls /tmp/mpvSockets/*))"
+getsockets() {
name="$(echo "$tosend" | socat - "''${sockets[$i]}" | jq '.data' -r)"
printf "%s\t%s\n" "$i" "$name"
+}
+command() {
tosend="$tosend \"$arg\","
for i in "''${sockets[@]}"; do
echo "$tosend" | socat - "$i";
done
for i in ''${sockets[$index]}; do
echo "$tosend" | socat - "$i";
done
+}
+options=(
+)
+if [ -z "$*" ]; then
+else
+fi
+case "$option" in
+esac
+local HISTFILE = (os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME").."/.config").."/mpv/history";
+mp.register_event("file-loaded", function()
logfile = io.open(HISTFILE, "a+");
logfile:write(("%s\t%s\n"):format(path, mp.get_property("media-title")));
logfile:close();
+end)
install -Dm644 ${src} $out/share/mpv/scripts/history.lua
+-- mpvSockets, one socket per instance, removes socket on exit
+local utils = require 'mp.utils'
+local function get_temp_path()
+end
+local tempDir = get_temp_path()
+local function join_paths(...)
path = utils.join_path(path, tostring(v))
+end
+local ppid = utils.getpid()
+os.execute("mkdir " .. join_paths(tempDir, "mpvSockets") .. " 2>/dev/null")
+mp.set_property("options/input-ipc-server", join_paths(tempDir, "mpvSockets", ppid))
+local function shutdown_handler()
os.remove(join_paths(tempDir, "mpvSockets", ppid))
+end
+mp.register_event("shutdown", shutdown_handler)
install -Dm644 ${src} $out/share/mpv/scripts/mpvSockets.lua
+function yankpath()
+end
+function yankstreampath()
+end
+mp.add_key_binding(nil, "yank-path", yankpath)
+mp.add_key_binding(nil, "yank-streampath", yankstreampath)
install -Dm644 ${src} $out/share/mpv/scripts/yank.lua
+in {
+environment.systemPackages = with pkgs; [
mpvctl
mpvlast
(mpv.override { scripts = with mpvScripts; [
mpv-history
mpv-yank
sponsorblock
mpvSockets
]; })
+}
diff --git a/programs.nix b/programs.nix
index eb52ceb0f53041cef1b267b2053f40f93e9581ee..d2dd5e6dc18eb146afbeac095ea126fe85b4e82b 100644
--- a/programs.nix
+++ b/programs.nix
@@ -1,4 +1,4 @@
-{ pkgs, user, lib, ...}:
+{ pkgs, user, ...}:
let
steam-home = pkgs.writeShellScriptBin "steam" ''HOME=$XDG_STATE_HOME/steam ; exec ${pkgs.steam}/bin/steam "$@" '';
twitch = pkgs.stdenv.mkDerivation { name = "twitch.py";
@@ -9,15 +9,10 @@ cp ${./extra/twitch} $out/bin/twitch;
cp ${./extra/twitch.py} $out/bin/twitch.py;
chmod +x $out/bin/twitch.py $out/bin/twitch'';
};
url = "https://discord.com/api/download?platform=linux&format=tar.gz";
sha256 = "087p8z538cyfa9phd4nvzjrvx4s9952jz1azb2k8g6pggh1vxwm8";
in {
users = {
@@ -29,51 +24,45 @@ isNormalUser = true;
description = "${user}";
shell = pkgs.zsh;
uid = 1000;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKyRpcQn+csN89v5vdkPyxWkYUl3pDCWeUNg6dl4sSS3 ait@pine"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICQwBaEvNbtb4KIvvGy641aQtTUGjOuhgUyKmrJqxjmt ait@mobile-nixos"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILrOMlbkgtfYMiGPRWfeCbTxkBTahKgDYZHNPBNziHzU nix-on-droid@localhost"
];
packages = (with pkgs; [
#Browsers
qutebrowser-qt6
(writeShellScriptBin "mullvad-browser" ''
HOME=$XDG_STATE_HOME/mullvad ; exec ${mullvad-browser}/bin/mullvad-browser "$@"
(writeShellScriptBin "webtorrent" ''
exec ${nodePackages.webtorrent-cli}/bin/webtorrent \
--out $XDG_CACHE_HOME/webtorrent "$@"
'')
#Bad discord clients
webcord
(mpv.override { scripts = with mpvScripts; [
autoload
sponsorblock
webtorrent-mpv-hook
]; })
(writeShellScriptBin "webtorrent" ''
exec ${nodePackages.webtorrent-cli}/bin/webtorrent --out $XDG_CACHE_HOME/webtorrent "$@" '')
yt-dlp
#Menu runners / dmenu symlinks (Bemenu supports both wl,x and nc)
bemenu bemenu-dmenu bemenu-run-dmenu
#(dmenu.override { patches = [ ./extra/dmenu.diff ]; })
bemenu bemenu-dmenu bemenu-dmenu-wl bemenu-run-dmenu bemenu-fzf
#x11 desktop utilities
feh zathura xclip maim picom-next unclutter-xfixes
streamlink
#general programs
twitch #streamlink dmenu wrapper
#chatterino2
twitch #streamlink dmenu wrapper
steam-home #Uses $XDG_STATE_HOME instead of $HOME
neovim
(writeShellScriptBin "librewolf" ''
HOME=$XDG_STATE_HOME/librewolf; exec ${librewolf}/bin/librewolf "$@"
'')
#(writeShellScriptBin "mullvad-browser" ''
# HOME=$XDG_STATE_HOME/mullvad; exec ${mullvad-browser}/bin/mullvad-browser "$@"
#'')
]);
};
};
-nixpkgs.overlays = [ (self: super: {
-})];
programs = {
zsh = {
@@ -81,23 +70,57 @@ enable = true;
histSize = 10000;
histFile = ''$XDG_CACHE_HOME/zsh/history'';
loginShellInit = ''
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec sx
[ "$(tty)" = "/dev/tty2" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec sx
[ "$(tty)" = "/dev/tty1" ] && Hyprland
'';
shellInit = ''
chmod -w /home/${user};
[ -h "/home/${user}/.nix-profile" ] && rm "/home/${user}/.nix-profile"
[ -d "/home/${user}/.nix-defexpr" ] && rm -r "/home/${user}/.nix-defexpr"
chmod -w /home/${user};
source ${pkgs.zsh-nix-shell}/share/zsh-nix-shell/nix-shell.plugin.zsh
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
source ${pkgs.zsh-fzf-history-search}/share/zsh-fzf-history-search/zsh-fzf-history-search.plugin.zsh
'';
interactiveShellInit = ''
export BEMENU_BACKEND=curses
stty stop undef # Disable ctrl-s to freeze terminal.
setopt autocd # Automatically cd into typed directory.
setopt interactive_comments
bindkey '^r' fzf_history_search
# Shows the current date and time
paste <(cal --color=always) <(${pkgs.toilet}/bin/toilet -f mono12 `date +%R` )
# Displays the prosseses on top of the terminal
ps -eo %cpu,%mem,comm --sort user | sort -d -r -k2 | head
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"; zle accept-line -w;
else
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"; zle accept-line -w;
else
zle push-input -w; zle clear-screen -w;
fi
fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
source ${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
bindkey -s '^o' "${pkgs.tmux-sessionizer}/bin/tms\n"
bindkey -s '^g' 'cd "$(dirname "$(fd|$MENU)")"\n'
#Backspace bugs for zsh
bindkey '^[[P' delete-char
bindkey "^?" backward-delete-char
## Edit line in vim buffer ctrl-v
autoload edit-command-line; zle -N edit-command-line
autoload -U edit-command-line &&
zle -N edit-command-line &&
bindkey -M vicmd "^v" edit-command-line
bindkey '^v' edit-command-line
zvm_after_init_commands+=('bindkey ^r fzf_history_search')
source ${pkgs.zsh-fast-syntax-highlighting}/share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh
'';
promptInit = ''
autoload -U colors && colors # Add colors
@@ -118,7 +141,7 @@ [[ $H > 0 ]] && printf '%dh ' $H
[[ $M > 0 ]] && printf '%dm ' $M
printf '%ds' $S
}
# Execution time start
time_preexec_hook() {
EXEC_TIME_start=$(date +%s)
@@ -139,13 +162,14 @@ }
autoload -Uz add-zsh-hook
add-zsh-hook preexec time_preexec_hook
add-zsh-hook precmd time_precmd_hook
'';
autosuggestions = {
enable = true;
async = true;
strategy = ["match_prev_cmd" "completion"];
};
enableBashCompletion = true;
};
@@ -165,25 +189,21 @@ highlight_base_name = 1;
};
};
customRC = (builtins.readFile ./extra/neovim.vim);
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
vim-nix
neogit
lightline-vim
];
opt = [ ];
};
git = {
enable = true;
@@ -192,8 +212,19 @@ };
browserpass.enable = true;
fish_hybrid_key_bindings
enable = true;
nativeMessagingHosts.browserpass = true;
package = pkgs.librewolf;
#package = (pkgs.firefox.overrideAttrs (_: {
@@ -217,6 +248,12 @@ baseIndex = 1;
plugins = [];
extraConfig = ''
set -g status-style 'bg=#111111 fg=#FFFFFF'
set -g status-right '#(${pkgs.gitmux}/bin/gitmux "#{pane_current_path}")'
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -r f run-shell "tmux neww ${pkgs.tmux-sessionizer}/bin/tms"
bind-key -r G run-shell "${pkgs.vimPlugins.harpoon}/scripts/tmux/switch-back-to-nvim"
'';
};
@@ -226,7 +263,7 @@ dconf.enable = true; # Running GNOME programs outside of GNOME
gnupg.agent = {
enable = true;
};
};
diff --git a/scripts/.default.nix.un~ b/scripts/.default.nix.un~
new file mode 100644
index 0000000000000000000000000000000000000000..6769ffe4556123a7ec0edc440ff9ca185eb29999
Binary files /dev/null and b/scripts/.default.nix.un~ differ
diff --git a/scripts/.uploadscreen.nix.un~ b/scripts/.uploadscreen.nix.un~
new file mode 100644
index 0000000000000000000000000000000000000000..5d0991336783fa1e5877b92605a2eea58c46c799
Binary files /dev/null and b/scripts/.uploadscreen.nix.un~ differ
diff --git a/scripts/default.nix b/scripts/default.nix
new file mode 100644
index 0000000000000000000000000000000000000000..a5c3ae9731b2c855d404d34af11f48f53dd0c23b
--- /dev/null
+++ b/scripts/default.nix
@@ -0,0 +1,2 @@
+{ pkgs, ... }:
+import [ uploadscreen.nix ];
diff --git a/scripts/uploadscreen.nix b/scripts/uploadscreen.nix
new file mode 100644
index 0000000000000000000000000000000000000000..2ed88b549880303435bca30266ec8b5ca7c8c8f8
--- /dev/null
+++ b/scripts/uploadscreen.nix
@@ -0,0 +1,10 @@
+{ pkgs, ... }:
+pkgs.writeShellApplication {
+}
diff --git a/vim.nix b/vim.nix
new file mode 100644
index 0000000000000000000000000000000000000000..8d99a3f9880719fb7f39c92f863fe211aac50d3b
--- /dev/null
+++ b/vim.nix
@@ -0,0 +1,159 @@
+{ pkgs, ... }:
+let lsp = pkgs.vimUtils.buildVimPlugin {
src = pkgs.fetchFromGitHub {
owner = "yegappan";
repo = "lsp";
rev = "f5adbd10cf2fc486c5101a61ed45489a0f6b8c40";
hash = "sha256-2sGj6DF1nEzDERBxbBmeeDLJwhKhKlMWOha6AfNVb3k=";
+in {
+environment.systemPackages = [
name = "vim";
# Install plugins for example for syntax highlighting of nix files
vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
start = [ goyo-vim vim-nix vim-lastplace ];
opt = [ lsp];
};
vimrcConfig.customRC = ''
set nocompatible
syntax on
packloadall
color habamax
hi Normal ctermfg=white ctermbg=black guibg=NONE ctermbg=NONE
set nu rnu "normal and relative
set hidden
set mouse=
set clipboard^=unnamed,unnamedplus
set tabstop=4 shiftwidth=4
set scrolloff=20
set incsearch smartcase
set smartindent
" Persistend undo
set undofile
" fix pathing
set viminfofile=$HOME/.cache/viminfo
set runtimepath^=$HOME/.config/vim runtimepath+=$HOME/.config/vim/after
source ~/.config/vim/vimrc
set foldmethod=syntax foldlevel=2
filetype plugin indent on
"buffers
let c = 1
while c <= 99
execute "nnoremap " . c . "gb :" . c . "b\<CR>"
let c += 1
endwhile
nnoremap g<Tab> :e#<CR>
nnoremap gb :ls<CR>:b<Space>
" bindings
nnoremap <leader>j :bnext<CR>
nnoremap <leader>k :bprevious<CR>
nnoremap <leader>x :!chmod +x %<CR>
nnoremap <leader>e oif err != nil {<CR>}<Esc>Oreturn err<Esc>
" Replace all is aliased to S.
nnoremap S :%s//g<Left><Left>
" turn off highlight
map <leader>h :noh<CR>
" toggle spellcheck
set spelllang=en_gb,nb
map <leader>s :set spell!<CR>
" plugin bindings
" Goyo
map <leader>g :Goyo<CR>
function! s:goyo_color()
:hi Normal ctermfg=white ctermbg=black guibg=NONE ctermbg=NONE
endfunction
autocmd! ColorScheme habamax call s:goyo_color()
" Automatically deletes all trailing whitespace and newlines at end of file on save.
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritepre * %s/\n\+\%$//e
packadd vimplugin-lsp
nnoremap K :LspHover<CR>
nnoremap gd :LspGotoDefinition<CR>
nnoremap gD :LspGotoDeclaration<CR>
nnoremap gi :LspGotoImpl<CR>
nnoremap go :LspGotoTypeDef<CR>
nnoremap gr :LspShowReferences<CR>
nnoremap gs :LspShowSignature<CR>
nnoremap <F2> :LspRename<CR>
map <F3> :LspFormat<CR>
nnoremap <F4> :LspCodeAction<CR>
nnoremap gl :LspShowSignature<CR>
map <leader>z :LspFold<CR>
call LspOptionsSet(#{
\ autoHighlight: v:true,
\ autoPopulateDiags: v:true,
\ completionMatcher: 'fuzzy',
\ completionMatcherValue: 0,
\ showDiagWithVirtualText: v:true,
\ showInlayHints: v:true,
\})
call LspAddServer([#{
\ name: 'golang',
\ filetype: ['go', 'gomod'],
\ path: '${pkgs.gopls}/bin/gopls',
\ args: ['serve'],
\ syncInit: v:true
\ }])
call LspAddServer([#{
\ name: 'rustlang',
\ filetype: ['rust'],
\ path: '${pkgs.rust-analyzer}/bin/rust-analyzer',
\ args: [],
\ syncInit: v:true
\ }])
call LspAddServer([#{name: 'vimls',
\ filetype: 'vim',
\ path: '${pkgs.nodePackages.vim-language-server}/bin/vim-language-server',
\ args: ['--stdio']
\ }])
call LspAddServer([#{name: 'pylsp',
\ filetype: 'python',
\ path: '${pkgs.python311Packages.python-lsp-server}/bin/pylsp',
\ args: []
\ }])
call LspAddServer([#{name: 'luals',
\ filetype: 'lua',
\ path: '${pkgs.lua-language-server}/bin/lua-language-server',
\ args: [],
\ }])
call LspAddServer([#{name: 'clangd',
\ filetype: ['c', 'cpp'],
\ path: '${pkgs.clang-tools}/bin/clangd',
\ args: ['--background-index', '--clang-tidy']
\ }])
call LspAddServer([#{name: 'bashls',
\ filetype: 'sh',
\ path: '${pkgs.nodePackages.bash-language-server}/bin/bash-language-server',
\ args: ['start']
\ }])
call LspAddServer([#{name: 'nil',
\ filetype: 'nix',
\ path: '${pkgs.nil}/bin/nil',
\ args: []
\ }])
'';
+}
application/octet-stream;lang=en
This content has been proxied by September (3851b).