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

@ -1,4 +1,8 @@
{ pkgs, lib, config, ... }:
{ pkgs
, lib
, config
, ...
}:
let
hosts = import ../../hosts.nix;
in
@ -12,7 +16,10 @@ in
efi.canTouchEfiVariables = true;
};
console = { font = "Lat2-Terminus16"; keyMap = "it"; };
console = {
font = "Lat2-Terminus16";
keyMap = "it";
};
environment = {
pathsToLink = [ "/share/zsh" ];
@ -24,7 +31,10 @@ in
enable = true;
# package = pkgs.bluezFull;
};
opengl = { enable = true; driSupport = true; };
opengl = {
enable = true;
driSupport = true;
};
};
i18n.defaultLocale = "it_IT.UTF-8";
@ -52,7 +62,10 @@ in
programs = {
dconf.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
zsh.enable = true;
};
@ -61,7 +74,14 @@ in
'';
services = {
grafana = { enable = true; settings.server = { http_addr = "0.0.0.0"; domain = "bertof.net"; root_url = "https://grafana.bertof.net/"; }; };
grafana = {
enable = true;
settings.server = {
http_addr = "0.0.0.0";
domain = "bertof.net";
root_url = "https://grafana.bertof.net/";
};
};
# avahi = {
# enable = true;
@ -79,15 +99,29 @@ in
# blueman.enable = true;
# dbus.packages = [ pkgs.dconf ];
# gnome.gnome-keyring.enable = true;
openssh = { enable = true; openFirewall = true; };
openssh = {
enable = true;
openFirewall = true;
};
# # xserver = {
# # enable = true;
# # desktopManager.retroarch = { enable = true; package = pkgs.retroarchFull; };
# # };
#
fail2ban = { enable = true; bantime-increment.enable = true; };
plex = { enable = true; openFirewall = true; group = "users"; };
jellyfin = { enable = true; openFirewall = true; group = "users"; };
fail2ban = {
enable = true;
bantime-increment.enable = true;
};
plex = {
enable = true;
openFirewall = true;
group = "users";
};
jellyfin = {
enable = true;
openFirewall = true;
group = "users";
};
#
home-assistant = {
enable = true;
@ -248,11 +282,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;
@ -338,37 +374,74 @@ in
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";
};
snapper.configs =
let
common = { TIMELINE_CREATE = true; TIMELINE_CLEANUP = true; };
common = {
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
};
in
{
bertof = lib.recursiveUpdate common { SUBVOLUME = "/mnt/raid/bertof/"; ALLOW_USERS = [ "bertof" ]; };
tiziano = lib.recursiveUpdate common { SUBVOLUME = "/mnt/raid/tiziano/"; ALLOW_USERS = [ "tiziano" ]; };
condiviso = lib.recursiveUpdate common { SUBVOLUME = "/mnt/raid/condiviso"; ALLOW_USERS = [ "bertof" "tiziano" ]; };
bertof = lib.recursiveUpdate common {
SUBVOLUME = "/mnt/raid/bertof/";
ALLOW_USERS = [ "bertof" ];
};
tiziano = lib.recursiveUpdate common {
SUBVOLUME = "/mnt/raid/tiziano/";
ALLOW_USERS = [ "tiziano" ];
};
condiviso = lib.recursiveUpdate common {
SUBVOLUME = "/mnt/raid/condiviso";
ALLOW_USERS = [
"bertof"
"tiziano"
];
};
};
};
time.timeZone = "Europe/Rome";
users.users = {
@ -393,4 +466,3 @@ in
system.stateVersion = "24.05";
}