about summary refs log blame commit diff
path: root/hosts/default.nix
blob: 289caa5c64d34e7cbbf3e1e76aa60d7cc60d0363 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

                                                       











                                                               
                                                                 


                             
                              






                                              
                                                    





                                                                              

                                                                                   

  

                                            
 
{ user, lib, nixpkgs, nur, inputs, home-manager, ... }:
let
  mkHost = hostname: system:
    let
      pkgs = import nixpkgs {
        inherit system;
        config.allowUnfree = true; # Allow proprietary software
        overlays = [
          nur.overlay
          (import ../packages)
          (import ../overlays)
        ];
      };
      secrets = import ../secrets;
      extraArgs = { inherit pkgs inputs user secrets hostname; };
    in
    nixpkgs.lib.nixosSystem {
      inherit system;
      specialArgs = extraArgs;
      modules = [
        ./configuration.nix
        ./${hostname}
        home-manager.nixosModules.home-manager
        {
          home-manager.useGlobalPkgs = true;
          home-manager.useUserPackages = true;
          home-manager.extraSpecialArgs = extraArgs;
          home-manager.users.${user} = {
            imports = [ ./home.nix ] ++ [ (import ./${ hostname }/home.nix) ];
          };
        }
      ];
    };
in
let hosts = [ "baitinq" "vm" ]; #TODO: generate from here. List to set + apply func
in
{
  baitinq = mkHost "baitinq" "x86_64-linux";
  vm = mkHost "vm" "x86_64-linux";
}