From d845e14b370f488305def2e29fbf8042ace6a17a Mon Sep 17 00:00:00 2001 From: Sasza Stanczew Date: Tue, 10 Feb 2026 13:02:11 +0100 Subject: [PATCH] Lepsza iomplementacja flake - NOT TESTED --- flake.nix | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 41667fd..f71cd50 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Arch-like NixOS Config"; + description = "Konfiguracja wielu maszyn na raz"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # Bleeding edge! @@ -9,16 +9,34 @@ }; }; - outputs = { self, nixpkgs, home-manager, ... }: { - nixosConfigurations.nix-latitude = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; + outputs = { self, nixpkgs, home-manager, ... }: + let # pomocnicza funkcja + mk_system = system: hostname: modules: nixpkgs.lib.nixosSystem { + inherit system; modules = [ - ./configuration.nix + { networking.hostName = hostname; } + /etc/nixos/configuration.nix + ./common.nix + # home manager home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.sasza = import ./home.nix; } + ] ++ modules; + }; + in { + nixosConfigurations = { + nix-latitude = mkSystem "x86_64-linux" "nix-latitude" [ + ./modules/network.nix + ./modules/office.nix + ]; + + nix-gaming = mkSystem "x86_64-linux" "nix-gaming" [ + ./modules/gaming.nix + ./modules/network.nix + ./modules/office.nix + ./modules/3dprint.nix ]; }; };