nixos-config/lib/default.nix

53 lines
1.6 KiB
Nix
Raw Normal View History

2023-10-14 16:55:13 +02:00
{ self, nixpkgs, ... }@inputs:
rec {
defSystem = system: systemConfig: deployConfig:
nixpkgs.lib.nixosSystem {
system = "${system}";
modules = (systemModules system systemConfig) ++ (nixpkgs.lib.optional (deployConfig != null) { _module.args.nixinate = deployConfig; });
};
systemModules = system: systemConfig:
builtins.attrValues self.nixosModules ++ [
{ _module.args.inputs = inputs; }
{ _module.args.self-overlay = self.overlays.default; }
{
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
nixpkgs =
{
overlays = [
self.overlays.default
inputs.ha-now-playing.overlays.${system}
inputs.pamedia.overlays.${system}
inputs.emacs-overlay.overlay
inputs.nil.overlays.default
inputs.eww.overlays.default
inputs.rust-overlay.overlays.default
] ++ nixpkgs.lib.optional (system == "aarch64-linux")
(_final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
});
config = {
allowUnfree = true;
firefox.speechSynthesisSupport = true;
};
};
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
};
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
nix.registry.nixpkgs.flake = nixpkgs;
}
systemConfig
inputs.home-manager.nixosModules.home-manager
inputs.sops.nixosModules.sops
inputs.sunshine.nixosModules.sunshine
];
}