- install.sh: copie le repo (clone substitué) vers /mnt/etc/nixos après nixos-install, sinon la machine installée n'a aucun fichier à éditer - base.nix: hardware.enableRedistributableFirmware pour les cartes wifi nécessitant un firmware non-libre - desktop.nix: fond d'écran NixOS par défaut via dconf (n'existait pas) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
85 lines
2.5 KiB
Nix
85 lines
2.5 KiB
Nix
# Socle commun à toutes les machines de la flotte (repo public).
|
|
{ pkgs, lib, ... }:
|
|
|
|
{
|
|
# Toutes les machines de la flotte portent le même nom : pas
|
|
# d'identification individuelle pour l'instant (voir README du repo
|
|
# racine). À revoir plus tard via le numéro de série DMI si un vrai
|
|
# besoin d'identification apparaît.
|
|
networking.hostName = "Nixos_Fleet";
|
|
networking.networkmanager.enable = true;
|
|
|
|
# Sans ça, les firmwares non-libres (wifi/Bluetooth Broadcom, Realtek,
|
|
# Intel...) ne sont pas inclus dans le système. Sur un parc de PC
|
|
# hétérogène et inconnu à l'avance, une partie aura besoin de ces
|
|
# firmwares pour que la carte wifi soit seulement détectée (option
|
|
# documentée : nixos.wiki/wiki/NixOS_Installation_Guide, section
|
|
# firmware). mkDefault : un profil peut désactiver au cas par cas.
|
|
hardware.enableRedistributableFirmware = lib.mkDefault 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;
|
|
|
|
# Certains PC du parc n'ont que 4 Go de RAM (Cinnamon + Firefox +
|
|
# LibreOffice + VLC peuvent solliciter la mémoire) — swap compressé en
|
|
# RAM, marche identiquement quelle que soit la machine.
|
|
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 : chaque machine de la flotte tire ses mises à jour du
|
|
# même repo public, sans intervention humaine (pas de netrc nécessaire
|
|
# ici, contrairement au repo nixos_users). Voir README pour adapter
|
|
# l'URL réelle du repo.
|
|
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";
|
|
}
|