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 +1 @@
{ pkgs, ... }: { home.packages = with pkgs; [ awscli2 ]; }
{pkgs, ...}: {home.packages = with pkgs; [awscli2];}

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,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";
};
};
}

View File

@ -1 +1 @@
{ pkgs, ... }: { home.packages = with pkgs; [ docker colima ]; }
{pkgs, ...}: {home.packages = with pkgs; [docker colima];}

View File

@ -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 = {

View File

@ -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;};
};
}

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

@ -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;
}

View File

@ -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";

View File

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

View File

@ -1 +1 @@
{ pkgs, ... }: { home.packages = [ pkgs.rustup pkgs.rust-analyzer ]; }
{pkgs, ...}: {home.packages = [pkgs.rustup pkgs.rust-analyzer];}

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 {
@ -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 <<EOF
${builtins.readFile ./dev.lua}

View File

@ -1,8 +1,13 @@
# 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, ... }: {
home.sessionVariables = { "EDITOR" = "nvim"; };
home.packages = with pkgs; [ rnix-lsp ripgrep ];
{
pkgs,
lib,
strings,
...
}: {
home.sessionVariables = {"EDITOR" = "nvim";};
home.packages = with pkgs; [rnix-lsp ripgrep];
programs.neovim = {
enable = true;
viAlias = true;

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,6 +1,6 @@
# TODO: auto import everything
{ pkgs, ... }: {
qrclip = pkgs.callPackage ./qrclip { };
zbar = pkgs.callPackage ./zbar { };
yubikey-manager = pkgs.callPackage ./yubikey-manager { };
{pkgs, ...}: {
qrclip = pkgs.callPackage ./qrclip {};
zbar = pkgs.callPackage ./zbar {};
yubikey-manager = pkgs.callPackage ./yubikey-manager {};
}

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";
@ -12,7 +19,7 @@ python3Packages.buildPythonPackage rec {
sha256 = "sha256-OszXOu/NhoX4WutsT4Z1LsY54KTOWRKt13yDo2fzDbA=";
};
patches = [ ./lol.patch ];
patches = [./lol.patch];
doCheck = false;
postPatch = ''
@ -22,25 +29,28 @@ python3Packages.buildPythonPackage rec {
--replace 'pkill' '${procps}/bin/pkill'
'';
nativeBuildInputs = with python3Packages; [ poetry-core ];
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" ":"
(lib.makeLibraryPath [ libu2f-host libusb1 yubikey-personalization ])
"--prefix"
"LD_LIBRARY_PATH"
":"
(lib.makeLibraryPath [libu2f-host libusb1 yubikey-personalization])
];
postInstall = ''
@ -55,7 +65,7 @@ python3Packages.buildPythonPackage rec {
--replace 'compdef _ykman_completion ykman;' '_ykman_completion "$@"'
'';
checkInputs = with python3Packages; [ pytestCheckHook makefun ];
checkInputs = with python3Packages; [pytestCheckHook makefun];
meta = with lib; {
homepage = "https://developers.yubico.com/yubikey-manager";
@ -63,6 +73,6 @@ python3Packages.buildPythonPackage rec {
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = with maintainers; [ benley lassulus pinpox ];
maintainers = with maintainers; [benley lassulus pinpox];
};
}

View File

@ -1,35 +1,35 @@
{ 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";
outputs = [ "out" "lib" "dev" "doc" "man" ];
outputs = ["out" "lib" "dev" "doc" "man"];
src = fetchFromGitHub {
owner = "mchehab";
@ -39,25 +39,33 @@ stdenv.mkDerivation rec {
};
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 ]
++ lib.optionals enableVideo [ libv4l gtk3 qtbase qtx11extras ]
++ lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.Foundation ];
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" ]
else [
"--disable-video"
"--without-gtk"
"--without-qt"
]);
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;
@ -78,7 +86,7 @@ stdenv.mkDerivation rec {
EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR
Code.
'';
maintainers = with maintainers; [ delroth raskin ];
maintainers = with maintainers; [delroth raskin];
platforms = platforms.unix;
license = licenses.lgpl21;
homepage = "https://github.com/mchehab/zbar";