mirror of
https://codeberg.org/muon/home.git
synced 2026-03-09 03:53:11 +00:00
54 lines
2 KiB
Nix
54 lines
2 KiB
Nix
{ inputs, system, sources, ... }:
|
|
let
|
|
pkgs = import inputs.nixpkgs { inherit system; };
|
|
in {
|
|
mkHost = host:
|
|
inputs.nixpkgs.lib.nixosSystem {
|
|
specialArgs = { inherit inputs system sources; };
|
|
|
|
modules = [
|
|
host
|
|
./modules/nixos
|
|
inputs.home-manager.nixosModules.default
|
|
inputs.stylix.nixosModules.stylix
|
|
inputs.impermanence.nixosModules.impermanence
|
|
];
|
|
};
|
|
|
|
# Build a standalone HM configuration for a given host NixOS config and
|
|
# home.nix file. osConfig is injected as a specialArg so all modules that
|
|
# reference it continue to work.
|
|
mkHome = { hostConfig, homeFile, username ? "muon" }:
|
|
inputs.home-manager.lib.homeManagerConfiguration {
|
|
inherit pkgs;
|
|
extraSpecialArgs = {
|
|
inherit inputs system sources;
|
|
osConfig = hostConfig.config;
|
|
};
|
|
modules = [
|
|
homeFile
|
|
inputs.self.outputs.homeManagerModules.default
|
|
inputs.stylix.homeManagerModules.stylix
|
|
({ osConfig, ... }: {
|
|
home.username = username;
|
|
home.homeDirectory = "/home/${username}";
|
|
# Mirror the stylix settings from the NixOS config so the standalone
|
|
# HM build has the same theme without re-declaring it.
|
|
stylix = {
|
|
enable = osConfig.stylix.enable;
|
|
autoEnable = osConfig.stylix.autoEnable;
|
|
base16Scheme = osConfig.stylix.base16Scheme;
|
|
image = osConfig.stylix.image;
|
|
cursor = osConfig.stylix.cursor;
|
|
# Forward individual font options; stylix derives fonts.packages
|
|
# internally as read-only so we must not forward that attr.
|
|
fonts.monospace = osConfig.stylix.fonts.monospace;
|
|
fonts.sansSerif = osConfig.stylix.fonts.sansSerif;
|
|
fonts.serif = osConfig.stylix.fonts.serif;
|
|
fonts.emoji = osConfig.stylix.fonts.emoji;
|
|
fonts.sizes = osConfig.stylix.fonts.sizes;
|
|
};
|
|
})
|
|
];
|
|
};
|
|
}
|