# Socle commun à toutes les machines de la flotte (repo public). { pkgs, lib, ... }: { imports = [ ../../modules/anssi ]; # Nom uniforme, pas d'identification individuelle pour l'instant (voir # README). À revoir via le numéro de série DMI si le besoin apparaît. networking.hostName = "Nixos_Fleet"; networking.networkmanager.enable = true; # Couverture matérielle maximale (wifi/Bluetooth/PCI) sur un parc # hétérogène inconnu à l'avance. Inclut enableRedistributableFirmware. hardware.enableAllFirmware = lib.mkDefault true; # Durcissement ANSSI (modules/anssi/, vendored depuis SécurixOS). # level "intermediary" : couvre déjà tout ce qui était réglé à la main # sur le profil oreo (R9/R11/R12/R14). category "client" : postes de # travail, pas des serveurs. # # R12 force net.ipv4.ip_forward = 0 : sans impact sur des postes # clients. Ne pas importer ce module sur pxe-server/configuration.nix # (a besoin du forwarding inverse). security.anssi = { enable = true; level = "intermediary"; category = "client"; # R8 (mitigations CPU) coupe l'hyperthreading via "mds=full,nosmt" : # trop coûteux sur le matériel bas de gamme du parc. Désactivé via # exception plutôt que contourné en silence ; réappliqué ci-dessous # sans le "nosmt". exceptions.R8.rationale = "SMT conservé : impact perf trop lourd sur le parc (matériel bas de gamme, parfois 4 Go de RAM). Mitigations réappliquées ci-dessous sans 'nosmt'."; }; # R8 (modules/anssi/kernel-options.nix), sauf mds=full,nosmt -> mds=full. boot.kernelParams = [ "l1tf=full,force" "page_poison=on" "pti=on" "slab_nomerge=yes" "slub_debug=FZP" "spec_store_bypass_disable=seccomp" "spectre_v2=on" "mds=full" # sans ",nosmt" : hyperthreading conservé "mce=0" "page_alloc.shuffle=1" "rng_core.default_quality=500" ]; # Pas couvert par le module ANSSI (R45 en exception : AppArmor # partiellement supporté sur NixOS). systemd.coredump.enable = false; security.apparmor.packages = [ pkgs.apparmor-profiles ]; security.apparmor.enableCache = true; # Bluetooth (même config que le profil oreo) : pas d'allumage auto au # boot, blueman pour la gestion depuis Cinnamon. hardware.bluetooth = { enable = true; powerOnBoot = false; }; services.blueman.enable = 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"; }; services.xserver.xkb = { layout = "fr"; variant = ""; }; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.loader.systemd-boot.configurationLimit = 10; services.openssh.enable = true; networking.firewall.enable = true; # Swap compressé en RAM : couvre le bas du parc (4 Go, desktop complet). zramSwap = { enable = true; memoryPercent = 50; }; nix.settings.experimental-features = [ "nix-command" "flakes" ]; nixpkgs.config.allowUnfree = true; nix.gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 30d"; }; # Convergence automatique depuis le repo public, sans netrc. system.autoUpgrade = { enable = true; dates = "daily"; flake = "git+https://gitea.miniclic.net/Damien/Nixos_Fleet.git#usagers"; }; environment.systemPackages = with pkgs; [ git curl wget htop nixfmt ]; system.stateVersion = "26.05"; }