Fix running non shell programs
This commit is contained in:
		
							parent
							
								
									5422aea875
								
							
						
					
					
						commit
						163debc8a0
					
				
					 1 changed files with 20 additions and 16 deletions
				
			
		| 
						 | 
					@ -3,22 +3,26 @@
 | 
				
			||||||
  with pkgs;
 | 
					  with pkgs;
 | 
				
			||||||
  let
 | 
					  let
 | 
				
			||||||
    import_script = (_: path: import (path) { inherit config pkgs lib; });
 | 
					    import_script = (_: path: import (path) { inherit config pkgs lib; });
 | 
				
			||||||
    create_shell_app = (name: text: runtimeInputs: pkgs.writeShellApplication {
 | 
					    create_script = (name: text: runtimeInputs:
 | 
				
			||||||
      inherit name runtimeInputs;
 | 
					      let
 | 
				
			||||||
      text = (builtins.readFile text);
 | 
					        script_body = pkgs.writeTextFile {
 | 
				
			||||||
      checkPhase = "";
 | 
					          inherit name;
 | 
				
			||||||
    });
 | 
					          executable = true;
 | 
				
			||||||
    create_shell_apps = lib.mapAttrs (name: deps: create_shell_app name ./${name} deps);
 | 
					          text = ''
 | 
				
			||||||
  in create_shell_apps {
 | 
					            ${builtins.readFile text}
 | 
				
			||||||
    br = [];
 | 
					          '';
 | 
				
			||||||
    bmenu = [
 | 
					        };
 | 
				
			||||||
      bemenu
 | 
					      in (pkgs.writeShellApplication {
 | 
				
			||||||
      dhist
 | 
					        inherit name runtimeInputs;
 | 
				
			||||||
      fish
 | 
					        text = ''exec ${script_body} "$@"'';
 | 
				
			||||||
      j4-dmenu-desktop
 | 
					        checkPhase = "";
 | 
				
			||||||
      jq
 | 
					      })
 | 
				
			||||||
      sway
 | 
					    );
 | 
				
			||||||
    ];
 | 
					    create_scripts =
 | 
				
			||||||
 | 
					      lib.mapAttrs (name: deps: create_script name ./${name} deps);
 | 
				
			||||||
 | 
					  in create_scripts {
 | 
				
			||||||
 | 
					    br = [ ];
 | 
				
			||||||
 | 
					    bmenu = [ bemenu dhist fish j4-dmenu-desktop jq sway ];
 | 
				
			||||||
  } // lib.mapAttrs import_script {
 | 
					  } // lib.mapAttrs import_script {
 | 
				
			||||||
    wdmenu = ./wdmenu.nix;
 | 
					    wdmenu = ./wdmenu.nix;
 | 
				
			||||||
    wlauncher = ./wlauncher.nix;
 | 
					    wlauncher = ./wlauncher.nix;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue