Files
dotfiles/nix/flake.nix
2024-09-28 08:38:25 -07:00

46 lines
1.3 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
emacs-lsp-booster.url = "github:slotThe/emacs-lsp-booster-flake";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
emacs-lsp-booster.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
utils,
home-manager,
emacs-lsp-booster,
...}: let
pkgsForSystem = (system: import nixpkgs {
inherit system;
overlays = [
emacs-lsp-booster.overlays.default
];
config.allowUnfree = true;
});
mkHomeConfig = ({system, username ? "ttm" }: home-manager.lib.homeManagerConfiguration {
pkgs = pkgsForSystem system;
modules = [
./home.nix
{
home = {
inherit username;
};
# Pin nixpkgs flake to local nix registry so it gets used by commands like nix-shell
# https://discourse.nixos.org/t/local-flake-based-nix-search-nix-run-and-nix-shell/13433/12
nix.registry.nixpkgs.flake = nixpkgs;
}
];
});
in
utils.lib.eachDefaultSystem (system: {
legacyPackages.homeConfigurations.std = mkHomeConfig { inherit system; };
});
}