dotfiles/nix/home-manager/flake.nix
2023-08-22 08:13:35 -04:00

74 lines
2.1 KiB
Nix

{
description = "Home Manager configuration of acicchetti";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
devenv = {
url = "github:cachix/devenv/latest";
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-doom-emacs = {
url = "github:nix-community/nix-doom-emacs";
};
nixneovim = {
url = "github:nixneovim/nixneovim";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
};
outputs = {
self,
nixpkgs,
home-manager,
devenv,
nix-doom-emacs,
nix-index-database,
nixneovim,
...
}: let
inherit (nixpkgs.lib) optionalAttrs singleton optionals;
supportedSystems = ["aarch64-darwin" "x86_64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (
system:
import nixpkgs {
inherit system;
config = {allowUnfree = true;};
overlays = [nixneovim.overlays.default];
}
);
homeManagerConfigs = forAllSystems (
system: {
pkgs = pkgs."${system}";
modules = [
{
imports = [nixneovim.nixosModules.default nix-doom-emacs.hmModule];
home.packages = [devenv.packages."${system}".devenv];
}
nix-index-database.hmModules.nix-index
./home.nix
];
}
);
in {
# formatter."${system}" = pkgs.alejandra;
homeConfigurations.aarch64-darwin-acicchetti = home-manager.lib.homeManagerConfiguration homeManagerConfigs."aarch64-darwin";
homeConfigurations.x86_64-linux-acicchetti = home-manager.lib.homeManagerConfiguration homeManagerConfigs."x86_64-linux";
defaultPackage.aarch64-darwin = self.homeConfigurations.aarch64-darwin-acicchetti.activationPackage;
defaultPackage.x86_64-linux = self.homeConfigurations.x86_64-linux-acicchetti.activationPackage;
};
}