mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-02-23 16:34:48 +01:00
refactor: Use hyphen(`-`) for variable names & folder names(except Python), replace all unserscore(`_`) with hyphen(`-`).
40 lines
804 B
Nix
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 []
|
|
);
|
|
}
|