重构个人配置结构
This commit is contained in:
@@ -1,6 +1,19 @@
|
|||||||
# Origami404's flakes
|
# Origami404's flakes
|
||||||
|
|
||||||
Please check out [inclyc/flakes](https://github.com/inclyc/flakes), his repo is certainly more `__attribute__((pure))`-er than mine!
|
参考: [inclyc/flakes](https://github.com/inclyc/flakes).
|
||||||
|
|
||||||
请立刻查看 [inclyc/flakes](https://github.com/inclyc/flakes), 他的比我的 `__attribute__((pure))` 多了.
|
系统更新:
|
||||||
|
```bash
|
||||||
|
o4-nixos-switch
|
||||||
|
```
|
||||||
|
|
||||||
|
用户配置更新:
|
||||||
|
```bash
|
||||||
|
o4-home-switch
|
||||||
|
```
|
||||||
|
|
||||||
|
包更新:
|
||||||
|
```bash
|
||||||
|
nix flake update
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,4 @@
|
|||||||
ltrace # library call monitoring
|
ltrace # library call monitoring
|
||||||
lsof # list open files
|
lsof # list open files
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.fish.shellAliases = {
|
|
||||||
"flake-update" = "nixos-rebuild switch --use-remote-sudo --flake ${config.home.homeDirectory}/flakes#eris";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
programs.zsh.shellAliases = {
|
programs.zsh.shellAliases = {
|
||||||
"hm-update" = "home-manager switch --flake ${config.home.homeDirectory}/flakes#origami@hypnos";
|
|
||||||
"brew" = "/opt/homebrew/bin/brew";
|
"brew" = "/opt/homebrew/bin/brew";
|
||||||
"tailscale" = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
"tailscale" = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,8 +10,4 @@
|
|||||||
../modules/shell-develop.nix
|
../modules/shell-develop.nix
|
||||||
../modules/ssh.nix
|
../modules/ssh.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.fish.shellAliases = {
|
|
||||||
"flake-update" = "nixos-rebuild switch --use-remote-sudo --flake ${config.home.homeDirectory}/flakes#oparic-local-dev";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,15 +5,8 @@
|
|||||||
clang-tools
|
clang-tools
|
||||||
python312
|
python312
|
||||||
python312Packages.ipython
|
python312Packages.ipython
|
||||||
|
direnv
|
||||||
];
|
];
|
||||||
programs.fish.shellAliases = {
|
|
||||||
"ipy" = "ipython --no-confirm-exit";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.direnv.enable = true;
|
|
||||||
programs.fish.shellInit = ''
|
|
||||||
direnv hook fish | source
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
btop # better top
|
btop # better top
|
||||||
procs # better ps
|
procs # better ps
|
||||||
scc # better cloc
|
scc # better cloc
|
||||||
btop # better top
|
|
||||||
grc # log file colorize
|
grc # log file colorize
|
||||||
fastfetch # show off
|
fastfetch # show off
|
||||||
mtr # better traceroute
|
mtr # better traceroute
|
||||||
@@ -22,45 +21,4 @@
|
|||||||
socat # better netcat
|
socat # better netcat
|
||||||
nmap
|
nmap
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.nix-index.enableFishIntegration = true;
|
|
||||||
programs.fzf.enableFishIntegration = false; # use fish.fzf keybinding
|
|
||||||
programs.fish = {
|
|
||||||
enable = true;
|
|
||||||
interactiveShellInit = ''
|
|
||||||
set fish_greeting # Disable greeting
|
|
||||||
'';
|
|
||||||
plugins = with pkgs.fishPlugins; [
|
|
||||||
{ name = "z"; src = z.src; }
|
|
||||||
{ name = "grc"; src = grc.src; }
|
|
||||||
{ name = "fzf-fish"; src = fzf-fish.src; }
|
|
||||||
{ name = "autopair"; src = autopair.src; }
|
|
||||||
{ name = "colored-man-pages"; src = colored-man-pages.src; }
|
|
||||||
];
|
|
||||||
shellInit = ''
|
|
||||||
fzf_configure_bindings --directory=\cp --git_log=\cl --history=\cr \
|
|
||||||
--git_status= --processes= --variables=
|
|
||||||
'';
|
|
||||||
shellAbbrs = {
|
|
||||||
"..." = "../..";
|
|
||||||
"...." = "../../..";
|
|
||||||
};
|
|
||||||
shellAliases = {
|
|
||||||
"ls" = "eza";
|
|
||||||
"ll" = "eza -l";
|
|
||||||
"la" = "eza -a";
|
|
||||||
"grep" = "rg";
|
|
||||||
"top" = "btop";
|
|
||||||
"dig" = "q";
|
|
||||||
"nc" = "socat";
|
|
||||||
"netcat" = "socat";
|
|
||||||
"find" = "fd";
|
|
||||||
"du" = "dust";
|
|
||||||
"df" = "duf";
|
|
||||||
"cloc" = "scc";
|
|
||||||
# "cat" = "bat";
|
|
||||||
"x" = "atool -x";
|
|
||||||
"cl" = "clear";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
{ lib, pkgs, ... }:
|
{ lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
programs.zsh = {
|
programs.zsh.enable = true;
|
||||||
enable = true;
|
|
||||||
# enableCompletion = true;
|
|
||||||
autosuggestion.enable = true;
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
};
|
|
||||||
home.shell.enableZshIntegration = true;
|
home.shell.enableZshIntegration = true;
|
||||||
|
|
||||||
home.file =
|
home.file =
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
if command -v direnv &> /dev/null; then
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
o4-nixos-switch() {
|
||||||
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
|
darwin-rebuild switch --flake ~/flakes#$(hostname)
|
||||||
|
else
|
||||||
|
nixos-rebuild switch --use-remote-sudo --flake ~/flakes#$(hostname)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
o4-home-switch() {
|
||||||
|
home-manager switch --flake ~/flakes#$(whoami)@$(hostname)
|
||||||
|
}
|
||||||
|
|
||||||
sops-update-file() {
|
sops-update-file() {
|
||||||
local src_file="$1"
|
local src_file="$1"
|
||||||
local yaml_file="$2"
|
local yaml_file="$2"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
networking.hostName = "hypnos";
|
networking.hostName = "hypnos";
|
||||||
time.timeZone = "Asia/Shanghai";
|
time.timeZone = "Asia/Shanghai";
|
||||||
|
|
||||||
programs.fish.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
users.users.origami = {
|
users.users.origami = {
|
||||||
home = "/Users/origami";
|
home = "/Users/origami";
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
...
|
programs.zsh.enable = true;
|
||||||
}:
|
|
||||||
{
|
|
||||||
users.users.origami = {
|
users.users.origami = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
shell = pkgs.zsh;
|
||||||
description = "Origami404";
|
description = "Origami404";
|
||||||
group = "origami";
|
group = "origami";
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
|
|||||||
Reference in New Issue
Block a user