feat: let home-manager manage its own overlays

This commit is contained in:
punkfairie 2025-05-31 16:26:42 -07:00
parent 411080df71
commit b73e2eecc5
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
7 changed files with 22 additions and 19 deletions

View file

@ -16,7 +16,6 @@ in {
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "bak"; backupFileExtension = "bak";
users."${my.name}" = { users."${my.name}" = {

View file

@ -50,18 +50,7 @@
}; };
}; };
nixpkgs = { nixpkgs = import ./nixpkgs.nix {inherit inputs;};
config = {
allowUnfree = true;
};
overlays = [
inputs.nur.overlays.default
# Custom packages
(import ../../overlays/marleyos.nix)
];
};
# More useful repl. # More useful repl.
environment.systemPackages = let environment.systemPackages = let

12
modules/base/nixpkgs.nix Normal file
View file

@ -0,0 +1,12 @@
{inputs, ...}: {
config = {
allowUnfree = true;
};
overlays = [
inputs.nur.overlays.default
# Custom packages.
(import ../../overlays/marleyos.nix)
];
}

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
config, config,
inputs,
pkgs, pkgs,
... ...
}: let }: let
@ -10,11 +9,6 @@ in {
options.marleyos.programs.neovim.enable = lib.mkEnableOption "neovim"; options.marleyos.programs.neovim.enable = lib.mkEnableOption "neovim";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# Has to be applied on the OS level to use in HM.
nixpkgs.overlays = [
(import ../../../overlays/marleyvim.nix {inherit inputs;})
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neovim neovim
]; ];

View file

@ -5,6 +5,7 @@
./options ./options
./home-manager.nix ./home-manager.nix
./nix.nix
./system ./system
./shell ./shell

3
modules/home/nix.nix Normal file
View file

@ -0,0 +1,3 @@
{inputs, ...}: {
config.nixpkgs = import ../base/nixpkgs.nix {inherit inputs;};
}

View file

@ -3,6 +3,7 @@
config, config,
osConfig, osConfig,
lib, lib,
inputs,
pkgs, pkgs,
... ...
}: let }: let
@ -15,6 +16,10 @@ in {
mkEnableOption' "neovim" osCfg.enable; mkEnableOption' "neovim" osCfg.enable;
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
nixpkgs.overlays = [
(import ../../../overlays/marleyvim.nix {inherit inputs;})
];
home.packages = with pkgs; [ home.packages = with pkgs; [
nvim nvim
]; ];