nixos-config/hosts/default.nix

226 lines
6.9 KiB
Nix

#
# 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, agenix, jovian-nixos, ... }:
let
system = "x86_64-linux"; # System architecture
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true; # Allow proprietary software
};
lib = nixpkgs.lib;
users.defaultShell = "pkgs.zsh";
in
{
desktop = lib.nixosSystem { # Desktop profile
inherit system;
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./desktop
./configuration_desktop.nix
../modules/hardware/remoteBuilder.nix
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-gpu-amd
nixos-hardware.nixosModules.common-pc-ssd
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 ./desktop/home.nix)];
};
}
];
};
laptop = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./laptop
./configuration_desktop.nix
../modules/hardware/remoteClient.nix
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-gpu-intel
nixos-hardware.nixosModules.common-pc-ssd
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)];
};
}
];
};
steamdeck = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location nixos-hardware nur agenix jovian-nixos; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./steamdeck
./configuration_desktop.nix
../modules/hardware/remoteClient.nix
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-gpu-amd
nixos-hardware.nixosModules.common-pc-ssd
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 ./steamdeck/home.nix)];
};
}
];
};
dmz = lib.nixosSystem { # Desktop profile
inherit system;
#user = "dmz-user";
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./server
./configuration_server.nix
nixos-hardware.nixosModules.common-cpu-amd
nixos-hardware.nixosModules.common-pc-ssd
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_server.nix)] ++ [(import ./server/home.nix)];
};
}
];
};
nas = lib.nixosSystem { # Desktop profile
inherit system;
#user = "dmz-user";
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./nas
./configuration_desktop.nix
../modules/hardware/remoteClient.nix
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc-ssd
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_server.nix)] ++ [(import ./nas/home.nix)];
};
}
];
};
jupiter = lib.nixosSystem { # Desktop profile
inherit system;
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./jupiter
./configuration_desktop.nix
../modules/hardware/remoteClient.nix
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc-ssd
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_server.nix)] ++ [(import ./jupiter/home.nix)];
};
}
];
};
q920 = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location ; };
modules = [
./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)];
};
}
];
};
}