From 44e2cfea2b98957f0fa475badfd6582541872fb8 Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Wed, 25 Mar 2026 12:27:50 +0000 Subject: [PATCH] Regenerated --- Droidnix/Prompt | 145 +++++++++++++++++++++-- Droidnix/README.org | 6 +- Droidnix/buildcommand | 1 + Droidnix/generated/users/copy_2_home.nix | 6 +- 4 files changed, 142 insertions(+), 16 deletions(-) create mode 100644 Droidnix/buildcommand diff --git a/Droidnix/Prompt b/Droidnix/Prompt index a21325997..a36a5ab74 100644 --- a/Droidnix/Prompt +++ b/Droidnix/Prompt @@ -1,19 +1,102 @@ -Rewrite my ./generated/modules/traveldroid/system/dbus.nix to integrate nicely with my existing flake.nix en host.nix +Rewrite my ./generated/modules/traveldroid/apps/emacs/emacs.nix to integrate nicely with my existing flake.nix en host.nix Avoid infinite recursion -Just look at how to rewrite this, ignore previous interactions around this nix -This version worked, stay as close to it as you can. +Just look at how to rewrite this, ignore previous interactions around this nix. +Solve the error. That is really important. +Lopok at the way hyprland is using config files. + +error: + … while calling the 'seq' builtin + at /nix/store/s7bvgynzfisna3jdq2cr4jx73xnhxs27-source/lib/modules.nix:402:18: + 401| options = checked options; + 402| config = checked (removeAttrs config [ "_module" ]); + | ^ + 403| _module = checked (config._module); + + … while calling the 'throw' builtin + at /nix/store/s7bvgynzfisna3jdq2cr4jx73xnhxs27-source/lib/modules.nix:374:13: + 373| else + 374| throw baseMsg + | ^ + 375| else + + error: The option `home' does not exist. Definition values: + - In `/nix/store/cpciwvh5yx2qw51ypda3lygshrr2834f-source/Droidnix/generated/modules/traveldroid/apps/emacs/emacs.nix': + { + file = { + "emacs/early-init.el" = { + source = "/nix/store/cpciwvh5yx2qw51ypda3lygshrr2834f-source/Droidnix/assets/traveldroid/conf/emacs/early-init.el"; + target = ".emacs.d/early-init.el"; + ... + Did you mean `time', `boot' or `jobs'? +Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '.#nixosConfigurations."traveldroid".config.system.build.nixos-rebuild' --no-link' returned non-zero exit status 1. ------------------------------------------------------------------------ -{ config, pkgs, lib, ... }: - +{ pkgs, flakeRoot,... }: { - services.dbus = { - enable = true; - # Use the dbus-broker backend explicitly - package = pkgs.dbus-broker; - }; +programs.emacs = { +enable = true; +# install with tree sitter enabled +package = (pkgs.emacs-pgtk.override { withTreeSitter = true; }); +extraPackages = epkgs: [ + # also install all tree sitter grammars + epkgs.manualPackages.treesit-grammars.with-all-grammars + epkgs.nerd-icons # nerd fonts support + epkgs.doom-modeline # model line + epkgs.diminish # hides modes from modeline + epkgs.eldoc # doc support + epkgs.pulsar # pulses the cursor when jumping about + epkgs.which-key # help porcelain + epkgs.expreg # expand region + epkgs.vundo # undo tree + epkgs.puni # structured editing + epkgs.avy # jumping utility + epkgs.consult # emacs right click + epkgs.vertico # minibuffer completion + epkgs.marginalia # annotations for completions + epkgs.crux # utilities + epkgs.magit # git porcelain + epkgs.nerd-icons-corfu # nerd icons for completion + epkgs.corfu # completion + epkgs.cape # completion extensions + epkgs.orderless # search paradigm + epkgs.yasnippet # snippets support + epkgs.yasnippet-snippets # commonly used snippets + epkgs.rg # ripgrep + epkgs.exec-path-from-shell # load env and path + epkgs.eat # better shell + epkgs.rust-mode # rust mode (when rust-ts doesn't cut it) + epkgs.rustic # more rust things + epkgs.nix-mode # nix lang + epkgs.hcl-mode # hashicorp file mode + epkgs.shell-pop # quick shell popup + epkgs.envrc # support for loading .envrc + epkgs.nixpkgs-fmt # format nix files + epkgs.f # string + file utilities + epkgs.gptel # llm chat (mainly claude) + epkgs.catppuccin-theme # catppuccin theme + epkgs.eldoc-box # docs in a box + epkgs.sideline # mainly for flymake errors on the side + epkgs.sideline-flymake # mainly for flymake errors on the side + epkgs.sideline-eglot # mainly for flymake errors on the side +]; +}; +home.sessionVariables = { +EDITOR = "emacs"; +XDG_SCREENSHOTS_DIR = "~/screenshots"; +}; +home.file = { +emacs-init = { + source = "${flakeRoot}/assets/traveldroid/conf/emacs/early-init.el"; + target = ".emacs.d/early-init.el"; +}; +emacs = { + source = "${flakeRoot}/assets/traveldroid/conf/emacs/init.el"; + target = ".emacs.d/init.el"; +}; +}; } + ------------------------------------------------------------------------ flake.nix @@ -113,3 +196,45 @@ in home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; } + + +hyprland.nix + +{ lib, config, pkgs, flakeRoot, home-manager, inputs, ... }: + +let + username = config.defaultUser or "henrov"; + assetPath = "${flakeRoot}/assets/traveldroid/conf/hypr/"; + + # Read all files in the asset directory + assetFiles = builtins.attrNames (builtins.readDir assetPath); + + # Convert files to Home Manager xdg config entries + hyprFiles = lib.genAttrs assetFiles (f: { + # Destination path in home directory + name = ".config/hypr/${f}"; + # Source file path + value = { source = "${assetPath}/${f}"; }; + }); + + # Determine Hyprland package + hyprlandPkg = + pkgs.hyprland or + pkgs.hyprland-git or + inputs.hyprland.packages.${pkgs.system}.default; +in +{ + environment.systemPackages = [ hyprlandPkg ]; + + _module.args.hmUsers = { + ${username} = { + home.packages = [ hyprlandPkg ]; + + # Merge all files in the asset folder into ~/.config/hypr/ + home.file = lib.mkMerge hyprFiles; + + # Optional: Hyprland settings + settings.general."col.active_border" = "0xff97cbcd 0xff89b4fa"; + }; + }; +} diff --git a/Droidnix/README.org b/Droidnix/README.org index 3e79655ec..504442624 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -1057,15 +1057,15 @@ in # Always use /bin/sh -c for multi-line commands serviceConfig.ExecStart = '' /bin/sh -c ' - echo "Copying assets from ${assetPath} to ${homeDir} ..." + echo "Copying assets from ${assetPath} to ${homeDir}/Droidnix ..." if [ ! -d "${assetPath}" ]; then echo "ERROR: ${assetPath} does not exist" exit 1 fi - mkdir -p "${homeDir}" - chown ${username}:${username} "${homeDir}" + mkdir -p "${homeDir}/Droidnix" + chown u+rwx ${username}:${username} "${homeDir}/Droidnix" ${pkgs.rsync}/bin/rsync -a --no-owner --no-group "${assetPath}/" "${homeDir}/" diff --git a/Droidnix/buildcommand b/Droidnix/buildcommand new file mode 100644 index 000000000..52cf8f644 --- /dev/null +++ b/Droidnix/buildcommand @@ -0,0 +1 @@ +rm -rf ~/Repos/nixos/Droidnix/generated && nix --extra-experimental-features "nix-command flakes" shell nixpkgs#emacs -c emacs --batch README.org -f org-babel-tangle && git add . && git commit -m "Regenerated" && git push && sudo nixos-rebuild test --flake .#traveldroid \ No newline at end of file diff --git a/Droidnix/generated/users/copy_2_home.nix b/Droidnix/generated/users/copy_2_home.nix index 87a18da52..f5fa5128a 100644 --- a/Droidnix/generated/users/copy_2_home.nix +++ b/Droidnix/generated/users/copy_2_home.nix @@ -18,15 +18,15 @@ in # Always use /bin/sh -c for multi-line commands serviceConfig.ExecStart = '' /bin/sh -c ' - echo "Copying assets from ${assetPath} to ${homeDir} ..." + echo "Copying assets from ${assetPath} to ${homeDir}/Droidnix ..." if [ ! -d "${assetPath}" ]; then echo "ERROR: ${assetPath} does not exist" exit 1 fi - mkdir -p "${homeDir}" - chown ${username}:${username} "${homeDir}" + mkdir -p "${homeDir}/Droidnix" + chown u+rwx ${username}:${username} "${homeDir}/Droidnix" ${pkgs.rsync}/bin/rsync -a --no-owner --no-group "${assetPath}/" "${homeDir}/"