# # These are the different profiles that can be used when building NixOS. # # flake.nix # └─ ./hosts # ├─ default.nix * # ├─ configuration.nix # ├─ home.nix # └─ ./desktop OR ./laptop OR ./vm # ├─ ./default.nix # └─ ./home.nix # { lib, inputs, nixpkgs, nixos-hardware, home-manager, nur, user, location, hyprland, ... }: let system = "x86_64-linux"; # System architecture pkgs = import nixpkgs { inherit system; config.allowUnfree = true; # Allow proprietary software }; lib = nixpkgs.lib; in { desktop = lib.nixosSystem { # Desktop profile inherit system; specialArgs = { inherit inputs user location; }; # Pass flake variable modules = [ # Modules that are used. nur.nixosModules.nur hyprland.nixosModules.default ./desktop ./configuration.nix home-manager.nixosModules.home-manager { # Home-Manager module that is used. home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit user; }; # Pass flake variable home-manager.users.${user} = { imports = [(import ./home.nix)] ++ [(import ./desktop/home.nix)]; }; } ]; }; laptop = lib.nixosSystem { # Laptop profile inherit system; specialArgs = { inherit inputs user location hyprland nixos-hardware nur; }; modules = [ nur.nixosModules.nur hyprland.nixosModules.default ./laptop ./configuration.nix nixos-hardware.nixosModules.common-cpu-intel home-manager.nixosModules.home-manager { nixpkgs.overlays = [ nur.overlay ]; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit user; }; home-manager.users.${user} = { imports = [(import ./home.nix)] ++ [(import ./laptop/home.nix)]; }; } ]; }; q920 = lib.nixosSystem { # Laptop profile inherit system; specialArgs = { inherit inputs user location hyprland; }; modules = [ hyprland.nixosModules.default ./q920 ./configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit user; }; home-manager.users.${user} = { imports = [(import ./home.nix)] ++ [(import ./q920/home.nix)]; }; } ]; }; vm = lib.nixosSystem { # VM profile inherit system; specialArgs = { inherit inputs user location; }; modules = [ ./vm ./configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit user; }; home-manager.users.${user} = { imports = [(import ./home.nix)] ++ [(import ./vm/home.nix)]; }; } ]; }; }