mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 21:29:12 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
149
modules-clone/home/common/zsh.nix
Normal file
149
modules-clone/home/common/zsh.nix
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
{ self, config, pkgs, lib, minimal, globals, confLib, type, arch, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) flakePath isNixos homeDir;
|
||||
crocDomain = globals.services.croc.domain;
|
||||
in
|
||||
{
|
||||
options.swarselmodules.zsh = lib.mkEnableOption "zsh settings";
|
||||
options.swarselsystems = {
|
||||
shellAliases = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.swarselmodules.zsh
|
||||
({
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
}
|
||||
// lib.optionalAttrs (!minimal) {
|
||||
shellAliases = lib.recursiveUpdate
|
||||
{
|
||||
nb = "nix build";
|
||||
nbl = "nix build --builders \"\"";
|
||||
nbo = "nix build --offline --builders \"\"";
|
||||
nd = "nix develop";
|
||||
ns = "nix shell";
|
||||
hmswitch = lib.mkIf (!isNixos) "${lib.getExe pkgs.home-manager} --flake ${flakePath}#$(hostname) switch |& nom";
|
||||
nswitch = lib.mkIf isNixos "cd ${flakePath}; swarsel-deploy $(hostname) switch; cd -;";
|
||||
ntest = lib.mkIf isNixos "cd ${flakePath}; swarsel-deploy $(hostname) test; cd -;";
|
||||
nboot = lib.mkIf isNixos "cd ${flakePath}; swarsel-deploy $(hostname) boot; cd -;";
|
||||
ndry = lib.mkIf isNixos "cd ${flakePath}; swarsel-deploy $(hostname) dry-activate; cd -;";
|
||||
magit = "emacsclient -nc -e \"(magit-status)\"";
|
||||
config = "git --git-dir=$HOME/.cfg/ --work-tree=$HOME";
|
||||
g = "git";
|
||||
c = "git --git-dir=$FLAKE/.git --work-tree=$FLAKE/";
|
||||
passpush = "cd ~/.local/share/password-store; git add .; git commit -m 'pass file changes'; git push; cd -;";
|
||||
passpull = "cd ~/.local/share/password-store; git pull; cd -;";
|
||||
hotspot = "nmcli connection up local; nmcli device wifi hotspot;";
|
||||
youtube-dl = "yt-dlp";
|
||||
cat-orig = "cat";
|
||||
# cdr = "cd \"$( (find $DOCUMENT_DIR_WORK $DOCUMENT_DIR_PRIV -maxdepth 1 && echo $FLAKE) | fzf )\"";
|
||||
cdr = "source cdr";
|
||||
nix-ldd-ldd = "LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH ldd";
|
||||
nix-ldd = "LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH ldd";
|
||||
nix-ldd-locate = "nix-locate --minimal --top-level -w ";
|
||||
nix-store-search = "ls /nix/store | grep";
|
||||
fs-diff = "sudo mount -o subvol=/ /dev/mapper/cryptroot /mnt ; fs-diff";
|
||||
lt = "eza -las modified --total-size";
|
||||
boot-diff = "nix store diff-closures /run/*-system";
|
||||
gen-diff = "nix profile diff-closures --profile /nix/var/nix/profiles/system";
|
||||
cc = "wl-copy";
|
||||
build-topology = "nix build --override-input topologyPrivate ${self}/files/topology/private ${flakePath}#topology.${arch}.config.output";
|
||||
build-topology-dev = "nix build --show-trace --override-input nix-topology ${homeDir}/Documents/Private/nix-topology --override-input topologyPrivate ${self}/files/topology/private ${flakePath}#topology.${arch}.config.output";
|
||||
build-iso = "nix build --print-out-paths .#live-iso";
|
||||
nix-review-local = "nix run nixpkgs#nixpkgs-review -- rev HEAD";
|
||||
nix-review-post = "nix run nixpkgs#nixpkgs-review -- pr --post-result --systems linux";
|
||||
}
|
||||
config.swarselsystems.shellAliases;
|
||||
autosuggestion.enable = true;
|
||||
enableCompletion = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
autocd = false;
|
||||
cdpath = [
|
||||
"~/.dotfiles"
|
||||
# "~/Documents/GitHub"
|
||||
];
|
||||
defaultKeymap = "emacs";
|
||||
dirHashes = {
|
||||
dl = "$HOME/Downloads";
|
||||
gh = "$HOME/Documents/GitHub";
|
||||
};
|
||||
history = {
|
||||
expireDuplicatesFirst = true;
|
||||
append = true;
|
||||
ignoreSpace = true;
|
||||
ignoreDups = true;
|
||||
path = "${config.home.homeDirectory}/.histfile";
|
||||
save = 100000;
|
||||
size = 100000;
|
||||
};
|
||||
historySubstringSearch = {
|
||||
enable = true;
|
||||
searchDownKey = "^[OB";
|
||||
searchUpKey = "^[OA";
|
||||
};
|
||||
plugins = [
|
||||
# {
|
||||
# name = "fzf-tab";
|
||||
# src = pkgs.zsh-fzf-tab;
|
||||
# }
|
||||
];
|
||||
initContent = ''
|
||||
my-forward-word() {
|
||||
local WORDCHARS=$WORDCHARS
|
||||
WORDCHARS="''${WORDCHARS//:}"
|
||||
WORDCHARS="''${WORDCHARS//\/}"
|
||||
WORDCHARS="''${WORDCHARS//.}"
|
||||
zle forward-word
|
||||
}
|
||||
zle -N my-forward-word
|
||||
# ctrl + right
|
||||
bindkey "^[[1;5C" my-forward-word
|
||||
|
||||
# shift + right
|
||||
bindkey "^[[1;2C" forward-word
|
||||
|
||||
my-backward-word() {
|
||||
local WORDCHARS=$WORDCHARS
|
||||
WORDCHARS="''${WORDCHARS//:}"
|
||||
WORDCHARS="''${WORDCHARS//\/}"
|
||||
WORDCHARS="''${WORDCHARS//.}"
|
||||
zle backward-word
|
||||
}
|
||||
zle -N my-backward-word
|
||||
# ctrl + left
|
||||
bindkey "^[[1;5D" my-backward-word
|
||||
|
||||
# shift + left
|
||||
bindkey "^[[1;2D" backward-word
|
||||
|
||||
my-backward-delete-word() {
|
||||
local WORDCHARS=$WORDCHARS
|
||||
WORDCHARS="''${WORDCHARS//:}"
|
||||
WORDCHARS="''${WORDCHARS//\/}"
|
||||
WORDCHARS="''${WORDCHARS//.}"
|
||||
zle backward-delete-word
|
||||
}
|
||||
zle -N my-backward-delete-word
|
||||
# ctrl + del
|
||||
bindkey '^H' my-backward-delete-word
|
||||
'';
|
||||
sessionVariables = lib.mkIf (!config.swarselsystems.isPublic) {
|
||||
CROC_RELAY = crocDomain;
|
||||
CROC_PASS = "$(cat ${confLib.getConfig.sops.secrets.croc-password.path or ""})";
|
||||
GITHUB_TOKEN = "$(cat ${confLib.getConfig.sops.secrets.github-nixpkgs-review-token.path or ""})";
|
||||
QT_QPA_PLATFORM_PLUGIN_PATH = "${pkgs.libsForQt5.qt5.qtbase.bin}/lib/qt-${pkgs.libsForQt5.qt5.qtbase.version}/plugins";
|
||||
# QTWEBENGINE_CHROMIUM_FLAGS = "--no-sandbox";
|
||||
};
|
||||
};
|
||||
} // lib.optionalAttrs (type != "nixos") {
|
||||
|
||||
sops.secrets = lib.mkIf (!config.swarselsystems.isPublic) {
|
||||
croc-password = { };
|
||||
github-nixpkgs-review-token = { };
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue