test-nix update
This commit is contained in:
@@ -1,36 +1,40 @@
|
||||
{ inputs, ... }:
|
||||
let
|
||||
name = "test-nix";
|
||||
username = "john";
|
||||
hostname = "test-nix";
|
||||
in
|
||||
{
|
||||
flake.modules.nixos."${name}" = { pkgs, lib, ...}: {
|
||||
networking.hostName = "${name}";
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
};
|
||||
home-manager.users."${username}" = {
|
||||
docker.enable = true;
|
||||
};
|
||||
users.users.john = {
|
||||
extraGroups = [ "docker" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Generic bootstrapping lxc, use a specific host file for more
|
||||
flake.nixosConfigurations."${name}" = inputs.nixpkgs.lib.nixosSystem {
|
||||
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
inputs.self.modules.nixos.lxc
|
||||
inputs.self.modules.nixos.zsh
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.self.modules.nixos."${name}"
|
||||
inputs.self.modules.nixos.john
|
||||
inputs.self.modules.nixos."${username}"
|
||||
inputs.self.modules.nixos.docker
|
||||
{
|
||||
users.users."${username}" = {
|
||||
extraGroups = [ "docker" ];
|
||||
};
|
||||
|
||||
home-manager.users."${username}" = {
|
||||
shell.program = "zsh";
|
||||
docker.enable = true;
|
||||
ssh.matchSets = {
|
||||
certs = true;
|
||||
homelab = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user