dotfiles/nix/home-manager/flake.nix
Anthony Cicchetti f0e371cda2 updates
2025-02-25 09:38:50 -05:00

116 lines
3.1 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";
};
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";
};
ghostty = {
url = "github:ghostty-org/ghostty";
inputs.nixpkgs-unstable.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs = {
# nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
nixneovimplugins = {
url = "github:m15a/flake-awesome-neovim-plugins";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
fenix = {
url = "github:nix-community/fenix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs =
{
self,
nixpkgs,
home-manager,
nix-index-database,
nixvim,
fenix,
nixneovimplugins,
ghostty,
...
}:
let
supportedSystems = [
"aarch64-darwin"
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (
system:
import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
overlays = [
ghostty.overlays.default
nixneovimplugins.overlays.default
fenix.overlays.default
];
}
);
homeManagerConfigs = forAllSystems (system: {
pkgs = pkgs.${system};
modules = [
{
imports = [
nixvim.homeManagerModules.nixvim
];
}
nix-index-database.hmModules.nix-index
./home.nix
];
});
in
{
formatter = forAllSystems (system: pkgs.${system}.nixfmt-rfc-style);
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;
};
}