Nix fmt rfc style (more or less)

This commit is contained in:
Filippo Berto 2024-08-13 12:22:23 +02:00
parent e7496c447a
commit 515f098644
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
146 changed files with 2607 additions and 906 deletions

View file

@ -5,16 +5,28 @@ in
{
age.secrets = {
ntfy-loki = { file = ../../secrets/ntfy-loki.age; owner = "bertof"; };
ntfy-loki = {
file = ../../secrets/ntfy-loki.age;
owner = "bertof";
};
};
boot = {
binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ];
binfmt.emulatedSystems = [
"armv7l-linux"
"aarch64-linux"
];
# kernelPackages = pkgs.linuxPackages_latest;
loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; };
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
console = { font = "Lat2-Terminus16"; keyMap = "it"; };
console = {
font = "Lat2-Terminus16";
keyMap = "it";
};
environment = {
pathsToLink = [ "/share/zsh" ];
@ -36,7 +48,12 @@ in
opengl = {
enable = true;
extraPackages = builtins.attrValues {
inherit (pkgs) intel-media-driver libvdpau-va-gl vaapiIntel vaapiVdpau;
inherit (pkgs)
intel-media-driver
libvdpau-va-gl
vaapiIntel
vaapiVdpau
;
};
};
@ -81,16 +98,29 @@ in
};
# bazarr = { enable = true; openFirewall = true; group = "users"; };
blueman.enable = true;
dbus = { packages = [ pkgs.dconf ]; implementation = "broker"; };
esphome = { enable = true; openFirewall = true; };
dbus = {
packages = [ pkgs.dconf ];
implementation = "broker";
};
esphome = {
enable = true;
openFirewall = true;
};
# fail2ban = { enable = true; bantime-increment.enable = true; };
gnome.gnome-keyring.enable = true;
gvfs.enable = true;
# jackett = { enable = true; openFirewall = true; group = "users"; };
jellyfin = { enable = true; openFirewall = true; group = "users"; };
jellyfin = {
enable = true;
openFirewall = true;
group = "users";
};
logind.lidSwitch = "ignore";
# node-red = { enable = true; openFirewall = true; withNpmAndGcc = true; };
openssh = { enable = true; openFirewall = true; };
openssh = {
enable = true;
openFirewall = true;
};
# plex = { enable = true; openFirewall = true; group = "users"; };
power-profiles-daemon.enable = true;
# prowlarr = { enable = true; openFirewall = true; };
@ -201,7 +231,11 @@ in
};
tiziano = {
isNormalUser = true;
extraGroups = [ "audio" "input" "video" ];
extraGroups = [
"audio"
"input"
"video"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMExwtJFk6HjySrTZwJH67SOHC3hlL28NO4oe2GXsv6k"
];
@ -241,8 +275,7 @@ in
138 # SYNCTHING
3702 # SAMBA-WSDD
];
extraCommands =
"iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
extraCommands = "iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns";
};
virtualisation = {
@ -306,9 +339,21 @@ in
assist_pipeline = { };
# bluetooth = { };
camera = [
{ platform = "local_file"; file_path = "/tmp/doods_camera_camera_cancello.jpg"; name = "File DOODS2 Camera cancello"; }
{ platform = "local_file"; file_path = "/tmp/doods_camera_camera_vialetto.jpg"; name = "File DOODS2 Camera vialetto"; }
{ platform = "local_file"; file_path = "/tmp/doods_camera_camera_garage.jpg"; name = "File DOODS2 Camera garage"; }
{
platform = "local_file";
file_path = "/tmp/doods_camera_camera_cancello.jpg";
name = "File DOODS2 Camera cancello";
}
{
platform = "local_file";
file_path = "/tmp/doods_camera_camera_vialetto.jpg";
name = "File DOODS2 Camera vialetto";
}
{
platform = "local_file";
file_path = "/tmp/doods_camera_camera_garage.jpg";
name = "File DOODS2 Camera garage";
}
];
cloud = { };
config = { };
@ -322,14 +367,30 @@ in
url = "http://localhost:8080";
detector = "default";
source = [
{ entity_id = "camera.camera_camera_cancello"; name = "DOODS2 Camera cancello"; }
{ entity_id = "camera.camera_camera_vialetto"; name = "DOODS2 Camera vialetto"; }
{ entity_id = "camera.camera_camera_garage"; name = "DOODS2 Camera garage"; }
{
entity_id = "camera.camera_camera_cancello";
name = "DOODS2 Camera cancello";
}
{
entity_id = "camera.camera_camera_vialetto";
name = "DOODS2 Camera vialetto";
}
{
entity_id = "camera.camera_camera_garage";
name = "DOODS2 Camera garage";
}
];
confidence = 60;
file_out = "/tmp/doods_{{ camera_entity.split('.')[1] }}.jpg";
scan_interval = 5;
labels = [ "bicycle" "car" "cat" "dog" "person" "truck" ];
labels = [
"bicycle"
"car"
"cat"
"dog"
"person"
"truck"
];
}
];
# esphome = { };
@ -384,11 +445,13 @@ in
# "!secret famiglia_t_chat_id"
# ];
# }];
tts = [{
platform = "google_translate";
language = "it";
# tld = "it";
}];
tts = [
{
platform = "google_translate";
language = "it";
# tld = "it";
}
];
};
configDir = "/var/lib/hass";
configWritable = true;
@ -473,21 +536,44 @@ in
services.prometheus = {
enable = true;
exporters = {
node = { enable = true; enabledCollectors = [ "systemd" ]; };
node = {
enable = true;
enabledCollectors = [ "systemd" ];
};
process = {
enable = true;
settings.process_names = [
# Remove nix store path from process name
{ name = "{{.Matches.Wrapped}} {{ .Matches.Args }}"; cmdline = [ "^/nix/store[^ ]*/(?P<Wrapped>[^ /]*) (?P<Args>.*)" ]; }
{
name = "{{.Matches.Wrapped}} {{ .Matches.Args }}";
cmdline = [ "^/nix/store[^ ]*/(?P<Wrapped>[^ /]*) (?P<Args>.*)" ];
}
];
};
systemd.enable = true;
};
globalConfig = { scrape_interval = "10s"; };
globalConfig = {
scrape_interval = "10s";
};
scrapeConfigs = [
{ job_name = "node"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }]; }
{ job_name = "process"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.process.port}" ]; }]; }
{ job_name = "systemd"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.systemd.port}" ]; }]; }
{
job_name = "node";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }
];
}
{
job_name = "process";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.process.port}" ]; }
];
}
{
job_name = "systemd";
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.systemd.port}" ]; }
];
}
];
retentionTime = "15d";
};

View file

@ -1,14 +1,26 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{ config
, lib
, modulesPath
, ...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "uas" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"uas"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
@ -46,10 +58,12 @@
# };
};
swapDevices = [{
device = "/swapfile";
size = 1024 * 4;
}];
swapDevices = [
{
device = "/swapfile";
size = 1024 * 4;
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -3,7 +3,10 @@
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
options = [
"terminate:ctrl_alt_bksp"
"compose:rctrl"
];
};
};

View file

@ -3,7 +3,10 @@
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
options = [
"terminate:ctrl_alt_bksp"
"compose:rctrl"
];
};
};