From 6cbbe35b1c9ce5b2343067ae4ca11a696dcecb63 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Sun, 26 Jan 2025 00:34:11 -0500 Subject: [PATCH] 306 current 2025-01-25 22:09:05 25.05.20241217.d3c42f1 6.6.66 * --- home/home.nix | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/home/home.nix b/home/home.nix index 9dda9d1..fea4ec7 100644 --- a/home/home.nix +++ b/home/home.nix @@ -4,51 +4,49 @@ lib, ... }: let - readScriptsRecursively = dir: let - entries = builtins.readDir dir; # This gives an attrset of filenames -> { "type": "regular"|"directory", ...} - names = builtins.attrNames entries; - in - # We convert all items to a list of name/value pairs; then flatten them - lib.attrsets.listToAttrs (lib.concatMap ( - entry: let - fullPath = "${dir}/${entry}"; - entryInfo = entries.${entry}; # e.g., {type="regular"|"directory",size=...} - in - if entryInfo.type == "directory" - then - # Recursively read sub-directory - builtins.attrValues (readScriptsRecursively fullPath) - else - # For a file, produce an attribute set item - [ - { - name = entry; - value = fullPath; - } - ] - ) - names); - - scripts = readScriptsRecursively ./scripts; - - scriptDerivations = - lib.attrsets.mapAttrs ( - scriptName: scriptPath: - pkgs.writeShellApplication { - name = scriptName; - - # Pick whatever runtime dependencies you need - runtimeInputs = with pkgs; [ - # Example: netcat, bashInteractive, curl, etc. - netcat - ]; - - # The text of the shell script is read directly from the file - text = builtins.readFile scriptPath; - } - ) - scripts; + # readScriptsRecursively = dir: let + # entries = builtins.readDir dir; # This gives an attrset of filenames -> { "type": "regular"|"directory", ...} + # names = builtins.attrNames entries; + # in + # # We convert all items to a list of name/value pairs; then flatten them + # lib.attrsets.listToAttrs (lib.concatMap ( + # entry: let + # fullPath = "${dir}/${entry}"; + # entryInfo = entries.${entry}; # e.g., {type="regular"|"directory",size=...} + # in + # if entryInfo.type == "directory" + # then + # # Recursively read sub-directory + # builtins.attrValues (readScriptsRecursively fullPath) + # else + # # For a file, produce an attribute set item + # [ + # { + # name = entry; + # value = fullPath; + # } + # ] + # ) + # names); + # scripts = readScriptsRecursively ./scripts; + # scriptDerivations = + # lib.attrsets.mapAttrs ( + # scriptName: scriptPath: + # pkgs.writeShellApplication { + # name = scriptName; + # # Pick whatever runtime dependencies you need + # runtimeInputs = with pkgs; [ + # # Example: netcat, bashInteractive, curl, etc. + # netcat + # ]; + # # The text of the shell script is read directly from the file + # text = builtins.readFile scriptPath; + # } + # ) + # scripts; in { + # home.packages = builtins.attrValues scriptDerivations; + home.username = "synchronous"; home.homeDirectory = "/home/synchronous"; imports = [