nixos-config/hosts/default.nix

118 lines
3.4 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, nixos-hardware, home-manager, nur, user, location, hyprland, ... }:
2022-09-17 16:50:50 +02:00
let
system = "x86_64-linux"; # System architecture
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true; # Allow proprietary software
};
lib = nixpkgs.lib;
2022-11-01 21:31:56 +01:00
2022-09-17 16:50:50 +02:00
in
{
2022-11-05 10:25:12 +01:00
desktop = lib.nixosSystem { # Desktop profile
2022-09-17 16:50:50 +02:00
inherit system;
specialArgs = { inherit inputs user location hyprland nixos-hardware nur; };
2022-11-05 10:25:12 +01:00
modules = [
2022-09-17 16:50:50 +02:00
nur.nixosModules.nur
2022-11-05 10:25:12 +01:00
#hyprland.nixosModules.default
2022-09-17 16:50:50 +02:00
./desktop
./configuration.nix
2022-11-05 10:25:12 +01:00
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-gpu-amd
nixos-hardware.nixosModules.common-pc-ssd
2022-09-17 16:50:50 +02:00
2022-11-05 10:25:12 +01:00
home-manager.nixosModules.home-manager {
nixpkgs.overlays = [
nur.overlay
];
2022-09-17 16:50:50 +02:00
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2022-11-05 10:25:12 +01:00
home-manager.extraSpecialArgs = { inherit user; };
2022-09-17 16:50:50 +02:00
home-manager.users.${user} = {
2022-11-05 10:25:12 +01:00
imports = [(import ./home.nix)] ++ [(import ./desktop/home.nix)];
2022-09-17 16:50:50 +02:00
};
}
];
};
laptop = lib.nixosSystem { # Laptop profile
inherit system;
2022-11-01 21:31:56 +01:00
specialArgs = { inherit inputs user location hyprland nixos-hardware nur; };
2022-09-17 16:50:50 +02:00
modules = [
2022-10-22 16:30:31 +02:00
nur.nixosModules.nur
2022-11-05 10:25:12 +01:00
#hyprland.nixosModules.default
2022-09-17 16:50:50 +02:00
./laptop
./configuration.nix
nixos-hardware.nixosModules.common-cpu-intel
2022-11-05 10:25:12 +01:00
nixos-hardware.nixosModules.common-gpu-intel
nixos-hardware.nixosModules.common-pc-ssd
2022-09-17 16:50:50 +02:00
home-manager.nixosModules.home-manager {
2022-11-01 21:31:56 +01:00
nixpkgs.overlays = [
nur.overlay
];
2022-09-17 16:50:50 +02:00
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-17 16:50:50 +02:00
};
}
];
};
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)];
};
}
];
};
}