added packages
This commit is contained in:
parent
68c2bf3546
commit
528772c630
2 changed files with 16 additions and 9 deletions
|
@ -92,13 +92,16 @@
|
|||
default = self.overlays.kyouma;
|
||||
};
|
||||
} // flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.kyouma ];
|
||||
};
|
||||
in {
|
||||
# packages = rec {
|
||||
packages = shinyflakes.mapPackages (pkgs) {
|
||||
# newhost = pkgs.stdenv.mkDerivation {
|
||||
# name = "newhost";
|
||||
# };
|
||||
# };
|
||||
};
|
||||
# apps = rec {
|
||||
# newhost = self.packages.${system}.newhost;
|
||||
# default = newhost;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{ self, nixpkgs, ... }@inputs: let
|
||||
readHostDir = builtins.filter (name: name != "_minimal") (
|
||||
builtins.attrNames (nixpkgs.lib.filterAttrs (name: type: type == "directory") (
|
||||
builtins.readDir ../../config/hosts)));
|
||||
mapDir = dir: builtins.attrNames (nixpkgs.lib.filterAttrs (name: type: type == "directory") (
|
||||
builtins.readDir ../../${dir}));
|
||||
|
||||
filterMinimal = attr: nixpkgs.lib.filterAttrs (name: v: !(nixpkgs.lib.hasSuffix "-minimal" name)) attr;
|
||||
filterDir = filterBy: dir: builtins.filter (name: name != filterBy) (mapDir dir);
|
||||
|
||||
filterSuffix = suffix: attr: nixpkgs.lib.filterAttrs (name: v: !(nixpkgs.lib.hasSuffix suffix name)) attr;
|
||||
|
||||
genColmenaCfg = name: host: {
|
||||
deployment = {
|
||||
|
@ -35,11 +36,14 @@
|
|||
};
|
||||
in {
|
||||
mapHosts = hostCfg: nixpkgs.lib.recursiveUpdate (
|
||||
nixpkgs.lib.genAttrs readHostDir (host: { hostname = host; })) hostCfg;
|
||||
nixpkgs.lib.genAttrs (filterDir "_minimal" "config/hosts") (host: { hostname = host; })) hostCfg;
|
||||
|
||||
mapColmenaCfg = extraColmenaCfg: nixpkgs.lib.recursiveUpdate (builtins.mapAttrs (genColmenaCfg) (
|
||||
filterMinimal self.nixosConfigurations)) extraColmenaCfg;
|
||||
filterSuffix "-minimal" self.nixosConfigurations)) extraColmenaCfg;
|
||||
|
||||
mapNixosCfg = extraNixosCfg: nixpkgs.lib.recursiveUpdate (builtins.mapAttrs (name: value:
|
||||
genNixosCfg value) self.hosts) extraNixosCfg;
|
||||
|
||||
mapPackages = overlayPkgs: otherPackages: nixpkgs.lib.recursiveUpdate (
|
||||
nixpkgs.lib.genAttrs (mapDir "pkgs") (name: overlayPkgs.${name})) otherPackages;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue