nix-config-v2/flake.nix

81 lines
2.2 KiB
Nix

{
description = "Wyatt's nix configuration suite";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-24.05-darwin";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs-darwin";
};
};
outputs = inputs @ {
self,
nixpkgs,
nix-flatpak,
darwin,
home-manager,
...
}: let
userName = "wyatt";
userEmail = "wyatt@wyattjmiller.com";
extraSpecialArgs = {
inherit userName userEmail;
};
in {
# Primary laptop - MacBook Pro (2023, M3)
darwinConfigurations."sephiroth" = darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit userName userEmail;
hostname = "sephiroth";
};
modules = [
./modules/nix-core.nix
./modules/darwin/configuration.nix
./modules/darwin/apps.nix
./modules/host-users.nix
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = extraSpecialArgs;
home-manager.users.${userName} = import ./home;
}
];
};
# Primary desktop computer
nixosConfiguration."cloud" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit userName userEmail;
hostname = "cloud";
};
modules = [
/etc/nixos/configuration.nix
./modules/nix-core.nix
./modules/nixos/configuration.nix
./modules/host-users.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = extraSpecialArgs;
home-manager.users.${userName}.imports = [
nix-flatpak.homeManagerModules.nix-flatpak
./home
];
}
];
};
};
}