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,14 +1,24 @@
{ pkgs, lib, config, ... }:
{ pkgs
, lib
, config
, ...
}:
let
hosts = import ../../hosts.nix;
in
{
age.secrets = {
ntfy-freya = { file = ../../secrets/ntfy-freya.age; owner = "bertof"; };
ntfy-freya = {
file = ../../secrets/ntfy-freya.age;
owner = "bertof";
};
};
console = { font = "Lat2-Terminus16"; keyMap = "it"; };
console = {
font = "Lat2-Terminus16";
keyMap = "it";
};
environment = {
pathsToLink = [ "/share/zsh" ];
@ -20,7 +30,10 @@ in
enable = true;
# package = pkgs.bluezFull;
};
opengl = { enable = true; driSupport = true; };
opengl = {
enable = true;
driSupport = true;
};
raspberry-pi."4" = {
# audio.enable = true; # AUDIO
fkms-3d.enable = true; # GPU
@ -52,7 +65,10 @@ in
programs = {
dconf.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
zsh.enable = true;
};
@ -77,14 +93,24 @@ 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"; };
fail2ban = {
enable = true;
bantime-increment.enable = true;
};
plex = {
enable = true;
openFirewall = true;
group = "users";
};
# jellyfin = { enable = true; openFirewall = true; group = "users"; };
home-assistant = {
@ -246,11 +272,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;
@ -336,12 +364,18 @@ 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;
@ -352,15 +386,21 @@ in
scrapeConfigs = [
{
job_name = "node";
static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }];
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}" ]; }];
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}" ]; }];
static_configs = [
{ targets = [ "localhost:${toString config.services.prometheus.exporters.systemd.port}" ]; }
];
}
];
retentionTime = "15d";
@ -368,16 +408,30 @@ in
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 = {

View file

@ -1,13 +1,15 @@
{ lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
extraModulePackages = [ ];
initrd = {
availableKernelModules = [ "xhci_pci" "uas" "usb_storage" ];
availableKernelModules = [
"xhci_pci"
"uas"
"usb_storage"
];
kernelModules = [ ];
};
kernelModules = [ ];
@ -26,7 +28,10 @@
};
swapDevices = [
{ device = "/swapfile"; size = 1024 * 4; }
{
device = "/swapfile";
size = 1024 * 4;
}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -1,13 +1,22 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
home = {
language.base = "it_IT.UTF-8";
keyboard = {
layout = "it";
options = [ "terminate:ctrl_alt_bksp" "compose:rctrl" ];
options = [
"terminate:ctrl_alt_bksp"
"compose:rctrl"
];
};
packages = builtins.attrValues {
inherit (pkgs)
cava gallery-dl procps wireguard-tools httpie;
cava
gallery-dl
procps
wireguard-tools
httpie
;
};
};