about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--configs/.config/nixpkgs/home.nix14
-rw-r--r--default.nix1
-rw-r--r--utils.nix5
-rw-r--r--utils/default.nix14
4 files changed, 24 insertions, 10 deletions
diff --git a/configs/.config/nixpkgs/home.nix b/configs/.config/nixpkgs/home.nix
index 0c01a458ffb4..a344ca7b772e 100644
--- a/configs/.config/nixpkgs/home.nix
+++ b/configs/.config/nixpkgs/home.nix
@@ -1,9 +1,7 @@
 { config, pkgs, ... }:
 
 let
-  wrapNonNixProgram = { path, as }: pkgs.writeShellScriptBin as ''
-    exec ${path} "$@"
-  '';
+  briefcase = import <briefcase> {};
 in {
   home = {
     packages = with pkgs; [
@@ -45,7 +43,10 @@ in {
 
   programs.git = {
     enable = true;
-    package = wrapNonNixProgram { path = "/usr/bin/git"; as = "git"; };
+    package = briefcase.utils.wrapNonNixProgram {
+      path = "/usr/bin/git";
+      as = "git";
+    };
     userName = "William Carroll";
     userEmail = "wpcarro@gmail.com";
     aliases = {
@@ -147,7 +148,10 @@ in {
     enable = true;
     latitude = "51.49";
     longitude = "-0.18";
-    package = wrapNonNixProgram { path = "/usr/bin/redshift"; as = "redshift"; };
+    package = briefcase.utils.wrapNonNixProgram {
+      path = "/usr/bin/redshift";
+      as = "redshift";
+    };
   };
 
   # Hide the cursor during X sessions after 1 second.
diff --git a/default.nix b/default.nix
index dfc360ead56a..57bcb4e2b786 100644
--- a/default.nix
+++ b/default.nix
@@ -8,6 +8,7 @@ let
   };
 in {
   nixos       = readTree ./nixos;
+  utils       = readTree ./utils;
   emacs       = readTree ./emacs;
   blog        = readTree ./blog;
   lisp        = readTree ./lisp;
diff --git a/utils.nix b/utils.nix
deleted file mode 100644
index 1e1c5c243521..000000000000
--- a/utils.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-# Using this as a library to define some common utility functions that I often
-# reach for.
-{
-  identity = x: x;
-}
diff --git a/utils/default.nix b/utils/default.nix
new file mode 100644
index 000000000000..df9673daec70
--- /dev/null
+++ b/utils/default.nix
@@ -0,0 +1,14 @@
+{ pkgs, ... }:
+
+# Using this as a library to define some common utility functions that I often
+# reach for.
+{
+  # A unary function that returns its argument.
+  identity = x: x;
+
+  # Create a derivation that creates an executable shell script named `as` that
+  # calls the program located at `path`, forwarding all of the arguments.
+  wrapNonNixProgram = { path, as }: pkgs.writeShellScriptBin as ''
+    exec ${path} "$@"
+  '';
+}