build(xatu): add flake package #78

Closed
alexion wants to merge 8 commits from refs/pull/78/head into main
pull from: refs/pull/78/head
2 changed files with 11 additions and 20 deletions
Showing only changes of commit c5043a67be - Show all commits

No files matched your search

+3
View File
@@ -6,6 +6,8 @@
system, system,
}: }:
let let
util = import ../dotfiles/util.nix { inherit lib; };
dotfiles = import ../dotfiles { dotfiles = import ../dotfiles {
inherit inherit
inputs inputs
@@ -27,6 +29,7 @@ in
lib lib
root root
system system
util
; ;
}; };
+8 -20
View File
@@ -3,30 +3,18 @@
lib, lib,
root, root,
system, system,
util,
}: }:
let let
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = inputs.nixpkgs.legacyPackages.${system};
packageDirs = packageFiles = builtins.filter (path: builtins.baseNameOf (toString path) == "package.nix") (
dir: util.collectNixFiles (root + "/src")
lib.flatten ( );
lib.mapAttrsToList (
name: type:
let
path = dir + "/${name}";
in
if type == "directory" then
packageDirs path
else if type == "regular" && name == "package.nix" then
[ dir ]
else
[ ]
) (builtins.readDir dir)
);
package = dir: { package = packageFile: {
name = builtins.baseNameOf (toString dir); name = builtins.baseNameOf (toString (builtins.dirOf packageFile));
value = import (dir + "/package.nix") { value = import packageFile {
inherit inherit
lib lib
pkgs pkgs
@@ -35,4 +23,4 @@ let
}; };
}; };
in in
builtins.listToAttrs (map package (packageDirs (root + "/src"))) builtins.listToAttrs (map package packageFiles)