From c890bb46da2b4b6428368cfcef00b32fe2c6092b Mon Sep 17 00:00:00 2001 From: Alexandre1a Date: Wed, 14 Jan 2026 19:06:18 +0100 Subject: [PATCH] Added a new host, a lightweight config --- hosts/common/modules.nix | 6 ++++++ hosts/light/configuration.nix | 7 +++++++ hosts/macos/configuration.nix | 19 +------------------ hosts/nixos/configuration.nix | 27 --------------------------- modules/common/nix.nix | 28 ++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 45 deletions(-) create mode 100644 hosts/common/modules.nix create mode 100644 hosts/light/configuration.nix create mode 100644 modules/common/nix.nix diff --git a/hosts/common/modules.nix b/hosts/common/modules.nix new file mode 100644 index 0000000..df4817d --- /dev/null +++ b/hosts/common/modules.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ../../modules/common/nix.nix + ../../modules/nixos/locale.nix + ]; +} \ No newline at end of file diff --git a/hosts/light/configuration.nix b/hosts/light/configuration.nix new file mode 100644 index 0000000..c1dbc9c --- /dev/null +++ b/hosts/light/configuration.nix @@ -0,0 +1,7 @@ +{ pkg, config, ... }: +{ + imports = [ + ./modules.nix + ]; + +} diff --git a/hosts/macos/configuration.nix b/hosts/macos/configuration.nix index ac6c463..409fe02 100644 --- a/hosts/macos/configuration.nix +++ b/hosts/macos/configuration.nix @@ -62,24 +62,7 @@ # Enable required settings # TouchID login security.pam.services.sudo_local.touchIdAuth = true; - # Flakes - nix = { - settings = { - experimental-features = [ "nix-command" "flakes" ]; - - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://hyprland.cachix.org" - ]; - - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - ]; - }; - }; + # Target arch nixpkgs = { hostPlatform = "aarch64-darwin"; diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index 531c95b..6c7c2e1 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -18,33 +18,6 @@ networking.hostName = "nixos"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # Enable Flakes - nix = { - settings = { - experimental-features = [ "nix-command" "flakes" ]; - - # Limit resource usage to prevent OOM kill - max-jobs = 2; - cores = 4; - - # Prevent hanging builds - max-silent-time = 3600; - timeout = 1800; - - # Package caches - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://hyprland.cachix.org" - ]; - - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - ]; - }; - }; # Enables SDDM services = { diff --git a/modules/common/nix.nix b/modules/common/nix.nix new file mode 100644 index 0000000..de3e7d2 --- /dev/null +++ b/modules/common/nix.nix @@ -0,0 +1,28 @@ +{ config, ... }: +{ + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + + # Limit resource usage to prevent Linux OOM + max-jobs = 2; + cores = 4; + + max-silent-time = 3600; + timeout = 1800; + + # Package caches + substituters = [ + "https://cache.nixos.org"; + "https://nix-community.cachix.org" + "https://hyprland.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + ]; + }; + }; +} \ No newline at end of file