feat: infuse

This commit is contained in:
2025-05-03 14:13:53 +08:00
parent 095d9ecb67
commit 36d63a667c
2 changed files with 28 additions and 21 deletions

View File

@@ -55,13 +55,15 @@
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
infuse.url = "git+https://codeberg.org/amjoseph/infuse.nix";
infuse.flake = false;
};
outputs =
{
self,
nixpkgs,
nixos-wsl,
...
}@inputs:
let
@@ -75,6 +77,15 @@
${hostname} = mkSystem hostname;
}) (builtins.attrNames (builtins.readDir ./config/hosts))
);
lib = nixpkgs.lib.extend (
final: prev: {
inherit (inputs.home-manager.lib) hm;
inherit infuse;
my = import ./lib { lib = final; };
}
);
infuse = (import inputs.infuse { inherit (nixpkgs) lib; }).v1.infuse;
in
{
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
@@ -99,18 +110,11 @@
}
);
overlays = import ./overlays { inherit inputs; };
overlays = import ./overlays { inherit inputs infuse; };
nixosConfigurations = forAllHosts (
hostname:
let
lib = import ./lib/stdlib-extended.nix (
nixpkgs.lib.extend (
final: prev: {
inherit (inputs.home-manager.lib) hm;
}
)
);
overlays = builtins.attrValues self.overlays ++ [
inputs.go-musicfox.overlays.default
inputs.omz.overlays.default
@@ -131,6 +135,9 @@
withHyprland = false;
};
})
(final: prev: {
inherit lib;
})
];
home = {
home-manager = {
@@ -140,9 +147,12 @@
inputs.stylix.homeManagerModules.stylix
inputs.niri.homeModules.niri
# workaround for annoying stylix
(
{ lib, ... }:
{
nixpkgs.overlays = lib.mkForce null;
}
)
];
useGlobalPkgs = true;
};
@@ -157,7 +167,6 @@
inherit
inputs
outputs
nixos-wsl
hostname
;

View File

@@ -1,19 +1,17 @@
{ inputs, ... }:
{ inputs, infuse, ... }:
{
additions = final: prev: import ../pkgs prev;
modifications = final: prev: {
cage = prev.cage.overrideAttrs {
patches = [ ./cage-specify-output-name.patch ];
};
qq = prev.qq.overrideAttrs {
preInstall = ''
modifications =
final: prev:
infuse prev {
cage.__output.patches.__append = [ ./cage-specify-output-name.patch ];
qq.__output.preInstall.__append = ''
gappsWrapperArgs+=(
--prefix GTK_IM_MODULE : fcitx
)
'';
};
};
# this allows us to access specific version of nixpkgs
# by `pkgs.unstable`, `pkgs.stable` and `pkgs.master`