home-manager/flake.nix

105 lines
2.4 KiB
Nix

{
description = "Home Manager configuration of kristian";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix User Repository
nur.url = "github:nix-community/NUR";
# Zig
zig.url = "github:mitchellh/zig-overlay";
# Wallpaper
wallpaper.url = "github:lunik1/nix-wallpaper";
# Nix index
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
nixpkgs-master,
home-manager,
nur,
zig,
wallpaper,
nix-index-database,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
formatter.${system} = pkgs.alejandra;
commonModules = [
./common
{
_module.args.wallpaper = wallpaper.packages.${system}.default;
}
nur.nixosModules.nur
nix-index-database.hmModules.nix-index
{
programs.nix-index-database.comma.enable = true;
}
{
nixpkgs.overlays = [
zig.overlays.default # Add zig
( # https://github.com/nix-community/home-manager/issues/1538#issuecomment-706627100
final: prev: {
unstable = import nixpkgs-unstable {
system = final.system;
config.allowUnfreePredicate = _: true;
};
master = import nixpkgs-master {
system = final.system;
config.allowUnfreePredicate = _: true;
};
}
)
( # Overrides davinci-resolve with the unstable version because of https://github.com/NixOS/nixpkgs/pull/246074
final: prev: {davinci-resolve = final.master.davinci-resolve;}
)
];
}
];
homeConfigurations = {
pc = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules =
[
./pc
]
++ self.commonModules;
};
laptop = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules =
[
./laptop
]
++ self.commonModules;
};
};
};
}