dotfiles/nix/home-manager/flake.nix
2024-10-20 22:04:32 -04:00

120 lines
3.8 KiB
Nix

{
description = "Home Manager configuration of acicchetti";
nixConfig = {
extra-substituters = ["https://devenv.cachix.org" "https://nixpkgs.cachix.org" "https://nix-community.cachix.org"];
extra-trusted-public-keys = ["devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" "nixpkgs.cachix.org-1:q91R6hxbwFvDqTSDKwDAV4T5PxqXGxswD8vhONFMeOE=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="];
};
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs = {url = "github:nixos/nixpkgs";};
miseNixPkgs = {url = "github:konradmalik/nixpkgs/mise";};
flake-utils.url = "github:numtide/flake-utils"; # not directly used, but common source for the several flakes that do use it
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/2ae81f2ed61ebf4ca4d4b36ea9e8eb5163380d44";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
flake-utils.follows = "flake-utils";
nixneovimplugins.follows = "nixneovimplugins";
};
};
nixneovimplugins = {
url = "github:NixNeovim/NixNeovimPlugins";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
zjstatus = {
url = "github:dj95/zjstatus";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
fenix = {
url = "github:nix-community/fenix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
wezterm = {
url = "github:wez/wezterm?dir=nix";
inputs = {
# nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = inputs @ {
self,
nixpkgs,
home-manager,
nix-index-database,
nixneovim,
nixneovimplugins,
zjstatus,
fenix,
wezterm,
miseNixPkgs,
...
}: let
supportedSystems = ["aarch64-darwin" "x86_64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (
system:
import nixpkgs {
inherit system;
config = {allowUnfree = true;};
overlays = [
(_final: prev: {
zjstatus = zjstatus.packages.${prev.system}.default;
})
(_final: prev: {
wezterm =
if (builtins.hasAttr "wezterm" inputs)
then inputs.wezterm.packages.${prev.system}.default
else prev.wezterm;
})
(_final: prev: {inherit (miseNixPkgs.legacyPackages.${prev.system}) mise;})
nixneovimplugins.overlays.default
fenix.overlays.default
];
}
);
homeManagerConfigs = forAllSystems (
system: {
pkgs = pkgs.${system};
modules = [
{
imports = [
nixneovim.nixosModules.${system}.homeManager
];
}
nix-index-database.hmModules.nix-index
./home.nix
];
}
);
in {
formatter = forAllSystems (system: pkgs.${system}.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;
};
}