test-nix update
This commit is contained in:
@@ -1,36 +1,40 @@
|
|||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
let
|
let
|
||||||
name = "test-nix";
|
|
||||||
username = "john";
|
username = "john";
|
||||||
|
hostname = "test-nix";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.nixos."${name}" = { pkgs, lib, ...}: {
|
flake.modules.nixos."${hostname}" = { pkgs, lib, ...}: {
|
||||||
networking.hostName = "${name}";
|
networking.hostName = "${hostname}";
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# require public key authentication for better security
|
# require public key authentication for better security
|
||||||
settings.PasswordAuthentication = false;
|
settings.PasswordAuthentication = false;
|
||||||
settings.KbdInteractiveAuthentication = false;
|
settings.KbdInteractiveAuthentication = false;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.docker = {
|
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
|
||||||
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 {
|
|
||||||
modules = [
|
modules = [
|
||||||
inputs.self.modules.nixos.lxc
|
inputs.self.modules.nixos.lxc
|
||||||
|
inputs.self.modules.nixos.zsh
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.self.modules.nixos."${name}"
|
inputs.self.modules.nixos."${username}"
|
||||||
inputs.self.modules.nixos.john
|
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