[hypnos] 重构 home 下 dotfiles 独立目录结构

This commit is contained in:
2026-01-23 01:20:06 +08:00
parent 2f31fbcd6e
commit 91a6a981c2
14 changed files with 47 additions and 12 deletions
+22
View File
@@ -0,0 +1,22 @@
{ hmSource, npLib }:
let
standaloneRoot = ../standalone;
baseLib = import "${hmSource}/modules/lib/stdlib-extended.nix" npLib;
in
baseLib.extend (final: prev: {
origami404 = (prev.origami404 or { }) // {
standaloneToHome = arg:
let
rel = if prev.isString arg then arg else arg.rel;
realpath = if prev.isString arg then rel else (arg.realpath or rel);
src = standaloneRoot + "/${rel}";
isDir = prev.filesystem.pathIsDirectory src;
in
{
"${realpath}" = {
source = src;
recursive = isDir;
};
};
};
})
+1 -4
View File
@@ -5,10 +5,7 @@
defaultSopsFile = ../../secrets/ssh-config.yaml;
};
home.file.".ssh" = {
source = ./ssh;
recursive = true;
};
home.file = lib.origami404.standaloneToHome ".ssh";
home.activation.sshDirPerms = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if [ -d "$HOME/.ssh" ]; then
+3 -5
View File
@@ -8,10 +8,8 @@
};
home.shell.enableZshIntegration = true;
home.file.".zsh.d" = {
source = ./zsh/.zsh.d;
recursive = true;
};
home.file.".zshrc.o4".source = ./zsh/.zshrc;
home.file =
(lib.origami404.standaloneToHome ".zsh.d")
// (lib.origami404.standaloneToHome { rel = ".zshrc"; realpath = ".zshrc.o4"; });
programs.zsh.initContent = "source $HOME/.zshrc.o4";
}