refactor rice into config
This commit is contained in:
parent
8872a12d20
commit
818af30329
64 changed files with 229 additions and 230 deletions
|
@ -3,6 +3,7 @@ let
|
|||
inherit (inputs) nixpkgs;
|
||||
inherit (nixpkgs) lib;
|
||||
recursivelyImport = import ./recursively-import.nix { inherit lib; };
|
||||
recursivePkgs = import ./recursive-pkgs.nix { inherit lib; };
|
||||
in
|
||||
{
|
||||
systems =
|
||||
|
@ -12,6 +13,7 @@ in
|
|||
nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
userPkgs = recursivePkgs ../pkg;
|
||||
mainUser = info.user;
|
||||
};
|
||||
modules = [
|
||||
|
|
28
util/recursive-pkgs.nix
Normal file
28
util/recursive-pkgs.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ lib }:
|
||||
let
|
||||
getFiles =
|
||||
path:
|
||||
builtins.filter (i: lib.hasSuffix ".nix" (builtins.toString i)) (
|
||||
lib.filesystem.listFilesRecursive path
|
||||
);
|
||||
getPkgsAttrs =
|
||||
path:
|
||||
let
|
||||
prefix = builtins.toString path;
|
||||
in
|
||||
map (
|
||||
file:
|
||||
let
|
||||
name = lib.pipe file [
|
||||
builtins.toString
|
||||
(lib.removePrefix (prefix + "/"))
|
||||
(lib.removeSuffix ".nix")
|
||||
];
|
||||
in
|
||||
{
|
||||
"${name}" = file;
|
||||
}
|
||||
) (getFiles path);
|
||||
getAllPkgs = path: lib.mergeAttrsList (getPkgsAttrs path);
|
||||
in
|
||||
getAllPkgs
|
Loading…
Add table
Add a link
Reference in a new issue