From d5404e54aaa09a85523ff978ba4281ddc5fe3d35 Mon Sep 17 00:00:00 2001 From: Henri Saudubray Date: Thu, 22 Jan 2026 10:17:38 +0100 Subject: [PATCH] fix (nixos)!: remove baremetal option --- hosts/elistraee/default.nix | 4 +-- hosts/selune/default.nix | 5 ++-- hosts/shar/default.nix | 5 ++-- nixos/baremetal.nix | 47 ++++++++++++++++--------------- nixos/{default.nix => common.nix} | 6 ---- nixos/graphical.nix | 4 +-- nixos/wsl.nix | 12 +++----- 7 files changed, 35 insertions(+), 48 deletions(-) rename nixos/{default.nix => common.nix} (93%) diff --git a/hosts/elistraee/default.nix b/hosts/elistraee/default.nix index c0eb18c..0824ce5 100644 --- a/hosts/elistraee/default.nix +++ b/hosts/elistraee/default.nix @@ -1,8 +1,6 @@ { pkgs, ... }: { - imports = [ ../../nixos ]; - - nixos-wsl.enable = true; # Enables wsl configuration (nixos/wsl.nix). + imports = [ ../../nixos/wsl.nix ]; networking.hostName = "elistraee"; system.stateVersion = "25.05"; diff --git a/hosts/selune/default.nix b/hosts/selune/default.nix index 9e14524..ce20269 100644 --- a/hosts/selune/default.nix +++ b/hosts/selune/default.nix @@ -1,12 +1,11 @@ { ... }: { imports = [ - ../../nixos + ../../nixos/baremetal.nix ./hardware-configuration.nix ]; - baremetal.enable = true; # Enables baremetal features (nixos/baremetal.nix). - graphical.enable = true; # Enables graphical features (nixos/graphical.nix). + graphical.enable = true; boot.initrd.luks.devices."luks-374c6259-18c4-462b-9f30-9c9648de00ae".device = "/dev/disk/by-uuid/374c6259-18c4-462b-9f30-9c9648de00ae"; diff --git a/hosts/shar/default.nix b/hosts/shar/default.nix index f584443..3b3149d 100644 --- a/hosts/shar/default.nix +++ b/hosts/shar/default.nix @@ -1,12 +1,11 @@ { ... }: { imports = [ - ../../nixos + ../../nixos/baremetal.nix ./hardware-configuration.nix ]; - baremetal.enable = true; # Enables baremetal features (nixos/baremetal.nix). - graphical.enable = true; # Enables graphical features (nixos/graphical.nix). + graphical.enable = true; boot.initrd.luks.devices."luks-324ce23c-e630-42a1-8558-184e999053a5".device = "/dev/disk/by-uuid/324ce23c-e630-42a1-8558-184e999053a5"; diff --git a/nixos/baremetal.nix b/nixos/baremetal.nix index 83fb8bc..c946239 100644 --- a/nixos/baremetal.nix +++ b/nixos/baremetal.nix @@ -1,27 +1,28 @@ -{ pkgs, lib, config, ... }: +{ pkgs, ... }: { - options = { - baremetal.enable = lib.mkEnableOption "enables bare metal features"; + imports = [ + ./common.nix + ./graphical.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.networkmanager = { + enable = true; + }; + users.users.hms.extraGroups = [ "networkmanager" ]; + + services.printing.enable = true; + + services.pulseaudio.enable = false; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; }; - config = lib.mkIf config.baremetal.enable { - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.kernelPackages = pkgs.linuxPackages_latest; - - networking.networkmanager.enable = true; - users.users.hms.extraGroups = [ "networkmanager" ]; - - services.printing.enable = true; - - services.pulseaudio.enable = false; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - console.keyMap = "fr"; - }; + console.keyMap = "fr"; } diff --git a/nixos/default.nix b/nixos/common.nix similarity index 93% rename from nixos/default.nix rename to nixos/common.nix index 2ee34ac..3203c0e 100644 --- a/nixos/default.nix +++ b/nixos/common.nix @@ -1,11 +1,5 @@ { pkgs, ... }: { - imports = [ - ./baremetal.nix - ./wsl.nix - ./graphical.nix - ]; - nix.settings.experimental-features = "nix-command flakes"; system.autoUpgrade.enable = true; diff --git a/nixos/graphical.nix b/nixos/graphical.nix index 51a3291..cffb0a9 100644 --- a/nixos/graphical.nix +++ b/nixos/graphical.nix @@ -1,7 +1,7 @@ -{ pkgs, lib, config, ... }: +{ lib, config, ... }: { options = { - graphical.enable = lib.mkEnableOption "enables graphical features"; + graphical.enable = lib.mkEnableOption "Enable graphical features"; }; config = lib.mkIf config.graphical.enable { diff --git a/nixos/wsl.nix b/nixos/wsl.nix index 19dc98c..07fafd1 100644 --- a/nixos/wsl.nix +++ b/nixos/wsl.nix @@ -1,11 +1,7 @@ -{ pkgs, lib, config, ... }: +{ ... }: { - options = { - nixos-wsl.enable = lib.mkEnableOption "enables WSL support"; - }; + imports = [ ./common.nix ]; - config = lib.mkIf config.nixos-wsl.enable { - wsl.enable = true; - wsl.defaultUser = "hms"; - }; + wsl.enable = true; + wsl.defaultUser = "hms"; }