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];
};
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 {

View File

@ -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,8 +77,7 @@ 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;};
@ -101,6 +103,5 @@ in {
includes = ["~/.ssh/config.local"];
matchBlocks."*".user = "samw";
};
};
}

View File

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

View File

@ -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];
# 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)";
}

View File

@ -20,5 +20,5 @@ with pkgs; rec {
# development tools
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 {
name = "vim-vue-plugin";
src = pkgs.fetchFromGitHub {

View File

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

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 {
pname = "yubikey-manager";
version = "4.0.8";
@ -24,22 +31,25 @@ python3Packages.buildPythonPackage rec {
nativeBuildInputs = with python3Packages; [poetry-core];
propagatedBuildInputs =
with python3Packages; [
propagatedBuildInputs = with python3Packages;
[
click
cryptography
pyscard
pyusb
six
fido2
] ++ [
]
++ [
libu2f-host
libusb1
yubikey-personalization
];
makeWrapperArgs = [
"--prefix" "LD_LIBRARY_PATH" ":"
"--prefix"
"LD_LIBRARY_PATH"
":"
(lib.makeLibraryPath [libu2f-host libusb1 yubikey-personalization])
];

View File

@ -1,30 +1,30 @@
{ stdenv
, lib
, fetchFromGitHub
, imagemagickBig
, pkg-config
, libX11
, libv4l
, libiconv
, qtbase ? null
, darwin
, qtx11extras ? null
, wrapQtAppsHook ? null
, wrapGAppsHook
, gtk3
, xmlto
, docbook_xsl
, autoreconfHook
, dbus
, enableVideo ? stdenv.isLinux
{
stdenv,
lib,
fetchFromGitHub,
imagemagickBig,
pkg-config,
libX11,
libv4l,
libiconv,
qtbase ? null,
darwin,
qtx11extras ? null,
wrapQtAppsHook ? null,
wrapGAppsHook,
gtk3,
xmlto,
docbook_xsl,
autoreconfHook,
dbus,
enableVideo ? stdenv.isLinux,
# 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)
# for every scanned code.
# see https://github.com/mchehab/zbar/issues/104
, enableDbus ? false
, libintl
enableDbus ? false,
libintl,
}:
stdenv.mkDerivation rec {
pname = "zbar";
version = "0.23.90";
@ -41,23 +41,31 @@ stdenv.mkDerivation rec {
nativeBuildInputs =
[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 stdenv.isDarwin [libiconv darwin.apple_sdk.frameworks.Foundation];
# Disable assertions which include -dev QtBase file paths.
NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG";
configureFlags = [ "--without-python" ] ++ (if enableDbus then
[ "--with-dbusconfdir=${placeholder "out"}/share" ]
else
[ "--without-dbus" ]) ++ (if enableVideo then
[ "--with-gtk=gtk3" ]
configureFlags =
["--without-python"]
++ (
if enableDbus
then ["--with-dbusconfdir=${placeholder "out"}/share"]
else ["--without-dbus"]
)
++ (
if enableVideo
then ["--with-gtk=gtk3"]
else [
"--disable-video"
"--without-gtk"
"--without-qt"
]);
]
);
dontWrapQtApps = true;
dontWrapGApps = true;