nixos-config/flake-mods/hm.nix
2024-10-08 11:19:34 +02:00

40 lines
1 KiB
Nix

{
inputs,
lib,
...
}: {
imports = [
./hm-flake-part.nix
];
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: let
# split system (e.g. x86_64-linux) into os and arch
splitSystem = lib.splitString "-" system;
os = builtins.elemAt splitSystem 0;
arch = builtins.elemAt splitSystem 1;
in {
legacyPackages.homeConfigurations.xqtc = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
../home
inputs.nixvim.homeManagerModules.nixvim
inputs.sops-nix.homeManagerModules.sops
{inherit os arch;}
];
extraSpecialArgs = {inherit inputs;};
};
# # this sounds stupid, but it's the only way to make home-manager consume a
# # flake output with the system in it, which *should* be the case because it
# # wants system-specific pkgs, but flake-parts (rightfully so!) complains
# # that this isn't a package, so we do this to make both happy.
# packages.homeConfigurations.type = "derivation";
};
}