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
lib = import ./lib inputs;
helper = lib.flake-helper;
localNixpkgs = import ./flake/nixpkgs.nix inputs;
in {
clerie.hosts = {
aluminium = {
@ -93,30 +94,18 @@
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
};
nixpkgs = localNixpkgs.x86_64-linux;
};
} // helper.mapToColmenaHosts self.nixosConfigurations;
overlays = {
nixfilesInputs = import ./flake/overlay.nix inputs;
clerie = import ./pkgs/overlay.nix;
default = self.overlays.clerie;
};
packages = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
self.overlays.clerie
(_: _: {
inherit (chaosevents.packages.${system})
chaosevents;
inherit (ssh-to-age.packages.${system})
ssh-to-age;
})
];
};
pkgs = localNixpkgs.${system};
in {
inherit (pkgs)
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 {
generateNixosSystem = {
@ -26,13 +26,8 @@ rec {
../users/clerie
({ ... }: {
nixpkgs.overlays = [
self.overlays.nixfilesInputs
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; };
})