dotfiles/nix/home-manager/flake.nix
2024-03-22 14:25:36 -04:00

75 lines
2.1 KiB
Nix

{
description = "Home Manager configuration of acicchetti";
nixConfig = {
extra-substituters = ["https://devenv.cachix.org"];
extra-trusted-public-keys = ["devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="];
};
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixOS/nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nixneovim = {
url = "github:nixneovim/nixneovim";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
};
outputs = {
self,
nixpkgs,
home-manager,
nix-index-database,
# emacs-overlay,
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
# emacs-overlay.overlays.default
];
}
);
homeManagerConfigs = forAllSystems (
system: {
pkgs = pkgs."${system}";
modules = [
{
imports = [nixneovim.nixosModules.default];
home.packages = [];
}
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;
};
}