From 24a749ed9d59e042b25a8295df3680d5d9e01f09 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Fri, 2 Feb 2024 21:58:06 +0100 Subject: [PATCH] Refactor --- hosts/nixos-test/default.nix | 20 ++------------------ hosts/perso-laptop/default.nix | 20 +++----------------- modules/network.nix | 11 +++++++++++ modules/plasma.nix | 15 ++++++--------- 4 files changed, 22 insertions(+), 44 deletions(-) create mode 100644 modules/network.nix diff --git a/hosts/nixos-test/default.nix b/hosts/nixos-test/default.nix index 67b03b6..4bb7e26 100644 --- a/hosts/nixos-test/default.nix +++ b/hosts/nixos-test/default.nix @@ -8,6 +8,7 @@ imports = [ ../../modules/system.nix + ../../modules/network.nix ../../modules/keymaps/us.nix ../../modules/pipewire.nix ../../modules/hyprland.nix @@ -26,22 +27,5 @@ }; }; - networking.hostName = "nixos"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; - + networking.hostName = "nixos-vm"; # Define your hostname. } diff --git a/hosts/perso-laptop/default.nix b/hosts/perso-laptop/default.nix index 861eab4..1c41123 100644 --- a/hosts/perso-laptop/default.nix +++ b/hosts/perso-laptop/default.nix @@ -8,6 +8,8 @@ imports = [ ../../modules/system.nix + ../../modules/network.nix + ../../modules/plasma.nix ../../modules/keymaps/fr.nix ../../modules/pipewire.nix @@ -19,21 +21,5 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "nixos"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the KDE Plasma Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; - + networking.hostName = "nixos-laptop-perso"; # Define your hostname. } diff --git a/modules/network.nix b/modules/network.nix new file mode 100644 index 0000000..969179a --- /dev/null +++ b/modules/network.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: +{ + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; +} diff --git a/modules/plasma.nix b/modules/plasma.nix index 38428e1..3978e67 100644 --- a/modules/plasma.nix +++ b/modules/plasma.nix @@ -1,12 +1,9 @@ -{ pkgs, inputs, ... }: +{ config, pkgs, ... }: { - programs.hyprland = { - enable = true; - xwayland.enable = true; - }; + # Enable the X11 windowing system. + services.xserver.enable = true; - services.udisks2 = { - enable = true; - mountOnMedia = true; - }; + # Enable the KDE Plasma Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; }