From da6e3fee946fffeb649527d5a131f7c7cf707ea1 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Sun, 15 Dec 2019 01:08:22 -0700 Subject: [PATCH] format with nixpkgs#nixpkgs-fmt --- configurations/default.nix | 8 ++----- lib/utils.nix | 40 +++++++++++++++---------------- profiles/develop/tmux/default.nix | 16 ++++++------- profiles/develop/zsh/default.nix | 33 +++++++++++++------------ 4 files changed, 46 insertions(+), 51 deletions(-) diff --git a/configurations/default.nix b/configurations/default.nix index 82e25c0..44f7963 100644 --- a/configurations/default.nix +++ b/configurations/default.nix @@ -15,16 +15,12 @@ let global = { _module.args.utils = utils; - - system.configurationRevision = flake.rev; - networking.hostName = self; - nix.package = nix.defaultPackage."${system}"; + system.configurationRevision = flake.rev; }; local = vimport ./. "${self}.nix"; - in [ core @@ -34,4 +30,4 @@ let }; in - reqImport { dir = ./.; _import = config; } +reqImport { dir = ./.; _import = config; } diff --git a/lib/utils.nix b/lib/utils.nix index 6a9275d..691e3f5 100644 --- a/lib/utils.nix +++ b/lib/utils.nix @@ -26,26 +26,26 @@ rec { vimport = path: name: import (path + "/${name}"); - reqImport = { - dir, - _import ? base: vimport dir (base + ".nix") - }: - mapFilterAttrs - (_: v: v != null) - ( - n: v: - if - n != "default.nix" - && hasSuffix ".nix" n - && v == "regular" + reqImport = + { dir + , _import ? base: vimport dir (base + ".nix") + }: + mapFilterAttrs + (_: v: v != null) + ( + n: v: + if + n != "default.nix" + && hasSuffix ".nix" n + && v == "regular" - then let - name = removeSuffix ".nix" n; - in - nameValuePair (name) (_import name) + then let + name = removeSuffix ".nix" n; + in + nameValuePair (name) (_import name) - else - nameValuePair ("") (null) - ) - (readDir dir); + else + nameValuePair ("") (null) + ) + (readDir dir); } diff --git a/profiles/develop/tmux/default.nix b/profiles/develop/tmux/default.nix index 88fa2bd..8c863dc 100644 --- a/profiles/develop/tmux/default.nix +++ b/profiles/develop/tmux/default.nix @@ -12,14 +12,14 @@ let pluginConf = plugins: concatStringsSep "\n\n" - ( - map ( - plugin: let - name = removePrefix "tmuxplugin-" plugin.name; - in - "run-shell ${plugin}/share/tmux-plugins/${name}/${name}.tmux" - ) plugins - ); + ( + map ( + plugin: let + name = removePrefix "tmuxplugin-" plugin.name; + in + "run-shell ${plugin}/share/tmux-plugins/${name}/${name}.tmux" + ) plugins + ); plugins = with pkgs.tmuxPlugins; [ copycat diff --git a/profiles/develop/zsh/default.nix b/profiles/develop/zsh/default.nix index deed2ed..847bd2b 100644 --- a/profiles/develop/zsh/default.nix +++ b/profiles/develop/zsh/default.nix @@ -17,15 +17,15 @@ in sessionVariables = let fd = "${pkgs.fd}/bin/fd -H"; in - { - BAT_PAGER = "less"; - SKIM_ALT_C_COMMAND = - "while read line; do " - + "line=\"'\${(Q)line}'\"; [[ -d \"'$line'\" ]] && echo \"'$line'\"; " - + "done < $HOME/.cache/zsh-cdr/recent-dirs"; - SKIM_DEFAULT_COMMAND = fd; - SKIM_CTRL_T_COMMAND = fd; - }; + { + BAT_PAGER = "less"; + SKIM_ALT_C_COMMAND = + "while read line; do " + + "line=\"'\${(Q)line}'\"; [[ -d \"'$line'\" ]] && echo \"'$line'\"; " + + "done < $HOME/.cache/zsh-cdr/recent-dirs"; + SKIM_DEFAULT_COMMAND = fd; + SKIM_CTRL_T_COMMAND = fd; + }; shellAliases = { cat = "${pkgs.bat}/bin/bat"; @@ -58,9 +58,9 @@ in nixpkgs.overlays = let purs = self: super: - { purs = super.callPackage ../../../pkgs/shells/zsh/purs {}; }; + { purs = super.callPackage ../../../pkgs/shells/zsh/purs {}; }; in - [ purs ]; + [ purs ]; programs.zsh = { @@ -86,12 +86,11 @@ in paths; plugins = concatStringsSep "\n" - ( - [ - "${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin" - ] ++ - source - ); + ( + [ + "${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin" + ] ++ source + );