scripts: fixup infinite recursion and recompilations
This commit is contained in:
		
							parent
							
								
									6f832e601c
								
							
						
					
					
						commit
						00b20bdd51
					
				
					 14 changed files with 37 additions and 39 deletions
				
			
		
							
								
								
									
										0
									
								
								scripts/_diffr
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/_diffr
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/_sway_idle_toggle
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/_sway_idle_toggle
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/bmenu
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/bmenu
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/br
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/br
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							| 
						 | 
					@ -1,34 +1,32 @@
 | 
				
			||||||
(
 | 
					(
 | 
				
			||||||
  final: prev:
 | 
					  final: prev:
 | 
				
			||||||
  with prev;
 | 
					 | 
				
			||||||
  let
 | 
					  let
 | 
				
			||||||
    import_script = (_: path: import (path) { inherit pkgs lib; });
 | 
					    lib = prev.lib;
 | 
				
			||||||
    create_script = (
 | 
					 | 
				
			||||||
      name: text: runtimeInputs:
 | 
					 | 
				
			||||||
      let
 | 
					 | 
				
			||||||
        script_body = pkgs.writeTextFile {
 | 
					 | 
				
			||||||
          inherit name;
 | 
					 | 
				
			||||||
          executable = true;
 | 
					 | 
				
			||||||
          text = ''
 | 
					 | 
				
			||||||
            ${builtins.readFile text}
 | 
					 | 
				
			||||||
          '';
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
      in
 | 
					 | 
				
			||||||
      (pkgs.writeShellApplication {
 | 
					 | 
				
			||||||
        inherit name runtimeInputs;
 | 
					 | 
				
			||||||
        text = ''exec ${script_body} "$@"'';
 | 
					 | 
				
			||||||
        checkPhase = "";
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    create_scripts = lib.mapAttrs (name: deps: create_script name ./${name} deps);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pass = pkgs.pass.withExtensions (ex: with ex; [ pass-otp ]);
 | 
					    importScript = (_: path: import (path) { inherit (final) pkgs lib; });
 | 
				
			||||||
 | 
					    wrapScript =
 | 
				
			||||||
 | 
					      name: text: runtimeInputs:
 | 
				
			||||||
 | 
					      final.runCommand name
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          nativeBuildInputs = [ final.makeWrapper ];
 | 
				
			||||||
 | 
					          meta.mainProgram = name;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        ''
 | 
				
			||||||
 | 
					          mkdir -p $out/bin
 | 
				
			||||||
 | 
					          cp ${text} $out/bin/${name}
 | 
				
			||||||
 | 
					          wrapProgram $out/bin/${name} \
 | 
				
			||||||
 | 
					              --suffix PATH : ${lib.makeBinPath runtimeInputs}
 | 
				
			||||||
 | 
					        '';
 | 
				
			||||||
 | 
					    createScripts = lib.mapAttrs (name: deps: wrapScript name ./${name} deps);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    myPass = final.pass.withExtensions (ex: with ex; [ pass-otp ]);
 | 
				
			||||||
  in
 | 
					  in
 | 
				
			||||||
  create_scripts {
 | 
					  with final;
 | 
				
			||||||
 | 
					  createScripts {
 | 
				
			||||||
    br = [ ];
 | 
					    br = [ ];
 | 
				
			||||||
    bmenu = [
 | 
					    bmenu = [
 | 
				
			||||||
      final.bemenu
 | 
					      bemenu
 | 
				
			||||||
      final.dhist
 | 
					      dhist
 | 
				
			||||||
      fish
 | 
					      fish
 | 
				
			||||||
      j4-dmenu-desktop
 | 
					      j4-dmenu-desktop
 | 
				
			||||||
      jq
 | 
					      jq
 | 
				
			||||||
| 
						 | 
					@ -44,21 +42,21 @@
 | 
				
			||||||
      fish
 | 
					      fish
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    _diffr = [ diffr ];
 | 
					    _diffr = [ diffr ];
 | 
				
			||||||
    _thunar-terminal = [ final.terminal ];
 | 
					    _thunar-terminal = [ terminal ];
 | 
				
			||||||
    _sway_idle_toggle = [ final.swayidle ];
 | 
					    _sway_idle_toggle = [ swayidle ];
 | 
				
			||||||
    kak-pager = [
 | 
					    kak-pager = [
 | 
				
			||||||
      fish
 | 
					      fish
 | 
				
			||||||
      final._diffr
 | 
					      _diffr
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    kak-man-pager = [ final.kak-pager ];
 | 
					    kak-man-pager = [ kak-pager ];
 | 
				
			||||||
    helix-pager = [
 | 
					    helix-pager = [
 | 
				
			||||||
      fish
 | 
					      fish
 | 
				
			||||||
      final._diffr
 | 
					      _diffr
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    helix-man-pager = [ final.helix-pager ];
 | 
					    helix-man-pager = [ helix-pager ];
 | 
				
			||||||
    musmenu = [
 | 
					    musmenu = [
 | 
				
			||||||
      mpc-cli
 | 
					      mpc-cli
 | 
				
			||||||
      final.wdmenu
 | 
					      wdmenu
 | 
				
			||||||
      trash-cli
 | 
					      trash-cli
 | 
				
			||||||
      xdg-user-dirs
 | 
					      xdg-user-dirs
 | 
				
			||||||
      libnotify
 | 
					      libnotify
 | 
				
			||||||
| 
						 | 
					@ -73,9 +71,9 @@
 | 
				
			||||||
      gnupg
 | 
					      gnupg
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    wpass = [
 | 
					    wpass = [
 | 
				
			||||||
      final.wdmenu
 | 
					      wdmenu
 | 
				
			||||||
      fd
 | 
					      fd
 | 
				
			||||||
      pass
 | 
					      myPass
 | 
				
			||||||
      sd
 | 
					      sd
 | 
				
			||||||
      wl-clipboard
 | 
					      wl-clipboard
 | 
				
			||||||
      wtype
 | 
					      wtype
 | 
				
			||||||
| 
						 | 
					@ -96,7 +94,7 @@
 | 
				
			||||||
    pulse_sink = [
 | 
					    pulse_sink = [
 | 
				
			||||||
      pulseaudio
 | 
					      pulseaudio
 | 
				
			||||||
      pamixer
 | 
					      pamixer
 | 
				
			||||||
      final.wdmenu
 | 
					      wdmenu
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    color_picker = [
 | 
					    color_picker = [
 | 
				
			||||||
      grim
 | 
					      grim
 | 
				
			||||||
| 
						 | 
					@ -108,13 +106,13 @@
 | 
				
			||||||
    dzadd = [
 | 
					    dzadd = [
 | 
				
			||||||
      procps
 | 
					      procps
 | 
				
			||||||
      libnotify
 | 
					      libnotify
 | 
				
			||||||
      final.wdmenu
 | 
					      wdmenu
 | 
				
			||||||
      jq
 | 
					      jq
 | 
				
			||||||
      mpv
 | 
					      mpv
 | 
				
			||||||
      pqiv
 | 
					      pqiv
 | 
				
			||||||
      python3Packages.deemix
 | 
					      python3Packages.deemix
 | 
				
			||||||
      mpc-cli
 | 
					      mpc-cli
 | 
				
			||||||
      final.mpdDup
 | 
					      mpdDup
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    mpdDup = [
 | 
					    mpdDup = [
 | 
				
			||||||
      mpc-cli
 | 
					      mpc-cli
 | 
				
			||||||
| 
						 | 
					@ -128,15 +126,15 @@
 | 
				
			||||||
    auto_connect_gamepad = [
 | 
					    auto_connect_gamepad = [
 | 
				
			||||||
      bluez
 | 
					      bluez
 | 
				
			||||||
      coreutils
 | 
					      coreutils
 | 
				
			||||||
      final.gnugrep
 | 
					      gnugrep
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    powerplay-led-idle = [
 | 
					    powerplay-led-idle = [
 | 
				
			||||||
      final.bash
 | 
					      bash
 | 
				
			||||||
      libinput
 | 
					      libinput
 | 
				
			||||||
      libratbag
 | 
					      libratbag
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  // lib.mapAttrs import_script {
 | 
					  // lib.mapAttrs importScript {
 | 
				
			||||||
    wdmenu = ./wdmenu.nix;
 | 
					    wdmenu = ./wdmenu.nix;
 | 
				
			||||||
    wlauncher = ./wlauncher.nix;
 | 
					    wlauncher = ./wlauncher.nix;
 | 
				
			||||||
    _gpg-unlock = ./_gpg-unlock.nix;
 | 
					    _gpg-unlock = ./_gpg-unlock.nix;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										0
									
								
								scripts/helix-pager
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/helix-pager
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/kak-pager
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/kak-pager
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/playerctl-status
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/playerctl-status
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/pulse_sink
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/pulse_sink
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/screenshotsh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/screenshotsh
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/showkeys
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/showkeys
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/terminal
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/terminal
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/wl-copy-file
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/wl-copy-file
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								scripts/wpass
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								scripts/wpass
									
										
									
									
									
										
										
										Normal file → Executable file
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue