Files
nix-config/lib/colmenaSystem.nix
Ryan Yin b382999a70 refactor: Use haumea for filesystem-based module system for flake outputs
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
2024-03-10 20:12:02 +08:00

40 lines
804 B
Nix

# colmena - Remote Deployment via SSH
{
inputs,
nixos-modules,
home-module ? null,
myvars,
system,
tags,
ssh-user,
genSpecialArgs,
...
}: let
inherit (inputs) home-manager;
specialArgs = genSpecialArgs system;
in
{name, ...}: {
deployment = {
inherit tags;
targetUser = ssh-user;
targetHost = name; # hostName or IP address
};
imports =
nixos-modules
++ (
if (home-module != null)
then [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = specialArgs;
home-manager.users."${myvars.username}" = home-module;
}
]
else []
);
}