fixed stuff

This commit is contained in:
afoucaultc 2026-07-10 13:22:08 +02:00
parent f9413c476c
commit 2482644028
58 changed files with 296 additions and 339 deletions

View file

@ -2,43 +2,46 @@
## Structure :
```shell
~/nixos-config/
├── flake.nix # pour fixer la source/version des packages utilisés
│ # permet de fixer la source/version des packages utilisés
├── flake.nix
│ # permet de fixer la source/version des packages utilisés et du point d'entrée user / host
├── flake.lock
├── hosts/
│ # configuration système
│ ├── nixos-home/
│ │ # mon host de la maison
│ │ # mon host PC maison
│ │ └── nixos/
│ │ ├── configuration.nix # entrée des fichiers de configuration
│ │ ├── hardware-configuration.nix # fichier hardware généré à l'installation
│ │ └── config/ # tous fichiers config
│ │ └── config/ # tous fichiers config système (packages et services)
│ │ └── ...
│ └── nixos-laptop/
│ # mon host du travail
│ # mon host PC travail
│ └── nixos/
│ ├── configuration.nix # entrée des fichiers de configuration
│ ├── hardware-configuration.nix # fichier hardware généré à l'installation
│ └── config/ # tous fichiers config
│ └── config/ # tous fichiers config système (packages et services)
│ └── ...
├── home/
│ # configuration user
│ └── afoucaultc/
│ # mon user personnel
│ # mon user
│ ├── home.nix # point d'entrée home-manager classique
│ ├── home_laptop.nix # point d'entrée home-manager pour machine light
│ ├── dotfiles_apps.nix # liens vers mes dossier de configuration
│ └── packages/ # lien vers les packages installés sur mon user
└── ...
│ └── ...
├── install.sh # script d'installation
├── rebuild.sh # script de rebuild
└── update.sh # script d'update
```
## Installation :
1. Installer NixOS sur clé USB (via Rufus sous windows par exemple)
2. Boot sur clé USB
3. Suivre les indications (perso: chiffrement LUKS + swap activé + formatage auto)
4. Reboot dans NixOS
4. Reboot dans NixOS sur la machine (pas sur la clé USB !)
5. Cloner le repo git en utilisant git temporairement via nix shell : `nix-shell -p git --run "git clone https://gitlab.com/afoucaultc/nixos-config.git ~/nixos-config"`
6. Lancer le `./install` (copie hardware-configuration dans le host, ajoute le host, lance un rebuild)
6. Lancer le `./install` (copie hardware-configuration dans le host, ajoute le host et les fichiers de config, lance un rebuild)
7. C'est fini, reboot et lancer la nouvelle version avec Grub
> [!WARNING]
@ -56,6 +59,8 @@ sudo nixos-rebuild switch --flake ~/nixos-config#nixos-home
```
Ou utiliser `update.sh`
Il est possible de mettre à jour la config sans mettre à jour tous les packages, en utilisant `rebuild.sh`
### Pour trouver un nouveau package :
```nix
nix search nixpkgs nom_du_package

View file

