Add hostConfig variable to store host information

This commit is contained in:
Yorick Barbanneau 2023-09-03 01:01:33 +02:00
parent 9bc37a8d8c
commit ba4ffd6bf1
5 changed files with 63 additions and 27 deletions

View file

@ -1,5 +1,4 @@
{ config, pkgs, lib, stateVersion, hostname, username, ... }:
{ config, pkgs, lib, stateVersion, hostname, username, hostConfig, ... }:
{
imports =
[ # Include the results of the hardware scan.
@ -12,15 +11,32 @@
./includes/system/lvm.nix
./includes/system/doas.nix
./includes/system/neovim.nix
./includes/desktop/swaylock.nix
./includes/desktop/pipewire.nix
./includes/desktop/xdg-portal.nix
./includes/gaming/steam.nix
];
] ++ (
if hostConfig.desktop then
[
./includes/desktop/swaylock.nix
./includes/desktop/pipewire.nix
./includes/desktop/xdg-portal.nix
]
else []
) ++ (
if hostConfig.gaming then
[
./includes/gaming/steam.nix
]
else []
) ++ (
if hostConfig.laptop then
[
./includes/hardware/iwd.nix
]
else []
);
nixpkgs.config.allowUnfree = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = hostname;
@ -39,20 +55,26 @@
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username} = {
home.stateVersion = stateVersion;
programs.home-manager.enable = true;
imports = [
../modules/home/desktop
../modules/home/webcord.nix
../modules/home/cli
../modules/home/firefox
../modules/home/foot.nix
../modules/home/lutris.nix
../modules/home/zathura.nix
];
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit hostConfig;
};
users.${username} = {
home.stateVersion = stateVersion;
programs.home-manager.enable = true;
imports = [
../modules/home/desktop
../modules/home/webcord.nix
../modules/home/cli
../modules/home/firefox
../modules/home/foot.nix
../modules/home/zathura.nix
] ++ (
if hostConfig.gaming then
[ ../modules/home/lutris.nix ]
else []
);
};
};