Updated mosquitto and formatted files

This commit is contained in:
Vivian 2021-10-25 12:50:04 +02:00
parent 846e8dbafc
commit ce8a5a76f5
15 changed files with 116 additions and 145 deletions

View file

@ -5,14 +5,13 @@
{ config, pkgs, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
# Import common config
../../common/generic-vm.nix
../../common
];
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
# Import common config
../../common/generic-vm.nix
../../common
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
@ -36,13 +35,14 @@
kubectl
kubectx
nodejs-14_x
nixfmt
ripgrep
rsync
tmux
vault
vim
];
#
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "curses";

View file

@ -4,23 +4,18 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/profiles/qemu-guest.nix")
];
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/e8427097-8545-4924-b033-2659fcf9adca";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/e8427097-8545-4924-b033-2659fcf9adca";
fsType = "ext4";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/63d90b92-cdde-4795-a3ab-9566ae88f43d"; }];
swapDevices = [{ device = "/dev/disk/by-uuid/63d90b92-cdde-4795-a3ab-9566ae88f43d"; }];
}

View file

@ -1,13 +1,11 @@
{ config, pkgs, lib, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
# Import common config
../../common/generic-vm.nix
../../common
];
{ config, pkgs, lib, ... }: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
# Import common config
../../common/generic-vm.nix
../../common
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
@ -25,10 +23,7 @@
system.stateVersion = "21.05"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [
iptables
vim
];
environment.systemPackages = with pkgs; [ iptables vim ];
# Disable the firewall as we need all the ports
networking.firewall.enable = false;

View file

@ -4,23 +4,18 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/profiles/qemu-guest.nix")
];
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/e8427097-8545-4924-b033-2659fcf9adca";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/e8427097-8545-4924-b033-2659fcf9adca";
fsType = "ext4";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/63d90b92-cdde-4795-a3ab-9566ae88f43d"; }];
swapDevices = [{ device = "/dev/disk/by-uuid/63d90b92-cdde-4795-a3ab-9566ae88f43d"; }];
}

View file

@ -3,14 +3,13 @@
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports =
[
# Import common config
../../common/generic-lxc.nix
../../common
];
let mosquittoPort = 1883;
in {
imports = [
# Import common config
../../common/generic-lxc.nix
../../common
];
networking.hostName = "mosquitto";
@ -23,24 +22,22 @@
system.stateVersion = "21.05"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [];
environment.systemPackages = with pkgs; [ ];
services.mosquitto = {
users = {
victor = {
acl = ["topic readwrite #"];
};
zigbee2mqtt = {
acl = ["topic readwrite #"];
};
};
enable = true;
port = 1883;
host = "0.0.0.0";
allowAnonymous = true;
aclExtraConf = "topic readwrite #";
listeners = [{
port = 1883;
settings.allow_anonymous = true;
acl = [ "topic readwrite #" ];
users = {
victor = { acl = [ "readwrite #" ]; };
zigbee2mqtt = { acl = [ "readwrite #" ]; };
};
}];
};
services.zigbee2mqtt = {
@ -50,17 +47,17 @@
homeassistant = true;
permit_join = true;
serial = {
port = "/dev/ttyUSB0";
};
serial = { port = "/dev/ttyUSB0"; };
mqtt = {
base_topic = "zigbee2mqtt";
server = "mqtt://localhost:${toString config.services.mosquitto.port}";
server = "mqtt://localhost:${toString mosquittoPort}";
user = "zigbee2mqtt";
};
frontend = { port = 8080; };
};
};
networking.firewall.allowedTCPPorts = [ config.services.mosquitto.port ];
networking.firewall.allowedTCPPorts = [ mosquittoPort config.services.zigbee2mqtt.settings.frontend.port ];
}

View file

@ -5,13 +5,11 @@
{ config, pkgs, ... }:
{
imports =
[
# Import common config
../../common/generic-lxc.nix
../../common
];
imports = [
# Import common config
../../common/generic-lxc.nix
../../common
];
networking.hostName = "nginx";
@ -24,7 +22,7 @@
system.stateVersion = "21.05"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [];
environment.systemPackages = with pkgs; [ ];
networking.firewall.allowedTCPPorts = [ 80 443 ];
@ -41,6 +39,15 @@
proxyWebsockets = true;
};
};
virtualHosts."zookeeper.0x76.dev" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://10.42.43.28:8085/";
proxyWebsockets = true;
};
};
};
security.acme.email = "victorheld12@gmail.com";

View file

@ -5,13 +5,11 @@
{ config, pkgs, ... }:
{
imports =
[
# Import common config
../../common/generic-lxc.nix
../../common
];
imports = [
# Import common config
../../common/generic-lxc.nix
../../common
];
networking.hostName = "vault";
@ -24,7 +22,7 @@
system.stateVersion = "21.05"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [];
environment.systemPackages = with pkgs; [ ];
# Vault
networking.firewall.allowedTCPPorts = [ 8200 ];