diff options
author | tv <tv@shackspace.de> | 2015-04-08 01:07:01 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-05-19 23:16:56 +0200 |
commit | cd6374e641420ade3603f0fd23fe9afac5c443bc (patch) | |
tree | 14dd49072264f70f32d826fadc3489a7b101b62c /modules/tools.nix | |
parent | 6e70d8fc47f0725a63dc92c1c43d2b1831c7c4ef (diff) |
I Like To Move It
Diffstat (limited to 'modules/tools.nix')
-rw-r--r-- | modules/tools.nix | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/modules/tools.nix b/modules/tools.nix deleted file mode 100644 index 4be84a6b..00000000 --- a/modules/tools.nix +++ /dev/null @@ -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/[^":]*\)"|[31;1m\1[m| - s|^trace:\s*\(.*\)|[35;1m\1[m| - ''} - ''; - - }; - - 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 ]; -} |