add code formatter and reformat

This commit is contained in:
Tim Schubert 2022-08-04 21:05:37 +02:00
parent a055f4fa40
commit 8cd6ed1502
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
69 changed files with 1016 additions and 797 deletions

View file

@ -1,31 +1,29 @@
{ self
, nixpkgs
, home-manager
}@inputs:
let
hmConfiguration =
{ homeDirectory ? "/home/dadada"
, extraModules ? [ ]
, system ? "x86_64-linux"
, username ? "dadada"
, stateVersion
}:
(home-manager.lib.homeManagerConfiguration {
configuration = { ... }: {
imports = (nixpkgs.lib.attrValues self.hmModules) ++ extraModules;
nixpkgs = {
config = import ./nixpkgs-config.nix {
pkgs = nixpkgs;
};
};
manual.manpages.enable = false;
};
inherit system homeDirectory username stateVersion;
});
in
{
self,
nixpkgs,
home-manager,
} @ inputs: let
hmConfiguration = {
homeDirectory ? "/home/dadada",
extraModules ? [],
system ? "x86_64-linux",
username ? "dadada",
stateVersion,
}: (home-manager.lib.homeManagerConfiguration {
configuration = {...}: {
imports = (nixpkgs.lib.attrValues self.hmModules) ++ extraModules;
nixpkgs = {
config = import ./nixpkgs-config.nix {
pkgs = nixpkgs;
};
};
manual.manpages.enable = false;
};
inherit system homeDirectory username stateVersion;
});
in {
home = hmConfiguration {
extraModules = [ ./home ];
extraModules = [./home];
stateVersion = "20.09";
};
}

View file

