mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 14:28:02 +03:00
nu
This commit is contained in:
4 files changed
+127
-28
No files matched your search
@@ -1,12 +1,16 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
flake.homeModules.home-nushell-commandline-copy =
|
flake.homeModules.home-nushell-commandline-copy =
|
||||||
{ ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib.meta) getExe';
|
||||||
|
wlCopy = getExe' pkgs.wl-clipboard "wl-copy";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
programs.nushell.extraConfig = ''
|
home.packages = [ pkgs.wl-clipboard ];
|
||||||
use std/clip
|
|
||||||
def nu-highlight-default [] {
|
|
||||||
|
|
||||||
|
programs.nushell.extraConfig = ''
|
||||||
|
def nu-highlight-default [] {
|
||||||
let input = $in
|
let input = $in
|
||||||
$env.config.color_config = {}
|
$env.config.color_config = {}
|
||||||
$input | nu-highlight
|
$input | nu-highlight
|
||||||
@@ -17,7 +21,7 @@
|
|||||||
| nu-highlight-default
|
| nu-highlight-default
|
||||||
| [ "```ansi" $in "```" ]
|
| [ "```ansi" $in "```" ]
|
||||||
| str join (char nl)
|
| str join (char nl)
|
||||||
| clip copy --ansi
|
| ^${wlCopy}
|
||||||
}
|
}
|
||||||
|
|
||||||
$env.config.keybindings ++= [
|
$env.config.keybindings ++= [
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
flake.homeModules.home-nushell-keybinds =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nushell.extraConfig = ''
|
||||||
|
$env.config.keybindings ++= [
|
||||||
|
{
|
||||||
|
name: jj_status
|
||||||
|
modifier: control
|
||||||
|
keycode: char_g
|
||||||
|
mode: [ emacs vi_insert vi_normal ]
|
||||||
|
event: { send: executehostcommand, cmd: "jj status" }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name: jj_log
|
||||||
|
modifier: alt
|
||||||
|
keycode: char_l
|
||||||
|
mode: [ emacs vi_insert vi_normal ]
|
||||||
|
event: { send: executehostcommand, cmd: "jj log" }
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name: jj_diff
|
||||||
|
modifier: alt
|
||||||
|
keycode: char_d
|
||||||
|
mode: [ emacs vi_insert vi_normal ]
|
||||||
|
event: { send: executehostcommand, cmd: "jj diff" }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -11,19 +11,38 @@
|
|||||||
ll = "eza -lah --icons --group-directories-first";
|
ll = "eza -lah --icons --group-directories-first";
|
||||||
la = "eza -a --icons --group-directories-first";
|
la = "eza -a --icons --group-directories-first";
|
||||||
lt = "eza --tree --level=2 --icons";
|
lt = "eza --tree --level=2 --icons";
|
||||||
|
tree = "eza --tree --git-ignore --group-directories-first";
|
||||||
|
|
||||||
cat = "bat";
|
cat = "bat";
|
||||||
df = "df -h";
|
df = "^df -h";
|
||||||
du = "du -h";
|
du = "^du -h";
|
||||||
free = "free -h";
|
free = "^free -h";
|
||||||
rm = "trash-put";
|
rm = "trash-put";
|
||||||
|
|
||||||
sysinfo = "fastfetch";
|
sysinfo = "fastfetch";
|
||||||
monitor = "sudo btop";
|
monitor = "sudo btop";
|
||||||
ports = "sudo ss -tulpn";
|
ports = "sudo ss -tulpn";
|
||||||
myip = "curl ifconfig.me";
|
myip = "curl ifconfig.me";
|
||||||
|
|
||||||
|
js = "jj status";
|
||||||
|
jl = "jj log";
|
||||||
|
jd = "jj diff";
|
||||||
|
jc = "jj commit";
|
||||||
|
jp = "jj git push";
|
||||||
|
jf = "jj git fetch";
|
||||||
|
|
||||||
gs = "git status";
|
gs = "git status";
|
||||||
ga = "git add";
|
ga = "git add";
|
||||||
gp = "git push";
|
gp = "git push";
|
||||||
gl = "git log --oneline --graph --decorate";
|
gl = "git log --oneline --graph --decorate";
|
||||||
|
|
||||||
|
#gnu
|
||||||
|
gfind = "^find";
|
||||||
|
ggrep = "^grep --color=auto";
|
||||||
|
gls = "^ls";
|
||||||
|
gdu = "^du";
|
||||||
|
gmkdir = "^mkdir";
|
||||||
|
|
||||||
".." = "cd ..";
|
".." = "cd ..";
|
||||||
"..." = "cd ../..";
|
"..." = "cd ../..";
|
||||||
"...." = "cd ../../..";
|
"...." = "cd ../../..";
|
||||||
@@ -32,6 +51,8 @@
|
|||||||
environmentVariables = {
|
environmentVariables = {
|
||||||
MESA_SHADER_CACHE_MAX_SIZE = "2G";
|
MESA_SHADER_CACHE_MAX_SIZE = "2G";
|
||||||
MESA_SHADER_CACHE_DIR = "/tmp/mesa_shader_cache";
|
MESA_SHADER_CACHE_DIR = "/tmp/mesa_shader_cache";
|
||||||
|
FZF_DEFAULT_OPTS = "--height 40% --layout=reverse --border";
|
||||||
|
FZF_DEFAULT_COMMAND = "fd --type f --hidden --follow --exclude .git";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraEnv = ''
|
extraEnv = ''
|
||||||
@@ -40,32 +61,73 @@
|
|||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
$env.config.show_banner = false
|
$env.config.show_banner = false
|
||||||
def gc [msg: string] { git commit -m $msg }
|
$env.config.history.file_format = "sqlite"
|
||||||
def rebuild [] {
|
$env.config.history.max_size = 1_000_000
|
||||||
git -C ~/copland add -A
|
$env.config.history.isolation = false
|
||||||
git -C ~/copland commit -m "update"
|
|
||||||
nh os switch
|
$env.config.edit_mode = "vi"
|
||||||
|
$env.config.cursor_shape.vi_insert = "line"
|
||||||
|
$env.config.cursor_shape.vi_normal = "block"
|
||||||
|
|
||||||
|
$env.config.completions.algorithm = "substring"
|
||||||
|
$env.config.highlight_resolved_externals = true
|
||||||
|
|
||||||
|
def --env mc [path: path] {
|
||||||
|
mkdir $path
|
||||||
|
cd $path
|
||||||
}
|
}
|
||||||
|
|
||||||
def rebuild-dry [] { nh os switch --dry }
|
def --env mcg [path: path] {
|
||||||
def rebuild-cop [] {
|
mkdir $path
|
||||||
|
cd $path
|
||||||
|
jj git init --colocate
|
||||||
|
}
|
||||||
|
|
||||||
|
def rebuild [] {
|
||||||
|
jj --repository ~/copland status | ignore
|
||||||
|
nh os switch --accept-flake-config
|
||||||
|
}
|
||||||
|
|
||||||
|
def rebuild-dry [] {
|
||||||
|
nh os switch --dry --accept-flake-config
|
||||||
|
}
|
||||||
|
|
||||||
|
def rebuild-up [] {
|
||||||
nix flake update --flake ~/copland
|
nix flake update --flake ~/copland
|
||||||
git -C ~/copland add -A
|
jj --repository ~/copland status | ignore
|
||||||
git -C ~/copland commit -m $"flake update (date now | format date '%Y-%m-%d')"
|
nh os switch --accept-flake-config
|
||||||
nh os switch
|
|
||||||
}
|
}
|
||||||
def extract [file: string] {
|
|
||||||
let ext = ($file | path parse | get extension)
|
def extract [file: path] {
|
||||||
match $ext {
|
let name = ($file | path basename)
|
||||||
"gz" => { tar xzf $file },
|
match $name {
|
||||||
"bz2" => { tar xjf $file },
|
_ if ($name | str ends-with ".tar.bz2") => { ^tar xjf $file }
|
||||||
"tar" => { tar xf $file },
|
_ if ($name | str ends-with ".tar.gz") => { ^tar xzf $file }
|
||||||
"zip" => { unzip $file },
|
_ if ($name | str ends-with ".tar.xz") => { ^tar xJf $file }
|
||||||
"7z" => { 7z x $file },
|
_ if ($name | str ends-with ".tar") => { ^tar xf $file }
|
||||||
"rar" => { unrar e $file },
|
_ if ($name | str ends-with ".bz2") => { ^bunzip2 $file }
|
||||||
_ => { print $"'($file)' can't be extracted" }
|
_ if ($name | str ends-with ".gz") => { ^gunzip $file }
|
||||||
|
_ if ($name | str ends-with ".zip") => { ^unzip $file }
|
||||||
|
_ if ($name | str ends-with ".7z") => { ^7z x $file }
|
||||||
|
_ if ($name | str ends-with ".rar") => { ^unrar e $file }
|
||||||
|
_ => { print $"(ansi red)'($name)' açılamıyor(ansi reset)" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# `which`, with canonicalize .
|
||||||
|
def realwhich [...applications: string, --all (-a)] {
|
||||||
|
which --all=$all ...$applications
|
||||||
|
| update path {|row|
|
||||||
|
match $row.type {
|
||||||
|
"external" => { $row.path | path expand }
|
||||||
|
_ => $row.path
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($"($env.HOME)/.config/copetch/animated-copetch.sh" | path exists) {
|
||||||
|
^$"($env.HOME)/.config/copetch/animated-copetch.sh"
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
programs.zoxide = {
|
programs.zoxide = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableNushellIntegration = true;
|
enableNushellIntegration = true;
|
||||||
|
options = [ "--cmd cd" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user