nixos-config/flake.nix

45 lines
1.2 KiB
Nix

{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
home-manager = {
url = github:nix-community/home-manager/release-22.05;
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { self, nixpkgs, home-manager, ... }:
let
user = "mandlm";
theme = "dark"; # dark or light
buildMachineConfig = machineName: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [
./configuration.nix
./users.nix
./machines/${machineName}/configuration.nix
./machines/${machineName}/hardware-configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user theme; };
home-manager.users.${user} = {
imports = [ ./home-${user}.nix ];
};
}
];
};
in
{
nixosConfigurations = {
nixos-vm = buildMachineConfig ("nixos-vm");
apache = buildMachineConfig ("apache");
p330 = buildMachineConfig ("p330");
};
};
}