@ -1,5 +1,9 @@
{ config, pkgs, lib, ... }:
let
{
config,
pkgs,
lib,
...
}: let
useFeatures = [
"alacritty"
#"emacs"
@ -14,8 +18,7 @@ let
"xdg"
"zsh"
];
in
{
in {
programs.git = {
signing = {
key = "D68C84695C087E0F733A28D0EEB8D1CE62C4DFEA";
@ -27,25 +30,27 @@ in
programs.gpg.settings.default-key = "99658A3EB5CD7C13";
dadada.home = lib.attrsets.genAttrs useFeatures (useFeatures: { enable = true; }) // {
session = {
enable = true;
sessionVars = {
EDITOR = "vim";
PAGER = "less";
MAILDIR = "\$HOME/.var/mail";
MBLAZE = "\$HOME/.config/mblaze";
NOTMUCH_CONFIG = "\$HOME/.config/notmuch/config";
dadada.home =
lib.attrsets.genAttrs useFeatures (useFeatures: {enable = true;})
// {
session = {
enable = true;
sessionVars = {
EDITOR = "vim";
PAGER = "less";
MAILDIR = "\$HOME/.var/mail";
MBLAZE = "\$HOME/.config/mblaze";
NOTMUCH_CONFIG = "\$HOME/.config/notmuch/config";
};
};
};
};
# Languagetool server for web extension
systemd.user.services."languagetool-http-server" = {
Unit = {
Description = "Languagetool HTTP server";
PartOf = [ "graphical-session-pre.target" ];
After = [ "graphical-session.target" ];
PartOf = ["graphical-session-pre.target"];
After = ["graphical-session.target"];
};
Service = {
@ -54,11 +59,11 @@ in
Restart = "always";
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Install = {WantedBy = ["graphical-session.target"];};
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.packages = import ./pkgs.nix { pkgs = pkgs; };
home.packages = import ./pkgs.nix {pkgs = pkgs;};
}

View file

@ -1,4 +1,4 @@
{ pkgs }:
{pkgs}:
with pkgs; [
anki
aqbanking

View file

@ -1,9 +1,12 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.dadada.home.alacritty;
in
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.dadada.home.alacritty;
in {
options.dadada.home.alacritty = {
enable = mkEnableOption "Enable alacritty config";
};
@ -78,12 +81,30 @@ in
};
indexed_colors = [
{ index = 16; color = "0xffa500"; }
{ index = 17; color = "0xb03060"; }
{ index = 18; color = "0x282828"; }
{ index = 19; color = "0x444155"; }
{ index = 20; color = "0xb8b8b8"; }
{ index = 21; color = "0xe8e8e8"; }
{
index = 16;
color = "0xffa500";
}
{
index = 17;
color = "0xb03060";
}
{
index = 18;
color = "0x282828";
}
{
index = 19;
color = "0x444155";
}
{
index = 20;
color = "0xb8b8b8";
}
{
index = 21;
color = "0xe8e8e8";
}
];
};
};

View file

@ -1,6 +1,9 @@
{ config, lib, ... }:
with lib;
{
config,
lib,
...
}:
with lib; {
options.dadada.home.colors = mkOption {
type = types.attrs;
description = "Color scheme";

View file

@ -1,9 +1,12 @@
{ self, nix-doom-emacs, ... }@inputs:
{
self,
nix-doom-emacs,
...
} @ inputs: {
alacritty = import ./alacritty;
colors = import ./colors.nix;
direnv = import ./direnv.nix;
emacs = import ./emacs { inherit nix-doom-emacs; };
emacs = import ./emacs {inherit nix-doom-emacs;};
fish = import ./fish.nix;
git = import ./git.nix;
gpg = import ./gpg.nix;

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.home.direnv;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.dadada.home.direnv;
in {
options.dadada.home.direnv = {
enable = mkEnableOption "Enable direnv config";
};

View file

@ -1,11 +1,13 @@
{ nix-doom-emacs, ... }:
{ config, pkgs, lib, ... }:
with lib;
let
{nix-doom-emacs, ...}: {
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.dadada.home.emacs;
in
{
imports = [ nix-doom-emacs.hmModule ];
in {
imports = [nix-doom-emacs.hmModule];
options.dadada.home.emacs = {
enable = mkEnableOption "Enable dadada emacs config";
};
@ -13,58 +15,57 @@ in
programs.doom-emacs = {
enable = true;
doomPrivateDir = ./doom.d;
emacsPackagesOverlay = self: super: with pkgs; {
tsc = super.tsc.overrideAttrs (old:
let
libtsc_dyn = rustPlatform.buildRustPackage rec {
pname = "emacs-tree-sitter";
version = "0.15.1";
src = fetchFromGitHub {
owner = "ubolonton";
repo = "emacs-tree-sitter";
rev = version;
sha256 = "sha256-WgkGtmw63+kRLTRiSEO4bFF2IguH5g4odCujyazkwJc=";
emacsPackagesOverlay = self: super:
with pkgs; {
tsc = super.tsc.overrideAttrs (old: let
libtsc_dyn = rustPlatform.buildRustPackage rec {
pname = "emacs-tree-sitter";
version = "0.15.1";
src = fetchFromGitHub {
owner = "ubolonton";
repo = "emacs-tree-sitter";
rev = version;
sha256 = "sha256-WgkGtmw63+kRLTRiSEO4bFF2IguH5g4odCujyazkwJc=";
};
preBuild = ''
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${stdenv.cc}/nix-support/libc-crt1-cflags) \
$(< ${stdenv.cc}/nix-support/libc-cflags) \
$(< ${stdenv.cc}/nix-support/cc-cflags) \
$(< ${stdenv.cc}/nix-support/libcxx-cxxflags) \
${lib.optionalString stdenv.cc.isClang "-idirafter ${stdenv.cc.cc}/lib/clang/${lib.getVersion stdenv.cc.cc}/include"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${lib.getVersion stdenv.cc.cc}/include/"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc} -isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/${stdenv.hostPlatform.config}"} \
$NIX_CFLAGS_COMPILE"
'';
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
cargoHash = "sha256-HB5tFR1slY2D6jb2mt4KrGrGBUUVrxiBjmVycO+qfYY=";
};
in {
inherit (libtsc_dyn) src;
preBuild = ''
export BINDGEN_EXTRA_CLANG_ARGS="$(< ${stdenv.cc}/nix-support/libc-crt1-cflags) \
$(< ${stdenv.cc}/nix-support/libc-cflags) \
$(< ${stdenv.cc}/nix-support/cc-cflags) \
$(< ${stdenv.cc}/nix-support/libcxx-cxxflags) \
${lib.optionalString stdenv.cc.isClang "-idirafter ${stdenv.cc.cc}/lib/clang/${lib.getVersion stdenv.cc.cc}/include"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${lib.getVersion stdenv.cc.cc}/include/"} \
${lib.optionalString stdenv.cc.isGNU
"-isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc} -isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/${stdenv.hostPlatform.config}"} \
$NIX_CFLAGS_COMPILE"
ext=${stdenv.hostPlatform.extensions.sharedLibrary}
dest=$out/share/emacs/site-lisp/elpa/tsc-${old.version}
install -D ${libtsc_dyn}/lib/libtsc_dyn$ext $dest/tsc-dyn$ext
echo -n "0.15.1" > $dest/DYN-VERSION
'';
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
cargoHash = "sha256-HB5tFR1slY2D6jb2mt4KrGrGBUUVrxiBjmVycO+qfYY=";
};
in
{
inherit (libtsc_dyn) src;
preBuild = ''
ext=${stdenv.hostPlatform.extensions.sharedLibrary}
dest=$out/share/emacs/site-lisp/elpa/tsc-${old.version}
install -D ${libtsc_dyn}/lib/libtsc_dyn$ext $dest/tsc-dyn$ext
echo -n "0.15.1" > $dest/DYN-VERSION
'';
});
tree-sitter-langs = super.tree-sitter-langs.overrideAttrs (old: {
postInstall = ''
dest=$out/share/emacs/site-lisp/elpa/tree-sitter-langs-${old.version}
echo -n "0.10.2" > $dest/BUNDLE-VERSION
${lib.concatStringsSep "\n"
(lib.mapAttrsToList (name: src: "name=${name}; ln -s ${src}/parser $dest/bin/\${name#tree-sitter-}.so") pkgs.tree-sitter.builtGrammars)};
'';
});
};
});
tree-sitter-langs = super.tree-sitter-langs.overrideAttrs (old: {
postInstall = ''
dest=$out/share/emacs/site-lisp/elpa/tree-sitter-langs-${old.version}
echo -n "0.10.2" > $dest/BUNDLE-VERSION
${lib.concatStringsSep "\n"
(lib.mapAttrsToList (name: src: "name=${name}; ln -s ${src}/parser $dest/bin/\${name#tree-sitter-}.so") pkgs.tree-sitter.builtGrammars)};
'';
});
};
};
home.file.".tree-sitter".source = (pkgs.runCommand "grammars" {} ''
mkdir -p $out/bin
echo -n "0.10.2" > $out/BUNDLE-VERSION
${lib.concatStringsSep "\n"
home.file.".tree-sitter".source = pkgs.runCommand "grammars" {} ''
mkdir -p $out/bin
echo -n "0.10.2" > $out/BUNDLE-VERSION
${lib.concatStringsSep "\n"
(lib.mapAttrsToList (name: src: "name=${name}; ln -s ${src}/parser $out/bin/\${name#tree-sitter-}.so") pkgs.tree-sitter.builtGrammars)};
'');
'';
};
}

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.home.fish;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.dadada.home.fish;
in {
options.dadada.home.fish = {
enable = mkEnableOption "Enable fish config";
};
@ -11,15 +14,17 @@ in
config = mkIf cfg.enable {
programs.fish = {
enable = true;
plugins = with pkgs; [{
name = "fzf";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "fzf";
rev = "c3defd4a922e97120503b45e26efa775bc672b50";
sha256 = "1k5b0nva0mbqc9830qhbcwxsi8d9b2p4ws1fq0bw9nkf2ripyp4p";
};
}];
plugins = with pkgs; [
{
name = "fzf";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "fzf";
rev = "c3defd4a922e97120503b45e26efa775bc672b50";
sha256 = "1k5b0nva0mbqc9830qhbcwxsi8d9b2p4ws1fq0bw9nkf2ripyp4p";
};
}
];
interactiveShellInit = ''
# fish git prompt
set __fish_git_prompt_show_informative_status 'yes'
@ -75,6 +80,6 @@ in
};
};
home.packages = [ pkgs.exa ];
home.packages = [pkgs.exa];
};
}

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.dadada.home.git;
in
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.dadada.home.git;
in {
options.dadada.home.git = {
enable = mkEnableOption "Enable git config";
};
@ -16,7 +19,7 @@ in
tab-in-indent = true;
tabwidth = 4;
};
alias = { };
alias = {};
pager = "delta";
};
column.ui = "never";

View file

@ -1,9 +1,11 @@
{ config, lib, ... }:
with lib;
let
cfg = config.dadada.home.gpg;
in
{
config,
lib,
...
}:
with lib; let
cfg = config.dadada.home.gpg;
in {
options.dadada.home.gpg = {
enable = mkEnableOption "Enable GnuPG config";
};
@ -29,7 +31,7 @@ in
};
programs.git.extraConfig = {
commit = { gpgSign = true; };
commit = {gpgSign = true;};
};
};
}

View file

@ -1,9 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.dadada.home.gtk;
in
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.dadada.home.gtk;
in {
options.dadada.home.gtk = {
enable = mkEnableOption "Enable GTK config";
};

View file

@ -1,16 +1,18 @@
{ config, lib, ... }:
with lib;
let
cfg = config.dadada.home.keyring;
in
{
config,
lib,
...
}:
with lib; let
cfg = config.dadada.home.keyring;
in {
options.dadada.home.keyring = {
enable = mkEnableOption "Enable keyring config";
};
config = mkIf cfg.enable {
services.gnome-keyring = {
enable = false;
components = [ "pkcs11" "secrets" ];
components = ["pkcs11" "secrets"];
};
};
}

View file

@ -1,9 +1,12 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.dadada.home.kitty;
in
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.dadada.home.kitty;
in {
options.dadada.home.kitty = {
enable = mkEnableOption "Enable kitty config";
};
@ -12,6 +15,6 @@ in
enable = true;
extraConfig = builtins.readFile ./config;
};
home.packages = [ pkgs.source-code-pro ];
home.packages = [pkgs.source-code-pro];
};
}

View file

@ -1,9 +1,13 @@
{ config, lib, pkgs, colors, ... }:
with lib;
let
cfg = config.dadada.home.mako;
in
{
config,
lib,
pkgs,
colors,
...
}:
with lib; let
cfg = config.dadada.home.mako;
in {
options.dadada.home.mako = {
enable = mkEnableOption "Enable mako config";
};

View file

@ -1,15 +1,17 @@
{ config, lib, ... }:
with lib;
let
cfg = config.dadada.home.session;
in
{
config,
lib,
...
}:
with lib; let
cfg = config.dadada.home.session;
in {
options.dadada.home.session = {
enable = mkEnableOption "Enable session variable management";
sessionVars = mkOption {
description = "Session variables";
type = types.attrs;
default = { };
default = {};
example = ''
EDITOR = "vim";
PAGER = "less";

View file

@ -1,9 +1,11 @@
{ config, lib, ... }:
with lib;
let
cfg = config.dadada.home.ssh;
in
{
config,
lib,
...
}:
with lib; let
cfg = config.dadada.home.ssh;
in {
options.dadada.home.ssh = {
enable = mkEnableOption "Enable SSH config";
};

View file

@ -1,9 +1,13 @@
{ config, pkgs, lib, colors, ... }:
with lib;
let
cfg = config.dadada.home.sway;
in
{
config,
pkgs,
lib,
colors,
...
}:
with lib; let
cfg = config.dadada.home.sway;
in {
options.dadada.home.sway = {
enable = mkEnableOption "Enable Sway config";
};
@ -26,7 +30,7 @@ in
wayland.windowManager.sway = {
enable = true;
config = null;
extraConfig = (builtins.readFile ./config);
extraConfig = builtins.readFile ./config;
extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
# needs qt5.qtwayland in systemPackages

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.home.syncthing;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.dadada.home.syncthing;
in {
options.dadada.home.syncthing = {
enable = mkEnableOption "Enable Syncthing config";
};

View file

@ -1,14 +1,13 @@
{ config
, lib
, pkgs
, colors ? ../../lib/colors.nix
, ...
}:
with lib;
let
cfg = config.dadada.home.termite;
in
{
config,
lib,
pkgs,
colors ? ../../lib/colors.nix,
...
}:
with lib; let
cfg = config.dadada.home.termite;
in {
options.dadada.home.termite = {
enable = mkEnableOption "Enable termite config";
};

View file

@ -1,9 +1,11 @@
{ config, lib, ... }:
with lib;
let
cfg = config.dadada.home.tmux;
in
{
config,
lib,
...
}:
with lib; let
cfg = config.dadada.home.tmux;
in {
options.dadada.home.tmux = {
enable = mkEnableOption "Enable tmux config";
};

View file

@ -1,10 +1,13 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.home.vim;
vimPlugins = pkgs.callPackage ../../../pkgs/vimPlugins { };
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.dadada.home.vim;
vimPlugins = pkgs.callPackage ../../../pkgs/vimPlugins {};
in {
options.dadada.home.vim = {
enable = mkEnableOption "Enable VIM config";
};

View file

@ -1,6 +1,10 @@
{ config, pkgs, lib, ... }:
with lib;
let
{
config,
pkgs,
lib,
...
}:
with lib; let
apps = {
"x-scheme-handler/mailto" = "userapp-Thunderbird-PB7NI0.desktop";
"message/rfc822" = "userapp-Thunderbird-PB7NI0.desktop";
@ -19,8 +23,7 @@ let
"application/pdf" = "org.pwmt.zathura.desktop";
};
cfg = config.dadada.home.xdg;
in
{
in {
options.dadada.home.xdg = {
enable = mkEnableOption "Enable XDG config";
};

View file

@ -1,9 +1,12 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.home.zsh;
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.dadada.home.zsh;
in {
options.dadada.home.zsh = {
enable = mkEnableOption "Enable ZSH config";
};

View file

@ -1,7 +1,6 @@
{ pkgs }:
{
{pkgs}: {
allowUnfree = true;
allowUnfreePredicate = (pkg: true);
allowUnfreePredicate = pkg: true;
allowBroken = false;
android_sdk.accept_license = true;
}