Files
dendritic/modules/hosts/test-nix.nix
2026-03-12 12:25:58 -05:00

45 lines
1.1 KiB
Nix

{ inputs, ... }:
let
username = "john";
hostname = "test-nix";
in
{
flake.modules.nixos."${hostname}" = { pkgs, lib, ...}: {
networking.hostName = "${hostname}";
services.openssh = {
enable = true;
# require public key authentication for better security
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
};
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
modules = with inputs.self.modules; [
inputs.home-manager.nixosModules.home-manager
nixos."${username}"
nixos.lxc
nixos.sudo
nixos.zsh
nixos.docker
{
users.users."${username}" = {
extraGroups = [ "docker" ];
};
home-manager.users."${username}" = {
imports = with inputs.self.modules.homeManager; [
step-client
];
shell.program = "zsh";
docker.enable = true;
ssh.matchSets = {
certs = true;
homelab = true;
};
};
}
];
};
}