From cdacdac38f8a8586b5aed2f5f27899f08207b569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Wed, 8 Apr 2026 10:58:44 +0200 Subject: [PATCH] Refactored repo layout --- flake.nix | 17 ++++++----- hosts/Heracles/configuration.nix | 12 ++++++++ hosts/Prometheus/configuration.nix | 12 ++++++++ .../Prometheus/hardware-configuration.nix | 0 configuration.nix => modules/common.nix | 30 +++++-------------- nvidia.nix => modules/nvidia.nix | 0 6 files changed, 41 insertions(+), 30 deletions(-) create mode 100644 hosts/Heracles/configuration.nix create mode 100644 hosts/Prometheus/configuration.nix rename hardware-configuration.nix => hosts/Prometheus/hardware-configuration.nix (100%) rename configuration.nix => modules/common.nix (89%) rename nvidia.nix => modules/nvidia.nix (100%) diff --git a/flake.nix b/flake.nix index c18ffc8..cd4aa5b 100644 --- a/flake.nix +++ b/flake.nix @@ -13,15 +13,16 @@ nixosConfigurations.Prometheus = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./configuration.nix - ./hardware-configuration.nix - ./nvidia.nix + ./hosts/Prometheus/configuration.nix + home-manager.nixosModules.home-manager + ]; + }; - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.typo = import ./home.nix; - } + nixosConfigurations.Heracles = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/Heracles/configuration.nix + home-manager.nixosModules.home-manager ]; }; }; diff --git a/hosts/Heracles/configuration.nix b/hosts/Heracles/configuration.nix new file mode 100644 index 0000000..62cbfa2 --- /dev/null +++ b/hosts/Heracles/configuration.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../../modules/common.nix + ]; + + networking.hostName = "Heracles"; + services.power-profiles-daemon.enable = true; +} diff --git a/hosts/Prometheus/configuration.nix b/hosts/Prometheus/configuration.nix new file mode 100644 index 0000000..61bfa61 --- /dev/null +++ b/hosts/Prometheus/configuration.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../../modules/common.nix + ../../modules/nvidia.nix + ]; + + networking.hostName = "Prometheus"; +} diff --git a/hardware-configuration.nix b/hosts/Prometheus/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/Prometheus/hardware-configuration.nix diff --git a/configuration.nix b/modules/common.nix similarity index 89% rename from configuration.nix rename to modules/common.nix index 01c171b..1890d4b 100644 --- a/configuration.nix +++ b/modules/common.nix @@ -1,19 +1,10 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - -{ config, lib, pkgs, ... }: +{ pkgs, lib, ... }: { nix.settings.experimental-features = [ "nix-command" "flakes" ]; nixpkgs.config.allowUnfree = true; - imports = - [ - ./hardware-configuration.nix - ./nvidia.nix - ]; - + boot = { loader = { grub = { @@ -49,10 +40,7 @@ loader.timeout = lib.mkForce 5; }; - networking = { - hostName = "Prometheus"; - networkmanager.enable = true; - }; + networking.networkmanager.enable = true; time.timeZone = "Europe/Budapest"; @@ -74,14 +62,12 @@ shell = pkgs.fish; }; }; - - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - #backupFileExtension = "backup"; - users.typo = import ./home.nix; - }; + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.typo = import ../home.nix; + }; programs = { # firefox.enable = true; diff --git a/nvidia.nix b/modules/nvidia.nix similarity index 100% rename from nvidia.nix rename to modules/nvidia.nix