@ -20,8 +20,8 @@ hl.config({
rounding_power = 10,
-- Change transparency of focused and unfocused windows
active_opacity = 0.9,
inactive_opacity = 0.9,
active_opacity = 0.99,
inactive_opacity = 0.99,
shadow = {
enabled = false,

30
flake.lock generated
View file

@ -194,11 +194,11 @@
]
},
"locked": {
"lastModified": 1783479733,
"narHash": "sha256-d/JatqgG+Pmo+IuCTZfnrEAPWU3fdha48GQeXuFO+bE=",
"lastModified": 1783618078,
"narHash": "sha256-F43DGcBoIO8xOZFAfodg3jy0VghB9NGdb6xbTYAIx1A=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "cee3f0e7fec85d80c149c7afc29926747f7bd3c2",
"rev": "144f4e36d0186195037da9fce80a727108978070",
"type": "github"
},
"original": {
@ -282,11 +282,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1783449028,
"narHash": "sha256-X7T5MtKdw7daUN2r2v7zVLrN4OKowJ3hgm+rSPeESnw=",
"lastModified": 1783582777,
"narHash": "sha256-fsDLDZuvet2iZv6svhcMjcO5LjwHrY6VQnJAfND/N+U=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "6a8eb0490ce3ff3cbf9b00815f7a215e895d87e0",
"rev": "01f5c9aee4c31e5b782e99eb354ee7230b999821",
"type": "github"
},
"original": {
@ -531,11 +531,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1783370751,
"narHash": "sha256-E+3MIMvKuo9k+K+qLQ9YXzsBzkgHuyVLnsEbN2DFfuc=",
"lastModified": 1783673680,
"narHash": "sha256-ardRVG+ipnyyxVdIsbLMy5foO6gDqN/yIi8v10HTJqs=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "662bd6e312d2c8b212e32cb377abaee190749320",
"rev": "0b655af52b5b89bcceb88737efdc3a7498e751ee",
"type": "github"
},
"original": {
@ -575,11 +575,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1783224372,
"narHash": "sha256-8i/87eeoqiGE4yOTjwSA3Eh/ziJRQEmd/unYU+K27sk=",
"lastModified": 1783522502,
"narHash": "sha256-iffAls3iaNTyJC2faYcUXSI+Gp02cDjYl+MygxKl2GI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d407951447dcd00442e97087bf374aad70c04cea",
"rev": "0bb7ec54c8483066ec9d7720e780a5caa71f8612",
"type": "github"
},
"original": {
@ -824,11 +824,11 @@
]
},
"locked": {
"lastModified": 1783489920,
"narHash": "sha256-sZediA0pfMCXm6nA6fvO1vEsWvybEvP5GCnaAPDcTq0=",
"lastModified": 1783668941,
"narHash": "sha256-KFnepHImqltAzpJZ8sh8i3qzC1NRVNQX3WBVoD5oBRM=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "3671c6eceee35fd06fd1f60b71eed968cc9d7449",
"rev": "71e156423dae9496d7fd9e89029a1a82516fb9d8",
"type": "github"
},
"original": {

144
flake.nix
View file

@ -1,68 +1,84 @@
{
description = "My Nixos";
description = "My Nixos";
inputs = {
# nix packages
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
# home manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# hyprland
hyprland.url = "github:hyprwm/Hyprland";
nixos-hardware.url = "github:NixOS/nixos-hardware";
# zen browser (communautaire) — follows pour partager les libs système
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
# ici :
# - inputs@ capture l'ensemble des inputs dans une variable "inputs" accessible par
# "specialArgs" et "extraSpecialArgs. inputs.hyprland pourra être utilisé dans n'importe
# quel fichier importé sans avoir à redéclarer dans flake.nix
# - ajouter dans la ligne d'outputs les nouveaux packages ajoutés en input !
outputs = inputs@{ self, nixpkgs, home-manager, hyprland, nixos-hardware, zen-browser, stylix, ... }: {
nixosConfigurations.nixos-home = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/nixos-home/configuration.nix
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.afoucaultc = import ./home/afoucaultc/home.nix;
home-manager.backupFileExtension = "backup";
inputs = {
# all nix packages (version unstable)
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
# home manager
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# flake hyprland (git version)
hyprland.url = "github:hyprwm/Hyprland";
nixos-hardware.url = "github:NixOS/nixos-hardware";
# zen browser (communautaire) — follows pour partager les libs système
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
#stylix
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
# ici :
# - inputs@ capture l'ensemble des inputs dans une variable "inputs" accessible par
# "specialArgs" et "extraSpecialArgs". inputs.hyprland pourra être utilisé dans n'importe
# quel fichier importé sans avoir à redéclarer dans flake.nix
# - ajouter dans la ligne d'outputs les nouveaux packages ajoutés en input !
outputs =
inputs@{
self,
nixpkgs,
home-manager,
hyprland,
nixos-hardware,
zen-browser,
stylix,
...
}:
# pour la configuration nixos-home
{
nixosConfigurations.nixos-home = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{ nixpkgs.hostPlatform = "x86_64-linux"; }
./hosts/nixos-home/configuration.nix
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
{
# default config
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
# emplacement de la config
home-manager.users.afoucaultc = import ./home/afoucaultc/home.nix;
home-manager.backupFileExtension = "backup";
}
];
};
}
];
};
# ── ThinkPad E560 (i5-6200U, HD 520, 4 Gio RAM) : profil léger ──
nixosConfigurations.nixos-laptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./hosts/nixos-laptop/configuration.nix
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.afoucaultc = import ./home/afoucaultc/home-laptop.nix;
home-manager.backupFileExtension = "backup";
}
];
};
};
# pour la configuration home-laptop
nixosConfigurations.nixos-laptop = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{ nixpkgs.hostPlatform = "x86_64-linux"; }
./hosts/nixos-laptop/configuration.nix
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager
{
# default config
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
# emplacement de la config
home-manager.users.afoucaultc = import ./home/afoucaultc/home-laptop.nix;
home-manager.backupFileExtension = "backup";
}
];
};
};
}

View file

@ -1,12 +1,15 @@
{ config, pkgs, ... }:
{ config, ... }:
{
home.packages = with pkgs; [
rofi
];
# dotfiles pour inkscape (fichier dimensionné pour LaTeX)
xdg.configFile."inkscape".source =
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/dotfiles/inkscape";
# dotfiles pour Rofi
xdg.configFile."rofi".source =
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/dotfiles/rofi";
# dotfiles pour hyprland
xdg.configFile."hypr".source =
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/dotfiles/hypr";
# dotfiles nvim
xdg.configFile."nvim".source =
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/dotfiles/nvim";
}

View file

@ -1,9 +1,11 @@
{ config, pkgs, ... }:
{ ... }:
{
home.username = "afoucaultc";
home.homeDirectory = "/home/afoucaultc";
home.stateVersion = "26.05";
imports = [
# fichier individuel dans packages = programs.xyz existant
# sinon, dans other_apps*
./packages/btop.nix
./packages/firefox.nix
./packages/git.nix
@ -14,6 +16,7 @@
./packages/nextcloud.nix
./packages/other_apps_light.nix
./packages/pass.nix
./packages/protonmail.nix
./packages/texlive.nix
./packages/thunderbird.nix
./packages/tmux.nix
@ -23,5 +26,6 @@
# dotfiles links
./dotfiles_apps.nix
];
# désactivation de stylix pour des logiciels lourds comme inkscape
stylix.targets.gtksourceview.enable = false;
}

View file

@ -1,9 +1,11 @@
{ config, pkgs, ... }:
{ ... }:
{
home.username = "afoucaultc";
home.homeDirectory = "/home/afoucaultc";
home.stateVersion = "26.05";
imports = [
# fichier individuel dans packages = programs.xyz existant
# sinon, dans other_apps*
./packages/btop.nix
./packages/firefox.nix
./packages/git.nix
@ -14,6 +16,7 @@
./packages/nextcloud.nix
./packages/other_apps.nix
./packages/pass.nix
./packages/protonmail.nix
./packages/texlive.nix
./packages/thunderbird.nix
./packages/tmux.nix

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ ... }:
{
programs.btop = {
enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ ... }:
{
programs.firefox = {
enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ ... }:
{
programs.git = {
enable = true;

View file

@ -1,9 +1,4 @@
{
config,
pkgs,
inputs,
...
}:
{ pkgs, ... }:
{
home.packages = with pkgs; [
hyprpaper

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
programs.kitty = {
enable = true;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
programs.mpv = {
enable = true;

View file

@ -1,23 +1,23 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
home.packages = with pkgs; [
neovim-unwrapped
# outils dont lazy.nvim / les LSP ont besoin
# besoins pour LSP et lazy vim
ripgrep
fd
gcc
gnumake
nodejs
unzip
# formatters généraux
# formatters
lua-language-server
stylua
nil
nixfmt-rfc-style # binaire "nixfmt" pour conform
nixfmt
# LSP serveurs (remplacent Mason)
marksman
pyright
# LSP que tu avais dans Mason — décommente selon besoin
# LSP sélectionnés dans mason
clang-tools # clangd
bash-language-server # bashls
vscode-langservers-extracted # cssls, jsonls, html, eslint
@ -44,7 +44,4 @@
vi = "nvim";
vim = "nvim";
};
# ~/.config/nvim -> tes dotfiles, éditables en place
xdg.configFile."nvim".source =
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/dotfiles/nvim";
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
services.nextcloud-client = {
enable = true;

View file

@ -1,10 +1,6 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
home.packages = with pkgs; [
# --- Others
hyfetch
fastfetch
pkg-config
# --- Bureautique ---
libreoffice-fresh
typora
@ -13,6 +9,7 @@
signal-desktop
vesktop
mattermost-desktop
protonmail-bridge
# --- Multimédia ---
gimp
inkscape
@ -25,13 +22,12 @@
# --- Maths ---
(octave.withPackages (
ps: with ps; [
image # octave-image
statistics # octave-statistics
symbolic # octave-symbolic
# dataframe # (octave-dataframe : indispo dans nixpkgs, à compiler via pkg si besoin)
image
statistics
symbolic
]
))
gnuplot # gnuplot
gnuplot
# --- Gestion de fichiers KDE ---
kdePackages.dolphin
kdePackages.dolphin-plugins
@ -40,17 +36,19 @@
kdePackages.ark
kdePackages.kdegraphics-thumbnailers
kdePackages.ffmpegthumbs
nwg-look
papirus-icon-theme
# --- Others
hyfetch
fastfetch
pkg-config
mako
cliphist
grim
slurp
mullvad-vpn
rofi
# --- Themes
nwg-look
papirus-icon-theme
bibata-cursors
];
services.gpg-agent = {
enable = true;
pinentry.package = pkgs.pinentry-gnome3;
};
services.protonmail-bridge.enable = true;
}

View file

@ -1,58 +1,45 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
home.packages = with pkgs; [
# --- Infos système / divers ---
hyfetch # hyfetch
fastfetch # fastfetch
pkg-config
# --- Bureautique ---
libreoffice-fresh # libreoffice-fresh
zotero # zotero (AUR)
pandoc # pandoc-cli
# --- Communication / mail ---
# thunderbird # thunderbird
signal-desktop # signal-desktop
mattermost-desktop # mattermost-desktop
protonmail-bridge # protonmail-bridge (CLI/bridge)
# --- Multimédia (léger) ---
gimp # gimp
inkscape # inkscape
nomacs # nomacs (AUR) — visionneuse d'images légère
imagemagick # imagemagick
librsvg # librsvg
# --- Maths / sciences ---
# --- Bureautique
libreoffice-fresh
zotero
pandoc
# --- Communication
signal-desktop
mattermost-desktop
protonmail-bridge
# --- Multimédia
gimp
inkscape
nomacs
imagemagick
librsvg
# --- Maths
(octave.withPackages (
ps: with ps; [
image # octave-image
statistics # octave-statistics
symbolic # octave-symbolic
# dataframe # (octave-dataframe : indispo dans nixpkgs, à compiler via pkg si besoin)
image
statistics
symbolic
]
))
gnuplot # gnuplot
# --- Fichiers / bureau ---
nautilus # nautilus (gestionnaire léger)
nwg-look # nwg-look
papirus-icon-theme # papirus-icon-theme
brightnessctl # brightnessctl
mako # mako (notifications légères, remplace noctalia)
cliphist # cliphist
gnuplot
# --- Fichiers
nautilus
# --- Others
hyfetch
fastfetch
pkg-config
brightnessctl
mako
cliphist
grim
slurp # captures (grimblast côté script si besoin)
mullvad-vpn # GUI Mullvad (le service est côté système)
# themes
slurp
mullvad-vpn
rofi
# --- Themes
nwg-look
papirus-icon-theme
bibata-cursors
];
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
pinentry.package = pkgs.pinentry-curses;
};
services.protonmail-bridge.enable = true;
}

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ ... }:
{
programs.password-store = {
enable = true;

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
# agent pour les clés gpg demandées par protonmail
services.gpg-agent = {
enable = true;
pinentry.package = pkgs.pinentry-curses;
};
services.protonmail-bridge.enable = true;
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
home.packages = with pkgs; [
texliveFull

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
programs.thunderbird = {
enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ ... }:
{
programs.tmux = {
enable = true;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
programs.zathura = {
enable = true;

View file

@ -1,9 +1,4 @@
{
config,
pkgs,
inputs,
...
}:
{ inputs, ... }:
{
imports = [ inputs.zen-browser.homeModules.beta ];
programs.zen-browser = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
programs.zsh = {
enable = true;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;

View file

@ -1,11 +1,13 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
# grub utilisé pour le bootloader
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
useOSProber = true;
useOSProber = false;
# nombre de configurations à garder en mémoire
configurationLimit = 10;
};
boot.loader.efi.canTouchEfiVariables = true;

View file

@ -15,21 +15,17 @@
hardware.nvidia = {
modesetting.enable = true; # requis pour Wayland/Hyprland
# dGPU endormi en général, offload sinon
powerManagement.enable = true;
# powerManagement.finegrained = true; # nécessite offload (ci-dessous)
# RTX 2060 = Turing. Le driver "open" fonctionne pour Turing+, mais le
# propriétaire reste plus mature sur cette génération. Garde `open = false`.
# RTX 2060 = Turing. Le driver "open" fonctionne pour Turing+, mais le propriétaire reste plus mature sur cette génération.
open = false;
nvidiaSettings = true; # fournit `nvidia-settings`
package = config.boot.kernelPackages.nvidiaPackages.stable;
prime = {
sync.enable = true;
#offload = {
# enable = true; # dGPU à la demande (meilleure autonomie)
# enableOffloadCmd = true; # fournit la commande `nvidia-offload`
# enable = true;
# enableOffloadCmd = true;
#};
# nix shell nixpkgs#pciutils -c lspci -D -d ::03xx
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};

View file

@ -1,11 +1,11 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
# ── Mullvad VPN ──
# mullvad VPN
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
# ── Steam ──
# steam
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
@ -21,7 +21,7 @@
algorithm = "zstd";
memoryPercent = 50;
};
# ── Intégration KDE/Dolphin ──
# ajouts pour KDE/dolphin
services.gvfs.enable = true;
services.tumbler.enable = true;
environment.sessionVariables = {

View file

@ -1,36 +1,29 @@
{ config, pkgs, ... }: {
{ pkgs, ... }: {
fonts.packages = with pkgs; [
# Sans / Source (adobe-source-*-fonts, source-han-sans)
source-sans
source-serif
source-han-sans # adobe-source-han-sans-otc-fonts
source-han-serif
# Noto + emoji + CJK (noto-fonts-cjk, noto-fonts-emoji)
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
# Microsoft / Windows (ttf-ms-fonts + corefonts)
corefonts
vista-fonts # tahoma, etc. (unfree)
# Latin Modern / TeX Gyre (otf-latin-modern, tex-gyre-math)
lmodern
gyre-fonts
# Accessibilité (ttf-luciole)
texlivePackages.luciole
# Nerd fonts / symboles (ttf-nerd-fonts-symbols, font-awesome, woff2-font-awesome)
nerd-fonts.symbols-only
font-awesome
# Fontes de code utiles
fira-code
jetbrains-mono
dejavu_fonts
liberation_ttf
];

View file

@ -4,12 +4,10 @@
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
# Portails XDG (captures d'écran, partage d'écran, file pickers Wayland)
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
};
security.polkit.enable = true;
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
time.timeZone = "Europe/Paris";
i18n.defaultLocale = "fr_FR.UTF-8";

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
services.tlp.enable = true;
services.power-profiles-daemon.enable = false;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
services.pulseaudio.enable = false;
security.rtkit.enable = true;

View file

@ -1,11 +1,11 @@
{ pkgs, ... }:
{
# style global
stylix = {
enable = true;
targets.gtksourceview.enable = false;
base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-dark.yaml";
polarity = "dark";
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
git

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
nix.gc = {
automatic = true;

View file

@ -1,9 +1,8 @@
{ config, pkgs, ... }:
{ ... }:
{
networking = {
hostName = "nixos-home";
networkmanager.enable = true;
# open ports manually if needed
firewall.enable = true;
};
services = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
users.users.afoucaultc = {
isNormalUser = true;

View file

@ -1,13 +1,10 @@
{
config,
pkgs,
inputs,
...
}:
{ inputs, ... }:
{
imports = [
# faire nixos-generate-config dans le bon dossier
# généré à l'installation avec nixos-generate-config
# à copier dans le dossier courant depuis /etc/nixos
./hardware-configuration.nix
# ensemble de packages et configurations système
./config/bluetooth.nix
./config/boot.nix
./config/drivers_video.nix
@ -24,17 +21,19 @@
./config/user.nix
# profil nixos pour mon ordi portable
# nécessite l'input nixos-hardware dans flake.nix.
inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
inputs.nixos-hardware.nixosModules.common-cpu-intel # active le microcode intel, KMS pour GPU intégré, etc...
inputs.nixos-hardware.nixosModules.common-pc-laptop # active tlp
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd # active le TRIM périodique pour le SSD
];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
#nixpkgs.config.permittedInsecurePackages = [
# "pnpm-10.29.2"
#];
# ne pas toucher, défini une seule fois en fonction de la version de nixos de l'ISO pour la 1ère installation
system.stateVersion = "25.11";
# nécessaire pour permettre des dépendances problématiques parfois
#nixpkgs.config.permittedInsecurePackages = [
# "electron-39.8.10"
#];
}

View file

@ -4,7 +4,6 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:

View file

@ -1,20 +1,6 @@
# Host `nixos-laptop` — ThinkPad E560
Profil **léger et faible RAM (4 Gio)** : i5-6200U, Intel HD 520 (pas de GPU
dédié), pas de Steam, pas de Noctalia (remplacé par `mako`), pas de gros stack
KDE (on utilise `nautilus`).
## Installer
```bash
./install.sh nixos-laptop # ou ./install.sh puis choisir 2
```
Le script pousse explicitement les caches binaires (cache.nixos.org, Hyprland,
nix-community) dès le premier rebuild → quasiment aucune compilation locale.
## Mettre à jour
```bash
./update.sh nixos-laptop # ou juste ./update.sh (détecte le hostname)
```
Profil **léger et faible RAM (4 Gio)** : i5-6200U, Intel HD 520 (pas de GPU dédié)
## Faible RAM — ce qui est en place (`config/low-ram.nix`)
- `max-jobs = 1`, `cores = 2` : on ne sature pas les 4 Gio pendant un build.
@ -25,24 +11,13 @@ nix-community) dès le premier rebuild → quasiment aucune compilation locale.
### Si un rebuild rame quand même
Un paquet absent des caches sera compilé localement. Deux options :
1. Éviter les inputs qui forcent la compilation (ex. builds custom).
2. Créer ton propre cache Cachix et y pousser depuis le poste maison :
1. Éviter les inputs qui forcent la compilation
2. Créer son propre cache Cachix et y pousser depuis le poste maison :
```bash
# sur le poste maison, après un build :
cachix push mon-cache ./result
```
puis ajouter `https://mon-cache.cachix.org` aux `substituters` de
`config/low-ram.nix`. Le laptop récupèrera alors les binaires sans compiler.
## Noms de paquets à vérifier (traduits depuis pacman/AUR)
Je n'ai pas pu évaluer contre nixpkgs ici. Vérifie ceux-ci si un rebuild
échoue sur un attribut manquant (`nix search nixpkgs <nom>`) :
- `planify` (≈ `planner`), `nomacs`, `han-nom`, `bitwarden-cli`,
`bitwarden-desktop`, `mattermost-desktop`, `vaapiIntel` (peut être aliasé).
- Toolkits Octave : `image`, `statistics`, `symbolic` OK ; `dataframe` est
commenté (indispo).
- `octave-datatypes`, `grimblast`, `zen-browser` : gérés autrement (input zen,
grim/slurp), pas besoin de l'AUR.
puis ajouter `https://mon-cache.cachix.org` aux `substituters` de `config/low-ram.nix`. Le laptop récupèrera alors les binaires sans compiler.
## Empreinte digitale
`services.fprintd.enable = true`. Enrôle avec `fprintd-enroll` après install.
`services.fprintd.enable = true`. `fprintd-enroll` après install.

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;

View file

@ -1,11 +1,13 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
# grub utilisé pour le bootloader
boot.kernelPackages = pkgs.linuxPackages;
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
useOSProber = true;
# nombre de configurations à garder en mémoire
configurationLimit = 5;
};
boot.loader.efi.canTouchEfiVariables = true;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
hardware.graphics = {
enable = true;

View file

@ -1,14 +1,14 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
# ── Mullvad VPN ── (remplace mullvad-vpn-bin de l'AUR)
# mullvad VPN
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
# ── Intégration gestionnaire de fichiers (miniatures, montage…) ──
services.gvfs.enable = true;
services.tumbler.enable = true;
environment.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
# intégration gestionnaire de fichiers (pour Dolphin)
#services.gvfs.enable = true;
#services.tumbler.enable = true;
#environment.sessionVariables = {
# NIXOS_OZONE_WL = "1";
#};
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: {
{ pkgs, ... }: {
fonts.packages = with pkgs; [
# Sans / Source (adobe-source-*-fonts, source-han-sans)
source-sans

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
time.timeZone = "Europe/Paris";
i18n.defaultLocale = "fr_FR.UTF-8";

View file

@ -1,21 +1,12 @@
{ ... }:
{
config,
pkgs,
lib,
...
}:
{
# ─────────────────────────────────────────────────────────────
# Machine à faible RAM (4 GiB) : on privilégie TOUJOURS les
# binaires pré-compilés (caches) plutôt que la compilation locale.
# ─────────────────────────────────────────────────────────────
# privilège pour les paquets précompilés pour que la RAM ne soit pas trop sollicitée
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
# Caches binaires : on récupère un maximum de paquets déjà
# compilés pour éviter de compiler sur cette machine.
# Caches binaires
substituters = [
"https://cache.nixos.org"
"https://hyprland.cachix.org"
@ -35,38 +26,31 @@
"root"
"@wheel"
];
# Toujours interroger les caches, ne jamais partir du principe
# qu'un paquet doit être compilé localement.
# utiliser les caches par défaut
builders-use-substitutes = true;
fallback = true; # si un cache tombe, on tente ailleurs
connect-timeout = 10;
# Limiter la pression mémoire pendant la construction :
# peu de jobs en parallèle, sinon 4 Gio saturent vite.
# limitation de l'utilisation de la RAM
max-jobs = 1; # une dérivation à la fois
cores = 2; # les 2 cœurs du i5-6200U par job
cores = 2; # les 2 coeurs du i5-6200U par job
};
# Auto-optimisation du store (déduplication) pour économiser le disque.
# optimisation du store
nix.settings.auto-optimise-store = true;
# ─────────────────────────────────────────────────────────────
# zram : swap compressé en RAM. Indispensable avec 4 Gio, à la
# fois pour l'usage courant et pour absorber les pics du rebuild.
# ─────────────────────────────────────────────────────────────
# zram : compression du swap en RAM pour absorber les pics du rebuild
zramSwap = {
enable = true;
algorithm = "zstd";
memoryPercent = 150; # jusqu'à 1.5x la RAM (zstd compresse ~3:1)
memoryPercent = 150;
priority = 100;
};
# Le noyau peut « swaper » agressivement vers zram (rapide) plutôt
# que de tuer des process pendant un build.
# swap du noyau si nécessaire
boot.kernel.sysctl = {
"vm.swappiness" = 180; # favorise zram
"vm.swappiness" = 180;
"vm.watermark_boost_factor" = 0;
"vm.watermark_scale_factor" = 125;
"vm.page-cluster" = 0; # recommandé avec zram
"vm.page-cluster" = 0;
};
# earlyoom : tue proprement le process le plus gourmand avant que la
# machine ne se fige totalement (utile si un build déborde malgré tout).
# empêche la machine de freeze totalement si un process est trop gourmand
services.earlyoom = {
enable = true;
freeMemThreshold = 5; # agit quand il reste < 5% de RAM libre

View file

@ -1,19 +1,15 @@
{ config, pkgs, ... }:
{ ... }:
{
# ThinkPad E560 : TLP pour l'autonomie. Pas d'asusd (spécifique ASUS).
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
# Seuils de charge batterie (préserve la batterie).
# Fonctionne sur la plupart des ThinkPad via tp_smapi/acpi.
START_CHARGE_THRESH_BAT0 = 40;
STOP_CHARGE_THRESH_BAT0 = 80;
};
};
services.power-profiles-daemon.enable = false;
# Économie d'énergie supplémentaire.
powerManagement.enable = true;
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
services.pulseaudio.enable = false;
security.rtkit.enable = true;

View file

@ -1,5 +1,6 @@
{ pkgs, ... }:
{
# style global
stylix = {
enable = true;
targets.gtksourceview.enable = false;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
git

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ ... }:
{
nix.gc = {
automatic = true;

View file

@ -1,9 +1,8 @@
{ config, pkgs, ... }:
{ ... }:
{
networking = {
hostName = "nixos-laptop";
networkmanager.enable = true;
# ouvrir des ports manuellement si besoin
firewall.enable = true;
};
services = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
{
users.users.afoucaultc = {
isNormalUser = true;

View file

@ -1,13 +1,10 @@
{
config,
pkgs,
inputs,
...
}:
{ inputs, ... }:
{
imports = [
# généré à l'installation avec nixos-generate-config
# à copier dans le dossier courant depuis /etc/nixos
./hardware-configuration.nix
# ensemble de packages et configurations système
./config/bluetooth.nix
./config/boot.nix
./config/drivers_video.nix
@ -15,7 +12,6 @@
./config/fonts.nix
./config/hyprland.nix
./config/language.nix
./config/low-ram.nix
./config/power_management.nix
./config/sound.nix
./config/stylix.nix
@ -23,15 +19,22 @@
./config/system_saves.nix
./config/system_services.nix
./config/user.nix
# profil nixos-hardware pour le ThinkPad E560 (Skylake, i5-6200U)
# nécessite l'input nixos-hardware dans flake.nix.
inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
# ajout pour forcer l'utilisation de cachix au max
./config/low-ram.nix
# profil nixos-hardware pour le ThinkPad E560
# nécessite l'input nixos-hardware dans flake.nix
inputs.nixos-hardware.nixosModules.common-cpu-intel # active le microcode intel
inputs.nixos-hardware.nixosModules.common-pc-laptop # active tlp
];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
# ne pas toucher, défini une seule fois en fonction de la version de nixos de l'ISO pour la 1ère installation
system.stateVersion = "25.11";
nixpkgs.config.permittedInsecurePackages = [
"electron-39.8.10"
];
# nécessaire pour permettre des dépendances problématiques parfois
#nixpkgs.config.permittedInsecurePackages = [
# "electron-39.8.10"
#];
}

View file

@ -4,7 +4,6 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: