chore: more cleanup

This commit is contained in:
dusk 2021-04-21 03:11:27 +03:00
parent a9162cc2ae
commit ee1d288dce
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
6 changed files with 131 additions and 123 deletions

View File

@ -3,13 +3,15 @@ let
inherit (builtins) attrNames isAttrs isInt readDir toJSON; inherit (builtins) attrNames isAttrs isInt readDir toJSON;
inherit (lib) filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix; inherit (lib) filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix;
in
rec {
# mapFilterAttrs :: # mapFilterAttrs ::
# (name -> value -> bool ) # (name -> value -> bool )
# (name -> value -> { name = any; value = any; }) # (name -> value -> { name = any; value = any; })
# attrs # attrs
mapFilterAttrs = seive: f: attrs: filterAttrs seive (mapAttrs' f attrs); mapFilterAttrs = seive: f: attrs: filterAttrs seive (mapAttrs' f attrs);
in
{
inherit mapFilterAttrs;
recImport = { dir, _import ? base: import "${dir}/${base}.nix" }: recImport = { dir, _import ? base: import "${dir}/${base}.nix" }:
mapFilterAttrs (_: v: v != null) mapFilterAttrs (_: v: v != null)

View File

@ -1,6 +1,9 @@
final: prev: { final: prev: {
grit = prev.grit.overrideAttrs (old: rec { grit = prev.grit.overrideAttrs (old:
version = "0.3.0"; let version = "0.3.0";
in
{
inherit version;
src = prev.fetchFromGitHub { src = prev.fetchFromGitHub {
owner = "climech"; owner = "climech";

View File

@ -1,5 +1,5 @@
final: prev: { final: prev: {
hikari = prev.hikari.overrideAttrs (old: rec { hikari = prev.hikari.overrideAttrs (old: {
src = prev.fetchzip { src = prev.fetchzip {
url = "https://hub.darcs.net/raichoo/hikari/dist/hikari.zip"; url = "https://hub.darcs.net/raichoo/hikari/dist/hikari.zip";
sha256 = "sha256-c7i/lekoS8FcsAHwXUw5IojC1xWS+sNeLVOzMf+dA5Q="; sha256 = "sha256-c7i/lekoS8FcsAHwXUw5IojC1xWS+sNeLVOzMf+dA5Q=";

View File

@ -1,6 +1,9 @@
final: prev: { final: prev: {
hydrus = prev.hydrus.overrideAttrs (old: rec { hydrus = prev.hydrus.overrideAttrs (old:
version = "435"; let version = "435";
in
{
inherit version;
src = prev.fetchFromGitHub { src = prev.fetchFromGitHub {
owner = "hydrusnetwork"; owner = "hydrusnetwork";

View File

@ -1,4 +1,4 @@
final: prev: rec { final: prev: {
kakoune-unwrapped = prev.kakoune-unwrapped.overrideAttrs (old: { kakoune-unwrapped = prev.kakoune-unwrapped.overrideAttrs (old: {
version = "5696ed02"; version = "5696ed02";
src = builtins.fetchGit { src = builtins.fetchGit {

View File

@ -43,14 +43,16 @@ let
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}
chromium --enable-features=UseOzonePlatform --ozone-platform=wayland chromium --enable-features=UseOzonePlatform --ozone-platform=wayland
''; '';
chromiumWaylandPkg = with pkgs; stdenv.mkDerivation { chromiumWaylandPkg = with pkgs;
name = "chromium-wayland"; let name = "chromium-wayland"; in
stdenv.mkDerivation {
pname = name;
version = chromium.version; version = chromium.version;
nativeBuildInputs = [ copyDesktopItems ]; nativeBuildInputs = [ copyDesktopItems ];
desktopItems = [ desktopItems = [
(makeDesktopItem rec { (makeDesktopItem {
name = "chromium-wayland"; inherit name;
exec = name; exec = name;
desktopName = "Chromium Wayland"; desktopName = "Chromium Wayland";
genericName = "Web Browser"; genericName = "Web Browser";
@ -99,17 +101,8 @@ let
}; };
}; };
colorSchemeDark = rec { colorSchemeDark =
primary = { let
normal = {
background = "181818";
foreground = "b9b9b9";
};
bright = {
background = bright.black;
foreground = bright.white;
};
};
normal = { normal = {
black = "252525"; black = "252525";
gray = "5b5b5b"; gray = "5b5b5b";
@ -132,6 +125,20 @@ let
cyan = "56d8c9"; cyan = "56d8c9";
white = "dedede"; white = "dedede";
}; };
in
{
inherit normal bright;
primary = {
normal = {
background = "181818";
foreground = "b9b9b9";
};
bright = {
background = bright.black;
foreground = bright.white;
};
};
}; };
colorScheme = colorScheme =
@ -181,11 +188,24 @@ let
indicator = "#111111"; # don't care indicator = "#111111"; # don't care
}; };
fonts = [ fontComb ]; fonts = [ fontComb ];
extraEnv = ''
export SDL_VIDEODRIVER=wayland
# needs qt5.qtwayland in systemPackages
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORMTHEME=qt5ct
export QT_PLATFORM_PLUGIN=qt5ct
'';
in in
{ {
home-manager.users.patriot = { config, pkgs, ... }: { home-manager.users.patriot = { config, pkgs, ... }: {
imports = [ ../profiles/hikari.nix ]; imports = [ ../profiles/hikari.nix ];
# needs to be fixed to use nix profile???
/*gtk = { /*gtk = {
enable = false; enable = false;
font = { font = {
@ -215,8 +235,6 @@ in
homeDirectory = nixosConfig.users.users.patriot.home; homeDirectory = nixosConfig.users.users.patriot.home;
packages = with pkgs; packages = with pkgs;
[ [
discord
ripcord
# Font stuff # Font stuff
fontPackage fontPackage
noto-fonts-cjk noto-fonts-cjk
@ -224,6 +242,8 @@ in
font-awesome font-awesome
(nerdfonts.override { fonts = [ "Iosevka" ]; }) (nerdfonts.override { fonts = [ "Iosevka" ]; })
# Programs # Programs
discord
ripcord
audacity audacity
krita krita
kdenlive kdenlive
@ -265,17 +285,7 @@ in
}; };
sway = { sway = {
enable = true; enable = true;
extraSessionCommands = '' extraSessionCommands = extraEnv;
#export SDL_VIDEODRIVER=wayland
# needs qt5.qtwayland in systemPackages
#export QT_QPA_PLATFORM=wayland
#export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORMTHEME=qt5ct
export QT_PLATFORM_PLUGIN=qt5ct
'';
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
config = { config = {
inherit fonts; inherit fonts;
@ -477,8 +487,10 @@ in
enableCompletion = true; enableCompletion = true;
plugins = plugins =
let let
fast-syntax-highlighting = rec { fast-syntax-highlighting =
name = "fast-syntax-highlighting"; let name = "fast-syntax-highlighting"; in
{
inherit name;
src = pkgs."zsh-${name}".out; src = pkgs."zsh-${name}".out;
}; };
per-directory-history = { per-directory-history = {
@ -495,17 +507,7 @@ in
# xdg compliant # xdg compliant
dotDir = ".config/zsh"; dotDir = ".config/zsh";
history.path = ".local/share/zsh/history"; history.path = ".local/share/zsh/history";
envExtra = '' envExtra = extraEnv;
#export SDL_VIDEODRIVER=wayland
# needs qt5.qtwayland in systemPackages
#export QT_QPA_PLATFORM=wayland
#export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORMTHEME=qt5ct
export QT_PLATFORM_PLUGIN=qt5ct
'';
loginExtra = loginExtra =
'' ''
if [ "$(${pkgs.coreutils}/bin/tty)" = "/dev/tty1" ]; then if [ "$(${pkgs.coreutils}/bin/tty)" = "/dev/tty1" ]; then
@ -516,7 +518,7 @@ in
export TERM=alacritty export TERM=alacritty
function tomp4 () { function tomp4 () {
${pkgs.ffmpeg}/bin/ffmpeg -i $1 -c:v libx264 -preset slow -crf 30 -c:a aac -b:a 128k $2 ${pkgs.ffmpeg}/bin/ffmpeg -i $1 -c:v libx264 -preset slow -crf 30 -c:a aac -b:a 128k "$1.mp4"
} }
bindkey "$terminfo[kRIT5]" forward-word bindkey "$terminfo[kRIT5]" forward-word
@ -727,7 +729,7 @@ in
''; '';
}; };
vscode = { vscode = {
enable = true; enable = false;
package = pkgs.vscodium; package = pkgs.vscodium;
extensions = extensions =
let let
@ -773,13 +775,18 @@ in
}; };
services = { services = {
gpg-agent = rec { gpg-agent =
let
defaultCacheTtl = 3600 * 6;
maxCacheTtl = 3600 * 24;
in
{
inherit defaultCacheTtl maxCacheTtl;
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
sshKeys = [ "8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965" ]; sshKeys = [ "8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965" ];
defaultCacheTtl = 3600 * 6;
defaultCacheTtlSsh = defaultCacheTtl; defaultCacheTtlSsh = defaultCacheTtl;
maxCacheTtl = 3600 * 24;
maxCacheTtlSsh = maxCacheTtl; maxCacheTtlSsh = maxCacheTtl;
grabKeyboardAndMouse = false; grabKeyboardAndMouse = false;
pinentryFlavor = "qt"; pinentryFlavor = "qt";
@ -789,13 +796,6 @@ in
xdg = { xdg = {
enable = true; enable = true;
configFile = { configFile = {
# "oguri/config".text = ''
# [output *]
# image=/home/patriot/wallpaper.gif
# filter=nearest
# scaling-mode=fill
# anchor=center
# '';
"kak/user/kakrc".text = '' "kak/user/kakrc".text = ''
source "%val{config}/user/color/colorscheme.kak" source "%val{config}/user/color/colorscheme.kak"
''; '';