nixos-config/hosts/default.nix

103 lines
3.1 KiB
Nix
Raw Normal View History

2022-09-17 16:50:50 +02:00
#
# 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, 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; };
modules = [
hyprland.nixosModules.default
./laptop
./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 ./laptop/home.nix)];
};
}
];
};
2022-09-18 17:11:13 +02:00
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)];
};
}
];
};
2022-09-17 16:50:50 +02:00
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)];
};
}
];
};
}