add config for work.nix

This commit is contained in:
2025-09-25 20:36:34 +02:00
parent c3289c173e
commit 18491dd596
18 changed files with 268 additions and 34 deletions

View File

@@ -6,7 +6,7 @@
disk = {
main = {
type = "disk";
device = "/dev/vda";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {

View File

@@ -36,21 +36,4 @@
];
};
};
## Enable virtualisation guest settings
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
services.xserver = {
videoDrivers = [ "modesetting" ]; # Driver vidéo optimisé pour QEMU/KVM
};
environment.systemPackages = [
pkgs.spice-gtk # Outils SPICE
pkgs.spice-protocol # Protocoles SPICE
];
#fileSystems."/" = {
# device = "/dev/vda2"; # Disque virtuel typique
# fsType = "btrfs";
#};
}

View File

@@ -6,7 +6,7 @@
disk = {
main = {
type = "disk";
device = "/dev/vda";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {

View File

@@ -0,0 +1,38 @@
{
pkgs,
username,
hostname,
modulesPath,
inputs,
...
}:
{
system.stateVersion = "25.11";
imports = builtins.trace "${inputs.mysecrets}" [
(modulesPath + "/installer/scan/not-detected.nix")
./network.nix
./hardware-configuration.nix
../../modules/core
../../modules/optionnals/hosts/${hostname}.nix
];
boot.kernelPackages = pkgs.linuxPackages_latest;
time.timeZone = "Europe/Paris";
nix = {
settings = {
## Enable flakes
experimental-features = [
"nix-command"
"flakes"
];
## Users trusted to use flake command
trusted-users = [
"root"
"${username}"
];
};
};
}

View File

@@ -0,0 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/mapper/rootfs";
fsType = "btrfs";
options = [ "discard=async" "compress=zstd" ];
};
boot.initrd.luks.devices."rootfs" = {
device = "/dev/disk/by-uuid/6b1c7ee5-6489-4c47-bb8b-2e663e493aed";
allowDiscards = true;
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/B210-971B";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -0,0 +1,11 @@
{
hostname,
...
}:
{
networking = {
hostName = "${hostname}";
networkmanager.enable = true;
firewall.enable = true;
};
}