重构个人配置结构

This commit is contained in:
2026-05-17 10:24:49 +08:00
parent 5072597827
commit 658910097b
10 changed files with 37 additions and 71 deletions
+15 -2
View File
@@ -1,6 +1,19 @@
# 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
```
-4
View File
@@ -21,8 +21,4 @@
ltrace # library call monitoring
lsof # list open files
];
programs.fish.shellAliases = {
"flake-update" = "nixos-rebuild switch --use-remote-sudo --flake ${config.home.homeDirectory}/flakes#eris";
};
}
-1
View File
@@ -22,7 +22,6 @@
];
programs.zsh.shellAliases = {
"hm-update" = "home-manager switch --flake ${config.home.homeDirectory}/flakes#origami@hypnos";
"brew" = "/opt/homebrew/bin/brew";
"tailscale" = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
};
-4
View File
@@ -10,8 +10,4 @@
../modules/shell-develop.nix
../modules/ssh.nix
];
programs.fish.shellAliases = {
"flake-update" = "nixos-rebuild switch --use-remote-sudo --flake ${config.home.homeDirectory}/flakes#oparic-local-dev";
};
}
+1 -8
View File
@@ -5,15 +5,8 @@
clang-tools
python312
python312Packages.ipython
direnv
];
programs.fish.shellAliases = {
"ipy" = "ipython --no-confirm-exit";
};
programs.direnv.enable = true;
programs.fish.shellInit = ''
direnv hook fish | source
'';
programs.git = {
enable = true;
-42
View File
@@ -13,7 +13,6 @@
btop # better top
procs # better ps
scc # better cloc
btop # better top
grc # log file colorize
fastfetch # show off
mtr # better traceroute
@@ -22,45 +21,4 @@
socat # better netcat
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 -6
View File
@@ -1,11 +1,6 @@
{ lib, pkgs, ... }:
{
programs.zsh = {
enable = true;
# enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
};
programs.zsh.enable = true;
home.shell.enableZshIntegration = true;
home.file =
+16
View File
@@ -1,5 +1,21 @@
#!/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() {
local src_file="$1"
local yaml_file="$2"
+1 -1
View File
@@ -10,7 +10,7 @@
networking.hostName = "hypnos";
time.timeZone = "Asia/Shanghai";
programs.fish.enable = true;
programs.zsh.enable = true;
users.users.origami = {
home = "/Users/origami";
+3 -3
View File
@@ -1,9 +1,9 @@
{ pkgs, ... }:
{
...
}:
{
programs.zsh.enable = true;
users.users.origami = {
isNormalUser = true;
shell = pkgs.zsh;
description = "Origami404";
group = "origami";
openssh.authorizedKeys.keys = [