Format with alejandra

This commit is contained in:
Sam W 2022-06-14 02:00:46 +01:00
parent 500bcd20eb
commit 35d07641b6
17 changed files with 125 additions and 96 deletions

View File

@ -63,8 +63,8 @@
extraModules = [./home/docker.nix ./home/aws.nix]; extraModules = [./home/docker.nix ./home/aws.nix];
}; };
zinc = lib.mkHome { zinc = lib.mkHome {
profile = profiles.laptop;
system = "aarch64-darwin"; system = "aarch64-darwin";
profile = profiles.laptop;
}; };
}; };
} }
@ -81,9 +81,7 @@
# `overrideDerivation`) so we filter out anything that isn't a derivation # `overrideDerivation`) so we filter out anything that isn't a derivation
# - We also filter out any packages that aren't supported on the current # - We also filter out any packages that aren't supported on the current
# platform. # platform.
packages = with pkgs; (lib.filterAttrs (_: v: (lib.isDerivation v packages = with pkgs.lib; (filterAttrs (_: v: (isDerivation v && meta.availableOn platform v)) pkgs.mypkgs);
&& lib.meta.availableOn platform v))
pkgs.mypkgs);
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
# A devshell with useful utils # A devshell with useful utils
devShells.default = pkgs.devshell.mkShell { devShells.default = pkgs.devshell.mkShell {

View File

@ -1,6 +1,9 @@
{ pkgs, lib, ... }: {
pkgs,
let packages = pkgs.callPackage ./packages.nix {}; lib,
...
}: let
packages = pkgs.callPackage ./packages.nix {};
in { in {
home.packages = packages.all; home.packages = packages.all;
home.sessionVariables = { home.sessionVariables = {
@ -74,8 +77,7 @@ in {
enable = true; enable = true;
settings = { settings = {
add_newline = false; add_newline = false;
format = 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$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) "; username.format = "[$user]($style) ";
hostname.format = "[$hostname]($style) "; hostname.format = "[$hostname]($style) ";
directory = {truncation_length = -1;}; directory = {truncation_length = -1;};
@ -101,6 +103,5 @@ in {
includes = ["~/.ssh/config.local"]; includes = ["~/.ssh/config.local"];
matchBlocks."*".user = "samw"; matchBlocks."*".user = "samw";
}; };
}; };
} }

View File

@ -4,7 +4,8 @@
userName = "Sam Willcocks"; userName = "Sam Willcocks";
userEmail = "sam@wlcx.cc"; userEmail = "sam@wlcx.cc";
delta = { # Better diffs delta = {
# Better diffs
enable = true; enable = true;
options = {line-numbers = true;}; options = {line-numbers = true;};
}; };

View File

@ -1,12 +1,15 @@
{ pkgs, lib, ... }: { {
pkgs,
lib,
...
}: {
# Mac specific packages. # Mac specific packages.
# TODO: have this in a central packages place rather than here # 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 # Use secretive for SSH agent
programs.ssh.matchBlocks.all = lib.mkIf pkgs.stdenv.isDarwin { programs.ssh.matchBlocks.all = lib.mkIf pkgs.stdenv.isDarwin {
host = "*"; host = "*";
extraOptions."IdentityAgent" = extraOptions."IdentityAgent" = "~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
"~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
}; };
programs.zsh.initExtra = "eval $(/opt/homebrew/bin/brew shellenv)"; programs.zsh.initExtra = "eval $(/opt/homebrew/bin/brew shellenv)";
} }

View File

@ -20,5 +20,5 @@ with pkgs; rec {
# development tools # development tools
dev = [jq nixfmt gh glab hexyl]; dev = [jq nixfmt gh glab hexyl];
all = (base ++ net ++ dev); all = base ++ net ++ dev;
} }

View File

@ -1,5 +1,9 @@
{ pkgs, lib, system, ... }: {
let pkgs,
lib,
system,
...
}: let
vim-vue-plugin = pkgs.vimUtils.buildVimPlugin { vim-vue-plugin = pkgs.vimUtils.buildVimPlugin {
name = "vim-vue-plugin"; name = "vim-vue-plugin";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {

View File

@ -1,6 +1,11 @@
# This module sets up a "full" neovim install with plugins and unicorns. It # This module sets up a "full" neovim install with plugins and unicorns. It
# also makes neovim the default editor and aliases vim to nvim. # also makes neovim the default editor and aliases vim to nvim.
{ pkgs, lib, strings, ... }: { {
pkgs,
lib,
strings,
...
}: {
home.sessionVariables = {"EDITOR" = "nvim";}; home.sessionVariables = {"EDITOR" = "nvim";};
home.packages = with pkgs; [rnix-lsp ripgrep]; home.packages = with pkgs; [rnix-lsp ripgrep];
programs.neovim = { programs.neovim = {

1
me.nix
View File

@ -8,4 +8,3 @@
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG97EFzrTE5jI0P5CP5/y/thCzGNHt74u2mpXpdrB25URrn3ABDJcbmO/tGtNR8uhM3n/kUpr6Ax27orjmIOQtA= boron-se-main@secretive.boron.local" "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG97EFzrTE5jI0P5CP5/y/thCzGNHt74u2mpXpdrB25URrn3ABDJcbmO/tGtNR8uhM3n/kUpr6Ax27orjmIOQtA= boron-se-main@secretive.boron.local"
]; ];
} }

View File

@ -1,5 +1,12 @@
{ python3Packages, fetchFromGitHub, lib, yubikey-personalization, libu2f-host, libusb1, procps }: {
python3Packages,
fetchFromGitHub,
lib,
yubikey-personalization,
libu2f-host,
libusb1,
procps,
}:
python3Packages.buildPythonPackage rec { python3Packages.buildPythonPackage rec {
pname = "yubikey-manager"; pname = "yubikey-manager";
version = "4.0.8"; version = "4.0.8";
@ -24,22 +31,25 @@ python3Packages.buildPythonPackage rec {
nativeBuildInputs = with python3Packages; [poetry-core]; nativeBuildInputs = with python3Packages; [poetry-core];
propagatedBuildInputs = propagatedBuildInputs = with python3Packages;
with python3Packages; [ [
click click
cryptography cryptography
pyscard pyscard
pyusb pyusb
six six
fido2 fido2
] ++ [ ]
++ [
libu2f-host libu2f-host
libusb1 libusb1
yubikey-personalization yubikey-personalization
]; ];
makeWrapperArgs = [ makeWrapperArgs = [
"--prefix" "LD_LIBRARY_PATH" ":" "--prefix"
"LD_LIBRARY_PATH"
":"
(lib.makeLibraryPath [libu2f-host libusb1 yubikey-personalization]) (lib.makeLibraryPath [libu2f-host libusb1 yubikey-personalization])
]; ];

View File

@ -1,30 +1,30 @@
{ stdenv {
, lib stdenv,
, fetchFromGitHub lib,
, imagemagickBig fetchFromGitHub,
, pkg-config imagemagickBig,
, libX11 pkg-config,
, libv4l libX11,
, libiconv libv4l,
, qtbase ? null libiconv,
, darwin qtbase ? null,
, qtx11extras ? null darwin,
, wrapQtAppsHook ? null qtx11extras ? null,
, wrapGAppsHook wrapQtAppsHook ? null,
, gtk3 wrapGAppsHook,
, xmlto gtk3,
, docbook_xsl xmlto,
, autoreconfHook docbook_xsl,
, dbus autoreconfHook,
, enableVideo ? stdenv.isLinux dbus,
enableVideo ? stdenv.isLinux,
# The implementation is buggy and produces an error like # The implementation is buggy and produces an error like
# Name Error (Connection ":1.4380" is not allowed to own the service "org.linuxtv.Zbar" due to security policies in the configuration file) # Name Error (Connection ":1.4380" is not allowed to own the service "org.linuxtv.Zbar" due to security policies in the configuration file)
# for every scanned code. # for every scanned code.
# see https://github.com/mchehab/zbar/issues/104 # see https://github.com/mchehab/zbar/issues/104
, enableDbus ? false enableDbus ? false,
, libintl libintl,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "zbar"; pname = "zbar";
version = "0.23.90"; version = "0.23.90";
@ -41,23 +41,31 @@ stdenv.mkDerivation rec {
nativeBuildInputs = nativeBuildInputs =
[pkg-config xmlto autoreconfHook docbook_xsl] ++ lib.optionals enableVideo [wrapQtAppsHook wrapGAppsHook]; [pkg-config xmlto autoreconfHook docbook_xsl] ++ lib.optionals enableVideo [wrapQtAppsHook wrapGAppsHook];
buildInputs = [ imagemagickBig libX11 libintl ] ++ lib.optionals enableDbus [ dbus ] buildInputs =
[imagemagickBig libX11 libintl]
++ lib.optionals enableDbus [dbus]
++ lib.optionals enableVideo [libv4l gtk3 qtbase qtx11extras] ++ lib.optionals enableVideo [libv4l gtk3 qtbase qtx11extras]
++ lib.optionals stdenv.isDarwin [libiconv darwin.apple_sdk.frameworks.Foundation]; ++ lib.optionals stdenv.isDarwin [libiconv darwin.apple_sdk.frameworks.Foundation];
# Disable assertions which include -dev QtBase file paths. # Disable assertions which include -dev QtBase file paths.
NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG"; NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG";
configureFlags = [ "--without-python" ] ++ (if enableDbus then configureFlags =
[ "--with-dbusconfdir=${placeholder "out"}/share" ] ["--without-python"]
else ++ (
[ "--without-dbus" ]) ++ (if enableVideo then if enableDbus
[ "--with-gtk=gtk3" ] then ["--with-dbusconfdir=${placeholder "out"}/share"]
else ["--without-dbus"]
)
++ (
if enableVideo
then ["--with-gtk=gtk3"]
else [ else [
"--disable-video" "--disable-video"
"--without-gtk" "--without-gtk"
"--without-qt" "--without-qt"
]); ]
);
dontWrapQtApps = true; dontWrapQtApps = true;
dontWrapGApps = true; dontWrapGApps = true;