diff --git a/Droidnix/assets/flake/machines/traveldroid/top.nix b/Droidnix/assets/flake/machines/traveldroid/top.nix index 382ba107a..99a1efe43 100644 --- a/Droidnix/assets/flake/machines/traveldroid/top.nix +++ b/Droidnix/assets/flake/machines/traveldroid/top.nix @@ -1,4 +1,12 @@ -{ config, pkgs, lib, user, inputs, flakeRoot,... }: +{ + config, + pkgs, + lib, + user, + inputs, + flakeRoot, + ... +}: { imports = [ @@ -22,7 +30,10 @@ # User configuration users.users.${user.username} = { isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; + extraGroups = [ + "wheel" + "networkmanager" + ]; hashedPassword = user.hashedPassword; home = user.homeDirectory; }; diff --git a/Droidnix/flake.nix b/Droidnix/flake.nix index 46daa7df3..7f6794250 100644 --- a/Droidnix/flake.nix +++ b/Droidnix/flake.nix @@ -49,35 +49,13 @@ inherit system; modules = [ # Import machine-specific configurations - ./assets/flake/machines/${machine}/top.nix - - # Home Manager module - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - inherit user inputs; - flakeRoot = ./.; - }; - } + ./machine.nix # Catppuccin theme module inputs.catppuccin.nixosModules.catppuccin # Anchoring all the other nixes ./generated/top.nix - - # Enable Home Manager for the user - ( - { config, pkgs, ... }: - { - home-manager.users.${user.username} = { - enable = true; - homeDirectory = "/home/${user.username}"; - }; - } - ) ]; specialArgs = { inherit user inputs; @@ -96,163 +74,7 @@ in home-manager.lib.homeManagerConfiguration { inherit system; - configuration = import ./assets/flake/users/${username}/home.nix { - inherit inputs user; - pkgs = import nixpkgs { inherit system; }; - }; - extraSpecialArgs = { - inherit user inputs; - flakeRoot = ./.; - }; - } - ); - - devShells.${system}.default = import ./assets/flake/terminal_shell/devshell.nix { - inherit (nixpkgs.legacyPackages.${system}) mkShell; - }; - }; -} - -{ config, pkgs, lib, user, inputs, flakeRoot,... }: - -{ - imports = [ - ./boot.nix - ./hardware-configuration.nix - ]; - - options = { - wm = lib.mkOption { - type = lib.types.str; - default = "hyprland"; - description = "Type of window manager to use"; - }; - }; - - config = { - # Minimal settings that must be defined here - networking.hostName = "traveldroid"; - wm.type = "hyprland"; - - # User configuration - users.users.${user.username} = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - hashedPassword = user.hashedPassword; - home = user.homeDirectory; - }; - - # Optional: Enable auto-login for testing - services.getty.autologinUser = user.username; - }; -} - -{ - username = "henrov"; - hashedPassword = "$6$ISAmsPLyFi7idYXr$VmZsq.zMsyh1irSkyDNqtorNXG0oEHbbMVqTii1t8bymvrQ5ZQmbdi4OiBNeNYe/huHGrojXM.3TST2fTLz0T."; - homeDirectory = "/home/henrov"; - stateVersion = "25.11"; - locale = "nl_NL.UTF-8"; -} -{ - description = "Droidnix: A dendritic NixOS + Home Manager configuration"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - emacs-overlay = { - url = "github:nix-community/emacs-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - catppuccin = { - url = "github:catppuccin/nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - zen-browser = { - url = "github:youwen5/zen-browser-flake"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - hyprland.url = "github:hyprwm/Hyprland"; - }; - - outputs = - inputs@{ - self, - nixpkgs, - home-manager, - emacs-overlay, - catppuccin, - zen-browser, - hyprland, - ... - }: - let - lib = nixpkgs.lib; - system = "x86_64-linux"; - user = import ./assets/flake/users/henrov.nix; - machines = [ - "traveldroid" - "maindroid" - ]; - in - { - nixosConfigurations = lib.genAttrs machines ( - machine: - lib.nixosSystem { - inherit system; - modules = [ - # Import machine-specific configurations - ./assets/flake/machines/${machine}/top.nix - - # Home Manager module - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { - inherit user inputs; - flakeRoot = ./.; - }; - } - - # Catppuccin theme module - inputs.catppuccin.nixosModules.catppuccin - - # Anchoring all the other nixes - ./generated/top.nix - - # Enable Home Manager for the user - ( - { config, pkgs, ... }: - { - home-manager.users.${user.username} = { - enable = true; - homeDirectory = "/home/${user.username}"; - }; - } - ) - ]; - specialArgs = { - inherit user inputs; - flakeRoot = ./.; - }; - } - ); - - # Home Manager configurations for each user/machine - homeConfigurations = lib.genAttrs (map (machine: user.username + "@" + machine) machines) ( - userMachine: - let - parts = lib.splitString "@" userMachine; - username = builtins.elemAt parts 0; - machine = builtins.elemAt parts 1; - in - home-manager.lib.homeManagerConfiguration { - inherit system; - configuration = import ./assets/flake/users/${username}/home.nix { + configuration = import ./user.nix { inherit inputs user; pkgs = import nixpkgs { inherit system; }; };