because apparently i need a git repo

Compare changes

Choose any two refs to compare.

Changed files
+42 -1
common
scripts
+4 -1
common/config.nix
··· 1 1 { config, lib, pkgs, ... }: 2 - { 2 + let 3 + scriptsPkg = pkgs.callPackage ./scripts.nix {}; 4 + in { 3 5 imports = [ ./options.nix ]; 6 + environment.systemPackages = [scriptsPkg]; 4 7 # just a default. automatic-timezoned on workstations. 5 8 time.timeZone = lib.mkDefault "America/Chicago"; 6 9 # It's ASCII, but better!
+8
common/scripts.nix
··· 1 + { pkgs ? import <nixpkgs> {}, lib ? pkgs.lib, stdenv ? pkgs.stdenv, ... }: 2 + with pkgs; 3 + stdenv.mkDerivation { 4 + name = "common-scripts"; 5 + buildInputs = [ 6 + (writeScriptBin "nix-tmpl" builtins.readFile ../scripts/nix-tmpl.sh) 7 + ]; 8 + }
+30
scripts/nix-tmpl.sh
··· 1 + #!/usr/bin/env sh 2 + # handy script to grab templates for code projects 3 + 4 + TEMPLATES_REPO="https://github.com/NixOS/templates" 5 + CACHE_DIR="$HOME/.cache" 6 + CLONE_DIR="$CACHE_DIR/nix-tmpl" 7 + 8 + ARG_TEMPLATE_NAME="$1" 9 + TEMPLATE_DIR="$CLONE_DIR/$ARG_TEMPLATE_NAME" 10 + 11 + if [ -z "$ARG_TEMPLATE_NAME" ]; then 12 + echo "$0: no template specified" 13 + exit -1 14 + fi 15 + 16 + if [ ! -d "$CLONE_DIR" ]; then 17 + mkdir -p "$CACHE_DIR" 18 + git clone "$TEMPLATES_REPO" "$CLONE_DIR" 19 + fi 20 + 21 + pushd "$CLONE_DIR" > /dev/null 22 + git pull 23 + 24 + if [ ! -d "$TEMPLATE_DIR" ]; then 25 + echo "$0: template not found" 26 + exit -2 27 + fi 28 + popd > /dev/null 29 + 30 + cp -R "$TEMPLATE_DIR/." .