nixos-config/hosts/default.nix

170 lines
5.0 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, agenix, ... }:
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 nixos-hardware nur agenix; };
2022-11-05 10:25:12 +01:00
modules = [
2023-02-04 08:50:56 +01:00
agenix.nixosModules.default
2022-09-17 16:50:50 +02:00
nur.nixosModules.nur
./desktop
2022-11-19 21:38:55 +01:00
./configuration_desktop.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;
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
2022-09-17 16:50:50 +02:00
modules = [
2023-02-04 08:50:56 +01:00
agenix.nixosModules.default
2022-10-22 16:30:31 +02:00
nur.nixosModules.nur
2022-09-17 16:50:50 +02:00
./laptop
2022-11-19 21:38:55 +01:00
./configuration_desktop.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-12-06 22:24:15 +01:00
dmz = lib.nixosSystem { # Desktop profile
2022-11-19 21:38:55 +01:00
inherit system;
#user = "dmz-user";
2022-12-17 20:20:29 +01:00
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
2022-11-19 21:38:55 +01:00
modules = [
2023-02-04 08:50:56 +01:00
agenix.nixosModules.default
2022-11-19 21:38:55 +01:00
nur.nixosModules.nur
./server
./configuration_server.nix
2022-12-06 22:24:15 +01:00
nixos-hardware.nixosModules.common-cpu-amd
2022-11-19 21:38:55 +01:00
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)];
};
}
];
};
2023-01-07 16:13:39 +01:00
nas = lib.nixosSystem { # Desktop profile
inherit system;
#user = "dmz-user";
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
2023-02-04 08:50:56 +01:00
agenix.nixosModules.default
2023-01-07 16:13:39 +01:00
nur.nixosModules.nur
./nas
./configuration_desktop.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)];
};
}
];
};
2022-11-19 21:38:55 +01:00
2022-09-18 17:11:13 +02:00
q920 = lib.nixosSystem { # Laptop profile
inherit system;
specialArgs = { inherit inputs user location ; };
2022-09-18 17:11:13 +02:00
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)];
};
}
];
};
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)];
};
}
];
};
}