mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-01-18 07:36:37 +01:00
47 lines
1.0 KiB
Nix
47 lines
1.0 KiB
Nix
# colmena - Remote Deployment via SSH
|
|
{
|
|
nixpkgs,
|
|
home-manager,
|
|
specialArgs,
|
|
nixos-modules,
|
|
home-module ? null,
|
|
host_tags,
|
|
targetUser ? specialArgs.username,
|
|
}: let
|
|
inherit (specialArgs) username;
|
|
in
|
|
{
|
|
name,
|
|
...
|
|
}: {
|
|
deployment = {
|
|
inherit targetUser;
|
|
targetHost = name; # hostName or IP address
|
|
tags = host_tags;
|
|
};
|
|
|
|
imports =
|
|
nixos-modules
|
|
++ [
|
|
{
|
|
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
nix.channel.enable = false; # disable nix-channel, we use flakes instead.
|
|
}
|
|
]
|
|
++ (
|
|
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."${username}" = home-module;
|
|
}
|
|
]
|
|
else []
|
|
);
|
|
}
|