From 7da9c00d714b27ae92fceff8e3d5fad77077ab86 Mon Sep 17 00:00:00 2001 From: "Mohamed C." Date: Fri, 16 Aug 2024 16:37:35 +0200 Subject: [PATCH] format --- flake.nix | 164 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 108 insertions(+), 56 deletions(-) diff --git a/flake.nix b/flake.nix index 28243d5..79a13e4 100644 --- a/flake.nix +++ b/flake.nix @@ -15,63 +15,115 @@ }; }; # Define Outputs, import Modules - outputs = { nixpkgs, home-manager, jovian, plasma-manager, ...}: - let - # Define system globally since I have no aarch devices - system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system;}; - lib = nixpkgs.lib; - # NixOS Modules for all hosts - systemModules = [ - home-manager.nixosModules.home-manager - ./modules/system/apps-shell - ./modules/system/boot - ./modules/system/devices - ./modules/system/locale - ./modules/system/networking - ./modules/system/nixsettings - ./modules/system/shell - ./modules/system/systemversion - ./modules/system/upgrades - ./modules/system/users - ]; - # Home Manager Modules for all hosts - userModules = [ - ./modules/user/git - ./modules/user/homeversion - ]; - in - { - - nixosConfigurations = { - # user and hostName variable inside hostConfig so we can call it in other modules - computer-mo = let - user = "mo"; - hostName = "computer-mo"; - in lib.nixosSystem { - specialArgs = {inherit systemModules; inherit userModules; inherit system; inherit user; inherit hostName;}; - system = system; - # Device specific NixOS Modules - modules = systemModules ++ [ - jovian.nixosModules.jovian - ./hosts/${hostName} - ./modules/system/apps-misc - ./modules/system/browser - ./modules/system/controller - ./modules/system/jovian-desktop - ./modules/system/lact - ./modules/system/plasma - ./modules/system/steam - { - # Device specific Home Manager Modules - home-manager.users.${user}.imports = userModules ++ [ - ./modules/user/plasma + outputs = + { + nixpkgs, + home-manager, + jovian, + plasma-manager, + ... + }: + let + # Define system globally since I have no aarch devices + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + lib = nixpkgs.lib; + # NixOS Modules for all hosts + systemModules = [ + home-manager.nixosModules.home-manager + ./modules/system/apps-shell + ./modules/system/boot + ./modules/system/devices + ./modules/system/locale + ./modules/system/networking + ./modules/system/nixsettings + ./modules/system/shell + ./modules/system/systemversion + ./modules/system/upgrades + ./modules/system/users + ]; + # Home Manager Modules for all hosts + userModules = [ + ./modules/user/git + ./modules/user/homeversion + ]; + in + { + nixosConfigurations = { + # Workstation config + # user and hostName variable inside hostConfig so we can call it in other modules + computer-mo = + let + user = "mo"; + hostName = "computer-mo"; + in + lib.nixosSystem { + specialArgs = { + inherit systemModules; + inherit userModules; + inherit system; + inherit user; + inherit hostName; + }; + system = system; + # Device specific NixOS Modules + modules = systemModules ++ [ + jovian.nixosModules.jovian + ./hosts/${hostName} + ./modules/system/apps-misc + ./modules/system/browser + ./modules/system/controller + ./modules/system/jovian-desktop + ./modules/system/lact + ./modules/system/plasma + ./modules/system/steam + { + # Device specific Home Manager Modules + home-manager.users.${user}.imports = userModules ++ [ + ./modules/user/plasma + ]; + # Issue with Plasma Manager, has to be imported in a special way + home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; + } ]; - # Issue with Plasma Manager, has to be imported in a special way - home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; - } - ]; + }; }; + # Steamdeck config + # user and hostName variable inside hostConfig so we can call it in other modules + steamdeck = + let + user = "deck"; + hostName = "steamdeck"; + in + lib.nixosSystem { + specialArgs = { + inherit systemModules; + inherit userModules; + inherit system; + inherit user; + inherit hostName; + }; + system = system; + # Device specific NixOS Modules + modules = systemModules ++ [ + jovian.nixosModules.jovian + ./hosts/${hostName} + ./modules/system/apps-misc + ./modules/system/browser + ./modules/system/controller + ./modules/system/jovian-desktop + ./modules/system/lact + ./modules/system/plasma + ./modules/system/steam + { + # Device specific Home Manager Modules + home-manager.users.${user}.imports = userModules ++ [ + ./modules/user/plasma + ]; + # Issue with Plasma Manager, has to be imported in a special way + home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; + } + ]; + }; }; - }; }