Files
nixos/hosts/home/configuration.nix
T
Xavier Morel d4454b3b48 feat: cleaning
2026-04-17 10:07:37 +02:00

391 lines
9.0 KiB
Nix

{
config,
pkgs,
inputs,
nixpkgs,
...
}:
let
lib = pkgs.lib;
in
{
imports = [
./hardware-configuration.nix
# inputs.home-manager.nixosModules.default
];
# Bootloader.
boot = {
loader.grub.enable = true;
loader.grub.device = "/dev/sda";
loader.grub.useOSProber = true;
supportedFilesystems = [ "ntfs" ];
# tmp = {
# useTmpfs = false;
# tmpfsSize = "30%";
# };
initrd.kernelModules = [ "amdgpu" ];
kernelPackages = pkgs.linuxPackages_latest;
kernelModules = [
"coretemp"
"cpuid"
];
plymouth.enable = true;
};
fileSystems."/mnt/apps" = {
device = "/dev/disk/by-label/Apps";
fsType = "ntfs-3g";
options = [
"rw"
"uid=1000"
];
};
fileSystems."/mnt/photos" = {
device = "/dev/disk/by-label/Photos";
fsType = "ntfs-3g";
options = [
"rw"
"uid=1000"
];
};
fileSystems."/mnt/ext" = {
device = "/dev/disk/by-label/Externe";
fsType = "ntfs-3g";
options = [
"auto"
"nofail"
"noatime"
"rw"
"uid=1000"
];
};
networking.hostName = "arcueid"; # Define your hostname.
networking.networkmanager.enable = true;
networking.firewall.allowedTCPPorts = [
80
5000
];
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [
"root"
"yoru"
];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 10d";
};
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
extraOptions = ''
extra-substituters = https://devenv.cachix.org
extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
'';
};
nixpkgs.config = {
allowUnfree = true;
allowBroken = true;
};
time.timeZone = "Europe/Paris";
i18n.defaultLocale = "fr_FR.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8";
LC_MEASUREMENT = "fr_FR.UTF-8";
LC_MONETARY = "fr_FR.UTF-8";
LC_NAME = "fr_FR.UTF-8";
LC_NUMERIC = "fr_FR.UTF-8";
LC_PAPER = "fr_FR.UTF-8";
LC_TELEPHONE = "fr_FR.UTF-8";
LC_TIME = "fr_FR.UTF-8";
};
hardware = {
sane.enable = true;
graphics = {
enable = true;
enable32Bit = true;
};
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
};
environment = {
sessionVariables = {
FLAKE = "/home/yoru/nixos";
DIRENV_LOG_FORMAT = "";
};
systemPackages = with pkgs; [
pavucontrol
vial
xwayland-satellite
clinfo
gcc
];
};
programs = {
niri.enable = true;
};
security = {
rtkit.enable = true;
sudo.wheelNeedsPassword = false;
};
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
systemd.services.frigate.path = lib.mkBefore [ pkgs.ffmpeg-full ];
services = {
udev.packages = with pkgs; [
vial
];
openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
AllowUsers = null;
};
};
pulseaudio.enable = false;
xserver.enable = true;
xserver.xkb = {
layout = "us";
variant = "altgr-intl";
};
xserver.videoDrivers = [
"amdgpu"
];
blueman.enable = true;
printing.enable = true;
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# ollama = {
# enable = true;
# host = "0.0.0.0";
# openFirewall = true;
# package = pkgs.ollama-rocm;
# syncModels = true;
# loadModels = [
# "gemma3:4b"
# "mistral:latest"
# "qwen3.5:4b"
# #"qwen3.5:9b"
# ];
# };
# open-webui = {
# enable = true;
# host = "0.0.0.0";
# port = 8080;
# openFirewall = true;
# environment = {
# WEBUI_ADMIN_EMAIL = "morelx42@protonmail.com";
# WEBUI_ADMIN_PASSWORD = "pouet";
# };
# };
# librechat = {
# enable = true;
# enableLocalDB = true;
# env = {
# CREDS_KEY = "caab82871d3949266571f79644b799bba1efa864367fdaecc2c0ea28c5f3135c";
# CREDS_IV = "4cb7bdbd6f7c2fd97366c1361f4810ef";
# JWT_SECRET = "d6ba21978eea938b51a1eef85629d1027425f34ac7971d58c73280fcd4fa9b92";
# JWT_REFRESH_SECRET = "f156cff757cd26a8a549f8a9f849b1c9e2b9107261c2f7eee6c72a78f4868124";
# MEILI_MASTER_KEY = "cc061e6953e20053606622d7c594b70a";
# };
# meilisearch.enable = true;
# };
# meilisearch = {
# enable = true;
# masterKeyFile = ./meilikey.txt;
# };
frigate = {
enable = true;
hostname = "arcueid.int.m0rel.eu";
vaapiDriver = "radeonsi";
settings = {
genai = {
provider = "ollama";
base_url = "http://localhost:11434";
model = "gemma3:4b";
};
mqtt = {
enabled = true;
host = "mqtt.int.m0rel.eu";
user = "frigate";
password = "pouet";
};
ffmpeg = {
hwaccel_args = "preset-vaapi";
input_args = "preset-rtsp-restream-low-latency";
path = pkgs.ffmpeg-full;
};
# ui.live_mode = "webrtc";
auth.enabled = false;
proxy.default_role = "admin";
# detectors = {
# ov_0 = {
# type = "openvino";
# device = "GPU";
# };
# ov_1 = {
# type = "openvino";
# device = "NPU";
# };
# # onnx.type = "onnx";
# };
# model = {
# model_type = "yolo-generic";
# width = 640;
# height = 640;
# input_tensor = "nchw";
# input_dtype = "float";
# path = ../../yolox_m.onnx;
# labelmap_path = ../../coco-80.txt;
# };
detect.enabled = true;
detect.fps = 2;
objects.track = [
"person"
"car"
"bird"
"cat"
"dog"
];
audio = {
enabled = false;
max_not_heard = 10;
min_volume = 500;
listen = [
"bark"
"fire_alarm"
"scream"
"speech"
"yell"
];
filters.speech.threshold = 0.8;
};
motion = {
enabled = true;
};
semantic_search.enabled = true;
semantic_search.model_size = "small";
review.detections.enabled = true;
record.enabled = true;
# record.retain.days = 2;
record.preview.quality = "medium";
face_recognition.enabled = true;
face_recognition.model_size = "small";
lpr.enabled = true;
audio_transcription = {
enabled = false;
device = "CPU";
model_size = "small";
language = "fr";
};
classification = {
bird.enabled = true;
custom = {
Animaux = {
enabled = true;
name = "Animaux";
threshold = 0.8;
object_config.objects = [
"cat"
"dog"
];
# classification_type = "sub_label";
};
Voitures = {
enabled = true;
name = "Voitures";
threshold = 0.8;
object_config.objects = [ "car" ];
# classification_type = "sub_label";
};
Personnes = {
enabled = true;
name = "Personnes";
threshold = 0.8;
object_config.objects = [ "person" ];
# classification_type = "sub_label";
};
};
};
snapshots.enabled = true;
snapshots.retain.default = 7;
cameras.front = {
enabled = true;
ffmpeg.inputs = [
{
path = "rtsp://admin:admin@192.168.68.240:554/?streamtype=0&subtype=1";
roles = [
"audio"
"detect"
"record"
];
}
];
onvif = {
host = "192.168.68.240";
port = 8899;
user = "admin";
password = "admin";
};
motion.mask = [
"0.316,0.037,0.317,0.012,0.035,0.01,0.033,0.035"
];
zones = {
cour = {
coordinates = "0.001,0.492,0.001,0.043,0.893,0.054,0.888,0.5";
};
entree = {
coordinates = "0.001,0.5,0.001,0.997,0.996,0.991,0.997,0.513";
};
};
};
};
};
};
myNixOS = {
home-users = {
"yoru" = {
userConfig = ./home.nix;
};
};
archetype.general.enable = true;
feature.fonts.enable = true;
feature.virtualisation.enable = true;
};
system.stateVersion = "24.05";
}