From 35d07641b6e7fa5a5712da6a1323d685c010e362 Mon Sep 17 00:00:00 2001 From: Sam Willcocks Date: Tue, 14 Jun 2022 02:00:46 +0100 Subject: [PATCH] Format with alejandra --- flake.nix | 6 +-- home/aws.nix | 2 +- home/default.nix | 17 ++++--- home/docker.nix | 2 +- home/git.nix | 7 +-- home/gpg.nix | 4 +- home/macs.nix | 11 +++-- home/packages.nix | 8 +-- home/passwords.nix | 8 +-- home/profiles.nix | 8 +-- home/rust.nix | 2 +- home/vim-dev/default.nix | 10 ++-- home/vim.nix | 11 +++-- me.nix | 1 - pkgs/default.nix | 8 +-- pkgs/yubikey-manager/default.nix | 32 +++++++----- pkgs/zbar/default.nix | 84 +++++++++++++++++--------------- 17 files changed, 125 insertions(+), 96 deletions(-) diff --git a/flake.nix b/flake.nix index a38810c..ab17e90 100644 --- a/flake.nix +++ b/flake.nix @@ -63,8 +63,8 @@ extraModules = [./home/docker.nix ./home/aws.nix]; }; zinc = lib.mkHome { - profile = profiles.laptop; system = "aarch64-darwin"; + profile = profiles.laptop; }; }; } @@ -81,9 +81,7 @@ # `overrideDerivation`) so we filter out anything that isn't a derivation # - We also filter out any packages that aren't supported on the current # platform. - packages = with pkgs; (lib.filterAttrs (_: v: (lib.isDerivation v - && lib.meta.availableOn platform v)) - pkgs.mypkgs); + packages = with pkgs.lib; (filterAttrs (_: v: (isDerivation v && meta.availableOn platform v)) pkgs.mypkgs); formatter = pkgs.alejandra; # A devshell with useful utils devShells.default = pkgs.devshell.mkShell { diff --git a/home/aws.nix b/home/aws.nix index 4e336f8..572bb39 100644 --- a/home/aws.nix +++ b/home/aws.nix @@ -1 +1 @@ -{ pkgs, ... }: { home.packages = with pkgs; [ awscli2 ]; } +{pkgs, ...}: {home.packages = with pkgs; [awscli2];} diff --git a/home/default.nix b/home/default.nix index c880282..e77b0ff 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,9 @@ -{ pkgs, lib, ... }: - - let packages = pkgs.callPackage ./packages.nix {}; +{ + pkgs, + lib, + ... +}: let + packages = pkgs.callPackage ./packages.nix {}; in { home.packages = packages.all; home.sessionVariables = { @@ -74,11 +77,10 @@ in { enable = true; settings = { add_newline = false; - format = - "$username$hostname$shlvl$directory$git_branch$git_commit$git_state$git_metrics$git_status$hg_branch$docker_context$golang$kotlin$nodejs$python$rust$terraform$nix_shell$memory_usage$aws$gcloud$openstack$azure$env_var$crystal$custom$sudo$cmd_duration$line_break$jobs$status$shell$character"; + format = "$username$hostname$shlvl$directory$git_branch$git_commit$git_state$git_metrics$git_status$hg_branch$docker_context$golang$kotlin$nodejs$python$rust$terraform$nix_shell$memory_usage$aws$gcloud$openstack$azure$env_var$crystal$custom$sudo$cmd_duration$line_break$jobs$status$shell$character"; username.format = "[$user]($style) "; hostname.format = "[$hostname]($style) "; - directory = { truncation_length = -1; }; + directory = {truncation_length = -1;}; git_branch.format = "[$symbol$branch]($style) "; python.format = "[py \${pyenv_prefix}(\${version} )(\\($virtualenv\\) )]($style)"; nodejs.format = "[js ($version )]($style)"; @@ -98,9 +100,8 @@ in { ssh = { enable = true; - includes = [ "~/.ssh/config.local" ]; + includes = ["~/.ssh/config.local"]; matchBlocks."*".user = "samw"; }; - }; } diff --git a/home/docker.nix b/home/docker.nix index 1498d55..af86302 100644 --- a/home/docker.nix +++ b/home/docker.nix @@ -1 +1 @@ -{ pkgs, ... }: { home.packages = with pkgs; [ docker colima ]; } +{pkgs, ...}: {home.packages = with pkgs; [docker colima];} diff --git a/home/git.nix b/home/git.nix index 17af468..9a23f89 100644 --- a/home/git.nix +++ b/home/git.nix @@ -1,12 +1,13 @@ -{ ... }: { +{...}: { programs.git = { enable = true; userName = "Sam Willcocks"; userEmail = "sam@wlcx.cc"; - delta = { # Better diffs + delta = { + # Better diffs enable = true; - options = { line-numbers = true; }; + options = {line-numbers = true;}; }; aliases = { diff --git a/home/gpg.nix b/home/gpg.nix index 5fb8c2f..0e71bba 100644 --- a/home/gpg.nix +++ b/home/gpg.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { programs.gpg = { enable = true; mutableKeys = false; @@ -19,6 +19,6 @@ ]; # make yubikey work on macos? lolgpg # https://github.com/NixOS/nixpkgs/issues/155629 - scdaemonSettings = { disable-ccid = true; }; + scdaemonSettings = {disable-ccid = true;}; }; } diff --git a/home/macs.nix b/home/macs.nix index 42e1904..95b472f 100644 --- a/home/macs.nix +++ b/home/macs.nix @@ -1,12 +1,15 @@ -{ pkgs, lib, ... }: { +{ + pkgs, + lib, + ... +}: { # Mac specific packages. # TODO: have this in a central packages place rather than here - home.packages = with pkgs; [ pngpaste mypkgs.qrclip ]; + home.packages = with pkgs; [pngpaste mypkgs.qrclip]; # Use secretive for SSH agent programs.ssh.matchBlocks.all = lib.mkIf pkgs.stdenv.isDarwin { host = "*"; - extraOptions."IdentityAgent" = - "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; + extraOptions."IdentityAgent" = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; }; programs.zsh.initExtra = "eval $(/opt/homebrew/bin/brew shellenv)"; } diff --git a/home/packages.nix b/home/packages.nix index a0d0e16..0428bcb 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{pkgs}: with pkgs; rec { # The stuff you want installed everywhere. The necessities. base = [ @@ -15,10 +15,10 @@ with pkgs; rec { ]; # Networking shit - net = [ iperf3 nmap socat tcpdump ]; + net = [iperf3 nmap socat tcpdump]; # development tools - dev = [ jq nixfmt gh glab hexyl ]; + dev = [jq nixfmt gh glab hexyl]; - all = (base ++ net ++ dev); + all = base ++ net ++ dev; } diff --git a/home/passwords.nix b/home/passwords.nix index a345b37..f649099 100644 --- a/home/passwords.nix +++ b/home/passwords.nix @@ -1,9 +1,9 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ yubikey-manager ]; +{pkgs, ...}: { + home.packages = with pkgs; [yubikey-manager]; programs.password-store = { enable = true; - settings = { PASSWORD_STORE_DIR = "$HOME/.password-store"; }; - package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); + settings = {PASSWORD_STORE_DIR = "$HOME/.password-store";}; + package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); }; programs.zsh.shellAliases = { p = "pass"; diff --git a/home/profiles.nix b/home/profiles.nix index fdeaf74..bac14c7 100644 --- a/home/profiles.nix +++ b/home/profiles.nix @@ -1,8 +1,8 @@ { - dev = { ... }: { - imports = [ ./default.nix ./git.nix ./rust.nix ./vim.nix ./vim-dev.nix ]; + dev = {...}: { + imports = [./default.nix ./git.nix ./rust.nix ./vim.nix ./vim-dev.nix]; }; - laptop = { ... }: { + laptop = {...}: { imports = [ ./default.nix ./git.nix @@ -14,5 +14,5 @@ ./gpg.nix ]; }; - server = { ... }: { imports = [ ./default.nix ./git.nix ./vim.nix ]; }; + server = {...}: {imports = [./default.nix ./git.nix ./vim.nix];}; } diff --git a/home/rust.nix b/home/rust.nix index 7220b11..84d7a1a 100644 --- a/home/rust.nix +++ b/home/rust.nix @@ -1 +1 @@ -{ pkgs, ... }: { home.packages = [ pkgs.rustup pkgs.rust-analyzer ]; } +{pkgs, ...}: {home.packages = [pkgs.rustup pkgs.rust-analyzer];} diff --git a/home/vim-dev/default.nix b/home/vim-dev/default.nix index 3a2686b..2ef7159 100644 --- a/home/vim-dev/default.nix +++ b/home/vim-dev/default.nix @@ -1,5 +1,9 @@ -{ pkgs, lib, system, ... }: -let +{ + pkgs, + lib, + system, + ... +}: let vim-vue-plugin = pkgs.vimUtils.buildVimPlugin { name = "vim-vue-plugin"; src = pkgs.fetchFromGitHub { @@ -26,7 +30,7 @@ in { ] # delve is unsupported on aarch64-linux and golangci-lint is broken on darwin # (see https://github.com/NixOS/nixpkgs/issues/168984). - ++ lib.optionals (system != "aarch64-linux" && !pkgs.stdenv.isDarwin ) [ vim-go ]; + ++ lib.optionals (system != "aarch64-linux" && !pkgs.stdenv.isDarwin) [vim-go]; programs.neovim.extraConfig = '' lua <