Define wrapNonNixProgram as a helper utility
Write a simple Nix expression to DRY up my writeShellScriptBin wrapper pattern.
This commit is contained in:
parent
beeed2baa2
commit
c46fd5ee14
1 changed files with 7 additions and 8 deletions
|
@ -1,6 +1,10 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
|
wrapNonNixProgram = { path, as }: pkgs.writeShellScriptBin as ''
|
||||||
|
exec ${path} "$@"
|
||||||
|
'';
|
||||||
|
in {
|
||||||
home = {
|
home = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
bat
|
bat
|
||||||
|
@ -41,9 +45,7 @@
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.writeShellScriptBin "git" ''
|
package = wrapNonNixProgram { path = "/usr/bin/git"; as = "git"; };
|
||||||
exec /usr/bin/git "$@"
|
|
||||||
'';
|
|
||||||
userName = "William Carroll";
|
userName = "William Carroll";
|
||||||
userEmail = "wpcarro@gmail.com";
|
userEmail = "wpcarro@gmail.com";
|
||||||
aliases = {
|
aliases = {
|
||||||
|
@ -145,10 +147,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
latitude = "51.49";
|
latitude = "51.49";
|
||||||
longitude = "-0.18";
|
longitude = "-0.18";
|
||||||
# The redshift from <nixpkgs> isn't working on gLinux.
|
package = wrapNonNixProgram { path = "/usr/bin/redshift"; as = "redshift"; };
|
||||||
package = pkgs.writeShellScriptBin "redshift" ''
|
|
||||||
exec /usr/bin/redshift "$@"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Hide the cursor during X sessions after 1 second.
|
# Hide the cursor during X sessions after 1 second.
|
||||||
|
|
Loading…
Reference in a new issue