Skip to content

Commit

Permalink
format everything with nixpkgs-fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Dec 22, 2022
1 parent 501773e commit cc6a13c
Show file tree
Hide file tree
Showing 25 changed files with 413 additions and 302 deletions.
3 changes: 1 addition & 2 deletions dotfiles/fzf/default.nix
Expand Up @@ -11,7 +11,6 @@
];

changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
changeDirWidgetOptions =
[ "--preview '${pkgs.tree}/bin/tree -C {} | head -200'" ];
changeDirWidgetOptions = [ "--preview '${pkgs.tree}/bin/tree -C {} | head -200'" ];
};
}
11 changes: 6 additions & 5 deletions dotfiles/git/default.nix
@@ -1,10 +1,11 @@
{ pkgs, ... }:
let
lazygit-config = if pkgs.stdenv.isDarwin then
"Library/Application Support/jesseduffield/lazygit/config.yml"
else
".config/jesseduffield/lazygit/config.yml";
in {
lazygit-config =
if pkgs.stdenv.isDarwin
then "Library/Application Support/jesseduffield/lazygit/config.yml"
else ".config/jesseduffield/lazygit/config.yml";
in
{
programs.git = {
enable = true;

Expand Down
3 changes: 2 additions & 1 deletion dotfiles/k9s/default.nix
Expand Up @@ -42,7 +42,8 @@ let
};
};
};
in {
in
{
# for non-work contexts, I use a version of k9s that uses the macOS system
# directories, but in work contexts I use an (older) version that uses
# ~/.k9s. Gotta have both for my skins to work!
Expand Down
16 changes: 10 additions & 6 deletions dotfiles/kakoune/default.nix
@@ -1,13 +1,17 @@
{ pkgs, ... }:
let
copyCommand =
if pkgs.stdenv.isDarwin then "pbcopy" else "${pkgs.xclip}/bin/xclip -in";
if pkgs.stdenv.isDarwin
then "pbcopy"
else "${pkgs.xclip}/bin/xclip -in";
pasteCommand =
if pkgs.stdenv.isDarwin then "pbpaste" else "${pkgs.xclip}/bin/xclip -out";
if pkgs.stdenv.isDarwin
then "pbpaste"
else "${pkgs.xclip}/bin/xclip -out";

similar-sort-files-cmd = arg:
"git ls-files --others --cached --exclude-standard | ${pkgs.similar-sort}/bin/similar-sort ${arg} | grep -v ${arg} | fzf --tiebreak index";
in {
similar-sort-files-cmd = arg: "git ls-files --others --cached --exclude-standard | ${pkgs.similar-sort}/bin/similar-sort ${arg} | grep -v ${arg} | fzf --tiebreak index";
in
{
home.packages = [
# there's no configuration option for shellcheck.kak; it has to be in the PATH
# to work!
Expand Down Expand Up @@ -343,7 +347,7 @@ in {
hook global WinSetOption filetype=terraform %{
expandtab-with-width 2
evaluate-commands %sh{
if which terraform > /dev/null; then
echo 'set-option buffer formatcmd "terraform fmt -"'
Expand Down
3 changes: 2 additions & 1 deletion dotfiles/tmux/default.nix
Expand Up @@ -16,7 +16,8 @@ let
${pkgs.git}/bin/git rev-parse --abbrev-ref HEAD
fi
'';
in {
in
{
home.packages = [ pkgs.tmux-session ];

programs.tmux = {
Expand Down
57 changes: 31 additions & 26 deletions dotfiles/zsh/default.nix
Expand Up @@ -17,8 +17,9 @@ let

extraInitExtra =
builtins.foldl' (soFar: new: soFar + "\n" + builtins.readFile new) ""
extras;
in {
extras;
in
{
programs.zsh = {
enable = true;

Expand All @@ -27,37 +28,41 @@ in {
enableAutosuggestions = true;
enableCompletion = true;

plugins = [{
name = "fzf-tab";
src = pkgs.fzf-tab;
}];
plugins = [
{
name = "fzf-tab";
src = pkgs.fzf-tab;
}
];

initExtra = ''
EDITOR=hx
export EDITOR
initExtra =
''
EDITOR=hx
export EDITOR
alias ready='gh pr create --reviewer NoRedInk/team-kraken'
alias ready='gh pr create --reviewer NoRedInk/team-kraken'
# see `man zshoptions`
setopt PROMPT_SUBST # do parameter, command, and arithmetic expansion in prompts
setopt PROMPT_SP # preserve partial lines, adding inverse-colored % after a line
# see `man zshoptions`
setopt PROMPT_SUBST # do parameter, command, and arithmetic expansion in prompts
setopt PROMPT_SP # preserve partial lines, adding inverse-colored % after a line
EMOJI_NEUTRAL=(😃 🤓 👾 🤖 💯 🐵 🦍 🐺 🐈 🦄 🦅 🦉 🐬 🐋 🐙 🌲 🌳 🍀 🍁 🍇 🍍 🍩 🌍 🌎 🌏 🚄 🚍 🚲 🛴 🚡 🚠 🚀)
EMOJI_UNHAPPY=(😵 😲 🤡 👹 😿 💔 💢)
EMOJI_PROMPT="''${EMOJI_NEUTRAL[$RANDOM % ''${#EMOJI_NEUTRAL[@]}]}"
EMOJI_PROMPT_ERROR="''${EMOJI_UNHAPPY[$RANDOM % ''${#EMOJI_UNHAPPY[@]}]}"
EMOJI_NEUTRAL=(😃 🤓 👾 🤖 💯 🐵 🦍 🐺 🐈 🦄 🦅 🦉 🐬 🐋 🐙 🌲 🌳 🍀 🍁 🍇 🍍 🍩 🌍 🌎 🌏 🚄 🚍 🚲 🛴 🚡 🚠 🚀)
EMOJI_UNHAPPY=(😵 😲 🤡 👹 😿 💔 💢)
EMOJI_PROMPT="''${EMOJI_NEUTRAL[$RANDOM % ''${#EMOJI_NEUTRAL[@]}]}"
EMOJI_PROMPT_ERROR="''${EMOJI_UNHAPPY[$RANDOM % ''${#EMOJI_UNHAPPY[@]}]}"
PROMPT="%(?.$EMOJI_PROMPT .$EMOJI_PROMPT_ERROR [%F{red}%?%f] )%B%F{blue}%c%f%b %F{blue}»%f "
RPROMPT=
PROMPT="%(?.$EMOJI_PROMPT .$EMOJI_PROMPT_ERROR [%F{red}%?%f] )%B%F{blue}%c%f%b %F{blue}»%f "
RPROMPT=
# 1password plugins
alias gh="op plugin run -- gh"
# 1password plugins
alias gh="op plugin run -- gh"
# grab Homebrew binaries if needed
if test -d /opt/homebrew/bin; then
export PATH="$PATH:/opt/homebrew/bin"
fi
'' + extraInitExtra;
# grab Homebrew binaries if needed
if test -d /opt/homebrew/bin; then
export PATH="$PATH:/opt/homebrew/bin"
fi
''
+ extraInitExtra;

history = {
save = 10000;
Expand Down
100 changes: 54 additions & 46 deletions flake.nix
Expand Up @@ -126,7 +126,8 @@
# up in this package. I'd love to move it to a real flake, though,
# so things would be all in one place!
kak-tree = final.callPackage ./pkgs/kak-tree { inherit naersk; };
in {
in
{
comma = final.callPackage inputs.comma { };

# is this going to cause problems by not actually being a package?
Expand All @@ -152,55 +153,57 @@

kak-tree = kak-tree.kak-tree;

kakounePlugins = let
buildKakounePlugin = name: input:
final.kakouneUtils.buildKakounePlugin {
pname = name;
version = input.rev;
src = input;
kakounePlugins =
let
buildKakounePlugin = name: input:
final.kakouneUtils.buildKakounePlugin {
pname = name;
version = input.rev;
src = input;
};
in
prev.kakounePlugins // {
active-window =
buildKakounePlugin "active-window" inputs.active-window;

auto-pairs = final.kakouneUtils.buildKakounePlugin {
pname = "auto-pairs";
version = "vendored";
src = ./vendor/auto-pairs.kak;
};
in prev.kakounePlugins // {
active-window =
buildKakounePlugin "active-window" inputs.active-window;

auto-pairs = final.kakouneUtils.buildKakounePlugin {
pname = "auto-pairs";
version = "vendored";
src = ./vendor/auto-pairs.kak;
};

kak-ayu = final.callPackage ./pkgs/kak-ayu { };
kak-ayu = final.callPackage ./pkgs/kak-ayu { };

kak-tmux-command = final.kakouneUtils.buildKakounePlugin {
pname = "kak-tmux-command";
version = "source";
src = ./pkgs/kak-tmux-command;
};
kak-tmux-command = final.kakouneUtils.buildKakounePlugin {
pname = "kak-tmux-command";
version = "source";
src = ./pkgs/kak-tmux-command;
};

kak-tree = kak-tree.kakounePlugins.kak-tree;
kak-tree = kak-tree.kakounePlugins.kak-tree;

kakoune-auto-percent = buildKakounePlugin "kakoune-auto-percent"
inputs.kakoune-auto-percent;
kakoune-auto-percent = buildKakounePlugin "kakoune-auto-percent"
inputs.kakoune-auto-percent;

kakoune-find =
buildKakounePlugin "kakoune-find" inputs.kakoune-find;
kakoune-find =
buildKakounePlugin "kakoune-find" inputs.kakoune-find;

kakoune-idris =
buildKakounePlugin "kakoune-idris" inputs.kakoune-idris;
kakoune-idris =
buildKakounePlugin "kakoune-idris" inputs.kakoune-idris;

kakoune-surround =
buildKakounePlugin "kakoune-surround" inputs.kakoune-surround;
kakoune-surround =
buildKakounePlugin "kakoune-surround" inputs.kakoune-surround;

prelude-kak = buildKakounePlugin "prelude.kak" inputs.prelude-kak;
prelude-kak = buildKakounePlugin "prelude.kak" inputs.prelude-kak;

shellcheck-kak =
buildKakounePlugin "shellcheck.kak" inputs.shellcheck-kak;
shellcheck-kak =
buildKakounePlugin "shellcheck.kak" inputs.shellcheck-kak;

smarttab-kak =
buildKakounePlugin "smarttab.kak" inputs.smarttab-kak;
smarttab-kak =
buildKakounePlugin "smarttab.kak" inputs.smarttab-kak;

tug = buildKakounePlugin "tug" inputs.tug;
};
tug = buildKakounePlugin "tug" inputs.tug;
};

k9s-skins = final.stdenv.mkDerivation {
pname = "k9s-skins";
Expand All @@ -219,13 +222,15 @@
${final.pandoc}/bin/pandoc -s -f markdown -t man $1 | ${final.groff}/bin/groff -T utf8 -man | ${final.less}/bin/less
'';

niv = let
nivSources = import "${inputs.niv}/nix/sources.nix" { };
nivNixpkgs = import nivSources.nixpkgs {
sources = nivSources;
inherit system;
};
in (nivNixpkgs.callPackage inputs.niv { }).niv;
niv =
let
nivSources = import "${inputs.niv}/nix/sources.nix" { };
nivNixpkgs = import nivSources.nixpkgs {
sources = nivSources;
inherit system;
};
in
(nivNixpkgs.callPackage inputs.niv { }).niv;

nix-index = inputs.nix-index.packages.${system}.nix-index;

Expand Down Expand Up @@ -254,7 +259,10 @@
prev.tree-grepper.overrideAttrs (attrs: { doCheck = false; });
})
];
in {
in
{
formatter.aarch64-darwin = inputs.nixpkgs.legacyPackages.aarch64-darwin.nixpkgs-fmt;

nixosConfigurations.torch = inputs.nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
Expand Down
21 changes: 12 additions & 9 deletions machines/flame/default.nix
@@ -1,6 +1,7 @@
{ config, pkgs, ... }:

{
{ config
, pkgs
, ...
}: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = [
Expand Down Expand Up @@ -33,12 +34,14 @@
# /etc/nix/nix.conf. github.com/nix-community/linuxkit-nix seems to do the
# rest just fine.
nix.distributedBuilds = true;
nix.buildMachines = [{
hostName = "nix-docker";
system = "x86_64-linux";
maxJobs = 4;
sshKey = "/etc/nix/docker_rsa";
}];
nix.buildMachines = [
{
hostName = "nix-docker";
system = "x86_64-linux";
maxJobs = 4;
sshKey = "/etc/nix/docker_rsa";
}
];

# dotfiles
home-manager = {
Expand Down
4 changes: 1 addition & 3 deletions machines/flame/defaults.nix
@@ -1,6 +1,4 @@
{ ... }:

{
{ ... }: {
system.keyboard = {
enableKeyMapping = true;

Expand Down
24 changes: 13 additions & 11 deletions machines/sequoia/default.nix
@@ -1,6 +1,7 @@
{ config, pkgs, ... }:

{
{ config
, pkgs
, ...
}: {
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget

Expand All @@ -25,21 +26,22 @@

# use nixbuild.net for distributed builds
nix.distributedBuilds = true;
nix.buildMachines = [{
hostName = "eu.nixbuild.net";
system = "x86_64-linux";
maxJobs = 100;
supportedFeatures = [ "benchmark" "big-parallel" ];
}];
nix.buildMachines = [
{
hostName = "eu.nixbuild.net";
system = "x86_64-linux";
maxJobs = 100;
supportedFeatures = [ "benchmark" "big-parallel" ];
}
];
nix.extraOptions = ''
builders-use-substitutes = true
experimental-features = nix-command flakes
'';
programs.ssh.knownHosts = {
nixBuild = {
hostNames = [ "eu.nixbuild.net" ];
publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIQCZc54poJ8vqawd8TraNryQeJnvH1eLpIDgbiqymM";
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIQCZc54poJ8vqawd8TraNryQeJnvH1eLpIDgbiqymM";
};
};

Expand Down
8 changes: 4 additions & 4 deletions machines/torch/default.nix
@@ -1,10 +1,10 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
inputs:
{ config, pkgs, ... }:

{
inputs: { config
, pkgs
, ...
}: {
imports = [
# hardware
./hardware-configuration.nix
Expand Down

0 comments on commit cc6a13c

Please sign in to comment.