configuration.nix/flake-modules/nixos-modules.nix
Jalil David Salamé Messina 7963190ef1
fix(nvim): conflict with using global packages
Now it is an error to override the pkgs if global packages are being
used.
2025-01-18 11:41:26 +01:00

45 lines
1.3 KiB
Nix

{ inputs, lib, ... }:
{
flake.nixosModules =
let
nvim-config = {
imports = [
inputs.nixvim.homeManagerModules.nixvim
../nvim
];
};
homeManagerModuleSandalone = import ../home {
inherit nvim-config;
inherit (inputs) stylix;
};
homeManagerModuleNixOS = import ../home { inherit nvim-config; };
nixosModule = {
imports = [
(import ../system { inherit (inputs) stylix; })
inputs.home-manager.nixosModules.home-manager
] ++ lib.optional (inputs.lix-module != null) inputs.lix-module.nixosModules.default;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [ homeManagerModuleNixOS ];
};
# Pin nixpkgs
nix.registry.nixpkgs.flake = inputs.nixpkgs;
};
machines = [ "vm" ];
mkMachine = hostname: {
imports = [
nixosModule
(import (../machines + "/${hostname}"))
];
home-manager.sharedModules = [ { jhome.hostName = hostname; } ];
};
machineModules = lib.genAttrs machines mkMachine;
in
{
default = nixosModule;
inherit nixosModule homeManagerModuleNixOS homeManagerModuleSandalone;
}
// machineModules;
}