[hypnos] 重构 home 下 dotfiles 独立目录结构
This commit is contained in:
@@ -48,7 +48,13 @@
|
|||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
./home/hosts/eris.nix
|
./home/hosts/eris.nix
|
||||||
];
|
];
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
lib = import ./home/lib/origami404.nix {
|
||||||
|
hmSource = inputs.home-manager;
|
||||||
|
npLib = nixpkgs-linux.lib;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
"origami@metis" = home-manager.lib.homeManagerConfiguration {
|
"origami@metis" = home-manager.lib.homeManagerConfiguration {
|
||||||
@@ -58,7 +64,13 @@
|
|||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
./home/hosts/metis.nix
|
./home/hosts/metis.nix
|
||||||
];
|
];
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
lib = import ./home/lib/origami404.nix {
|
||||||
|
hmSource = inputs.home-manager;
|
||||||
|
npLib = nixpkgs-linux.lib;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
"origami@hypnos" = home-manager-darwin.lib.homeManagerConfiguration {
|
"origami@hypnos" = home-manager-darwin.lib.homeManagerConfiguration {
|
||||||
@@ -68,7 +80,13 @@
|
|||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
./home/hosts/hypnos.nix
|
./home/hosts/hypnos.nix
|
||||||
];
|
];
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
lib = import ./home/lib/origami404.nix {
|
||||||
|
hmSource = inputs.home-manager-darwin;
|
||||||
|
npLib = nixpkgs-darwin.lib;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
@@ -5,10 +5,7 @@
|
|||||||
defaultSopsFile = ../../secrets/ssh-config.yaml;
|
defaultSopsFile = ../../secrets/ssh-config.yaml;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file.".ssh" = {
|
home.file = lib.origami404.standaloneToHome ".ssh";
|
||||||
source = ./ssh;
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home.activation.sshDirPerms = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.sshDirPerms = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
if [ -d "$HOME/.ssh" ]; then
|
if [ -d "$HOME/.ssh" ]; then
|
||||||
|
|||||||
@@ -8,10 +8,8 @@
|
|||||||
};
|
};
|
||||||
home.shell.enableZshIntegration = true;
|
home.shell.enableZshIntegration = true;
|
||||||
|
|
||||||
home.file.".zsh.d" = {
|
home.file =
|
||||||
source = ./zsh/.zsh.d;
|
(lib.origami404.standaloneToHome ".zsh.d")
|
||||||
recursive = true;
|
// (lib.origami404.standaloneToHome { rel = ".zshrc"; realpath = ".zshrc.o4"; });
|
||||||
};
|
|
||||||
home.file.".zshrc.o4".source = ./zsh/.zshrc;
|
|
||||||
programs.zsh.initContent = "source $HOME/.zshrc.o4";
|
programs.zsh.initContent = "source $HOME/.zshrc.o4";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user