overlay rework
This commit is contained in:
14
flake.nix
14
flake.nix
@@ -36,6 +36,7 @@
|
||||
user = constants.user;
|
||||
darwinHosts = builtins.attrNames (builtins.readDir ./hosts/darwin);
|
||||
nixosHosts = builtins.attrNames (builtins.readDir ./hosts/nixos);
|
||||
overlays = import ./overlays {inherit inputs;};
|
||||
in {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
@@ -55,11 +56,7 @@
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
inputs.nix-homebrew.darwinModules.nix-homebrew
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
|
||||
})
|
||||
];
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
nix-homebrew = {
|
||||
inherit user;
|
||||
@@ -88,11 +85,7 @@
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
|
||||
})
|
||||
];
|
||||
nixpkgs.overlays = overlays;
|
||||
}
|
||||
./hosts/nixos/${hostname}
|
||||
];
|
||||
@@ -139,6 +132,7 @@
|
||||
appNames
|
||||
);
|
||||
};
|
||||
flake.overlays = overlays;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
16
overlays/default.nix
Normal file
16
overlays/default.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ inputs }:
|
||||
let
|
||||
dir = builtins.readDir ./.;
|
||||
overlayNames = builtins.sort builtins.lessThan (builtins.filter (
|
||||
name:
|
||||
name != "default.nix"
|
||||
&& dir.${name} == "regular"
|
||||
&& builtins.match ".*\\.nix" name != null
|
||||
) (builtins.attrNames dir));
|
||||
overlayPath = name:
|
||||
builtins.toPath "${builtins.toString ./.}/${name}";
|
||||
loadOverlay = name:
|
||||
let
|
||||
overlayModule = import (overlayPath name);
|
||||
in overlayModule { inherit inputs; };
|
||||
in map loadOverlay overlayNames
|
||||
4
overlays/zjstatus.nix
Normal file
4
overlays/zjstatus.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ inputs }:
|
||||
final: prev: {
|
||||
zjstatus = inputs.zjstatus.packages.${prev.system}.default;
|
||||
}
|
||||
Reference in New Issue
Block a user