1
0
Fork 0
forked from emily/nixfiles

added packages

This commit is contained in:
emily 2024-05-06 13:55:42 +02:00
parent 68c2bf3546
commit 528772c630
Signed by untrusted user: emily
GPG key ID: F6F4C66207FCF995
2 changed files with 16 additions and 9 deletions

View file

@ -92,13 +92,16 @@
default = self.overlays.kyouma; default = self.overlays.kyouma;
}; };
} // flake-utils.lib.eachDefaultSystem (system: let } // flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.kyouma ];
};
in { in {
# packages = rec { packages = shinyflakes.mapPackages (pkgs) {
# newhost = pkgs.stdenv.mkDerivation { # newhost = pkgs.stdenv.mkDerivation {
# name = "newhost"; # name = "newhost";
# }; # };
# }; };
# apps = rec { # apps = rec {
# newhost = self.packages.${system}.newhost; # newhost = self.packages.${system}.newhost;
# default = newhost; # default = newhost;

View file

@ -1,9 +1,10 @@
{ self, nixpkgs, ... }@inputs: let { self, nixpkgs, ... }@inputs: let
readHostDir = builtins.filter (name: name != "_minimal") ( mapDir = dir: builtins.attrNames (nixpkgs.lib.filterAttrs (name: type: type == "directory") (
builtins.attrNames (nixpkgs.lib.filterAttrs (name: type: type == "directory") ( builtins.readDir ../../${dir}));
builtins.readDir ../../config/hosts)));
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: { genColmenaCfg = name: host: {
deployment = { deployment = {
@ -35,11 +36,14 @@
}; };
in { in {
mapHosts = hostCfg: nixpkgs.lib.recursiveUpdate ( 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) ( 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: mapNixosCfg = extraNixosCfg: nixpkgs.lib.recursiveUpdate (builtins.mapAttrs (name: value:
genNixosCfg value) self.hosts) extraNixosCfg; genNixosCfg value) self.hosts) extraNixosCfg;
mapPackages = overlayPkgs: otherPackages: nixpkgs.lib.recursiveUpdate (
nixpkgs.lib.genAttrs (mapDir "pkgs") (name: overlayPkgs.${name})) otherPackages;
} }