RIP tv tools

This commit is contained in:
tv 2015-06-22 19:34:32 +02:00
parent f651a2b10a
commit 130f27c48e
2 changed files with 0 additions and 102 deletions

View File

@ -1,101 +0,0 @@
{ config, pkgs, ... }:
let
inherit (pkgs) lib stdenv;
inherit (lib.strings) concatStringsSep stringAsChars;
inherit (lib.attrsets) attrValues mapAttrs;
inherit (lib) makeSearchPath;
inherit (import ../../lib { inherit pkgs; }) shell-escape;
# TODO make these scripts available in an maintenance shell
scripts = {
# just so we don't reboot accidentally
reboot =
''
echo no reboot >&2
exit 23
'';
rebuild =
''
nixpkgs=''${nixpkgs-/home/tv/src/nixpkgs}
nixos-rebuild \
--show-trace \
-I nixpkgs="$nixpkgs" \
switch \
2>&1 \
| sed ${shell-escape ''
s|"\(/home/tv/src/config/[^":]*\)"|\1|
s|^trace:\s*\(.*\)|\1|
''}
'';
};
wrap = script:
''
#! /bin/sh
set -euf
${script}
'';
#lib=$lib
#export PATH=$bin:${makeSearchPath "bin" buildInputs}
buildScript = name: script:
builtins.trace "building ${name}"
''
echo ${shell-escape script} > $bin/${shell-escape name}
chmod +x $bin/${shell-escape name}
'';
tools = pkgs.stdenv.mkDerivation rec {
name = "tools";
src = /var/empty;
buildInputs = [];
buildPhase =
''
mkdir $out
bin=$out/bin
mkdir $bin
${concatStringsSep "\n" (attrValues (mapAttrs buildScript scripts))}
'';
#''
#mkdir $out
#lib=$out/lib
#cp -r lib $lib
#bin=$out/bin
#mkdir $bin
#${concatStringsSep "\n" (attrValues (mapAttrs (name: script:
# ''
# {
# echo '#! /bin/sh'
# echo 'set -euf'
# echo "lib=$lib"
# echo "export PATH=$bin:${makeSearchPath "bin" buildInputs}"
# echo ${shell-escape script}
# } > $bin/${name}
# chmod +x $bin/${name}
# '') scripts))}
#'';
installPhase = ":";
};
in
{
environment.systemPackages = [ tools ];
}

View File

@ -18,7 +18,6 @@ in
../tv/sanitize.nix
../tv/smartd.nix
../tv/synaptics.nix
#../tv/tools.nix
../tv/urxvt.nix
../tv/xserver.nix
../wu/users.nix