From a52e554770bfe27147370d4ae50a14d3ee92209e Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Fri, 19 Jun 2026 06:07:08 +0200 Subject: [PATCH] move laptop to x13-mairie --- README.md | 31 +++++++++++++++++++ flake.nix | 4 +-- .../{nixos-laptop => x13-mairie}/default.nix | 2 +- hosts/{nixos-laptop => x13-mairie}/users.nix | 0 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 README.md rename hosts/{nixos-laptop => x13-mairie}/default.nix (92%) rename hosts/{nixos-laptop => x13-mairie}/users.nix (100%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..6a2a3da --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# nixos-config + +Configuration NixOS multi-machines gérée par flake. + +## Machines + +| Host | Fichier | Description | +|------|---------|-------------| +| `nixos-desktop` | `hosts/nixos-desktop/` | Desktop AMD, Hyprland, Steam, Ollama | +| `x13-mairie` | `hosts/x13-mairie/` | Laptop ThinkPad X13, Hyprland | + +## Commandes + +```bash +# Appliquer la configuration +sudo nixos-rebuild switch --flake .#nixos-desktop +sudo nixos-rebuild switch --flake .#x13-mairie + +# Tester sans activer (rollback automatique au reboot) +sudo nixos-rebuild test --flake .#x13-mairie + +# Mettre à jour les inputs du flake +nix flake update +``` + +## Ajouter une nouvelle machine + +1. Créer `hosts//default.nix` et `hosts//users.nix` +2. Copier la hardware config : `nixos-generate-config --show-hardware-config > hosts//hardware-configuration.nix` +3. Déclarer le host dans `flake.nix` +4. `sudo nixos-rebuild switch --flake .#` diff --git a/flake.nix b/flake.nix index ba7ea89..29b90ef 100644 --- a/flake.nix +++ b/flake.nix @@ -27,13 +27,13 @@ ]; }; - nixosConfigurations.nixos-laptop = nixpkgs.lib.nixosSystem { + nixosConfigurations.x13-mairie = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { pkgs-unstable = nixpkgs-unstable.legacyPackages.x86_64-linux; }; modules = [ - ./hosts/nixos-laptop + ./hosts/x13-mairie { nixpkgs.config.allowUnfree = true; nixpkgs.overlays = [ claude-code.overlays.default ]; diff --git a/hosts/nixos-laptop/default.nix b/hosts/x13-mairie/default.nix similarity index 92% rename from hosts/nixos-laptop/default.nix rename to hosts/x13-mairie/default.nix index 6867836..f984e01 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/x13-mairie/default.nix @@ -14,7 +14,7 @@ ../../modules/desktop/packages.nix ]; - networking.hostName = "nixos-laptop"; + networking.hostName = "x13-mairie"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/hosts/nixos-laptop/users.nix b/hosts/x13-mairie/users.nix similarity index 100% rename from hosts/nixos-laptop/users.nix rename to hosts/x13-mairie/users.nix