1
0

flake.nix: Centralize overlays

This commit is contained in:
clerie 2024-05-13 16:05:48 +02:00
parent c2062145b0
commit 9210767036
Signed by: clerie
GPG Key ID: BD9F56480870BAD2
4 changed files with 37 additions and 22 deletions

View File

@ -35,6 +35,7 @@
outputs = { self, nixpkgs, nixos-hardware, chaosevents, fernglas, nixos-exporter, solid-xmpp-alarm, ssh-to-age, ... }@inputs: let outputs = { self, nixpkgs, nixos-hardware, chaosevents, fernglas, nixos-exporter, solid-xmpp-alarm, ssh-to-age, ... }@inputs: let
lib = import ./lib inputs; lib = import ./lib inputs;
helper = lib.flake-helper; helper = lib.flake-helper;
localNixpkgs = import ./flake/nixpkgs.nix inputs;
in { in {
clerie.hosts = { clerie.hosts = {
aluminium = { aluminium = {
@ -93,30 +94,18 @@
colmena = { colmena = {
meta = { meta = {
nixpkgs = import nixpkgs { nixpkgs = localNixpkgs.x86_64-linux;
system = "x86_64-linux";
};
}; };
} // helper.mapToColmenaHosts self.nixosConfigurations; } // helper.mapToColmenaHosts self.nixosConfigurations;
overlays = { overlays = {
nixfilesInputs = import ./flake/overlay.nix inputs;
clerie = import ./pkgs/overlay.nix; clerie = import ./pkgs/overlay.nix;
default = self.overlays.clerie; default = self.overlays.clerie;
}; };
packages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let packages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let
pkgs = import nixpkgs { pkgs = localNixpkgs.${system};
inherit system;
overlays = [
self.overlays.clerie
(_: _: {
inherit (chaosevents.packages.${system})
chaosevents;
inherit (ssh-to-age.packages.${system})
ssh-to-age;
})
];
};
in { in {
inherit (pkgs) inherit (pkgs)
clerie-keys clerie-keys

17
flake/nixpkgs.nix Normal file
View File

@ -0,0 +1,17 @@
{ self
, nixpkgs
, ...
}@inputs:
let
mkNixpkgs = { system, ... }@args:
import nixpkgs {
inherit system;
overlays = [
self.overlays.nixfilesInputs
self.overlays.clerie
];
};
in
nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: mkNixpkgs { inherit system; })

14
flake/overlay.nix Normal file
View File

@ -0,0 +1,14 @@
{ self
, bij
, chaosevents
, ssh-to-age
, ...
}@inputs:
final: prev: {
inherit (bij.packages.${final.system})
bij;
inherit (chaosevents.packages.${final.system})
chaosevents;
inherit (ssh-to-age.packages.${final.system})
ssh-to-age;
}

View File

@ -1,4 +1,4 @@
{ self, nixpkgs, bij, chaosevents, fernglas, fieldpoc, nixos-exporter, solid-xmpp-alarm, sops-nix, ... }@inputs: { self, nixpkgs, fernglas, fieldpoc, nixos-exporter, solid-xmpp-alarm, sops-nix, ... }@inputs:
rec { rec {
generateNixosSystem = { generateNixosSystem = {
@ -26,13 +26,8 @@ rec {
../users/clerie ../users/clerie
({ ... }: { ({ ... }: {
nixpkgs.overlays = [ nixpkgs.overlays = [
self.overlays.nixfilesInputs
self.overlays.clerie self.overlays.clerie
(_: _: {
inherit (bij.packages."${system}")
bij;
inherit (chaosevents.packages."x86_64-linux")
chaosevents;
})
]; ];
clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; }; clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; };
}) })