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,12 +1,15 @@
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";
repo = old.pname; repo = old.pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-c8wBwmXFjpst6UxL5zmTxMR4bhzpHYljQHiJFKiNDms="; sha256 = "sha256-c8wBwmXFjpst6UxL5zmTxMR4bhzpHYljQHiJFKiNDms=";
}; };
}); });
} }

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,19 +1,22 @@
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";
repo = old.pname; repo = old.pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-+YOFqRgyNtdVBBCb6MWb+PqUoGvt8M0/ygiHrvxdWWg="; sha256 = "sha256-+YOFqRgyNtdVBBCb6MWb+PqUoGvt8M0/ygiHrvxdWWg=";
}; };
postPatch = '' postPatch = ''
sed 's;os\.path\.join(\sHC\.BIN_DIR,.*;"${prev.miniupnpc_2}/bin/upnpc";' \ sed 's;os\.path\.join(\sHC\.BIN_DIR,.*;"${prev.miniupnpc_2}/bin/upnpc";' \
-i ./hydrus/core/networking/HydrusNATPunch.py -i ./hydrus/core/networking/HydrusNATPunch.py
sed 's;os\.path\.join(\sHC\.BIN_DIR,.*;"${prev.swftools}/bin/swfrender";' \ sed 's;os\.path\.join(\sHC\.BIN_DIR,.*;"${prev.swftools}/bin/swfrender";' \
-i ./hydrus/core/HydrusFlashHandling.py -i ./hydrus/core/HydrusFlashHandling.py
''; '';
}); });
} }

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,26 +43,28 @@ 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
version = chromium.version; stdenv.mkDerivation {
pname = name;
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";
}) })
]; ];
phases = [ "installPhase" ]; phases = [ "installPhase" ];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
ln -s ${chromiumWayland}/bin/chromium-wayland $out/bin/chromium-wayland ln -s ${chromiumWayland}/bin/chromium-wayland $out/bin/chromium-wayland
''; '';
}; };
colorSchemeLight = { colorSchemeLight = {
primary = { primary = {
@ -99,40 +101,45 @@ let
}; };
}; };
colorSchemeDark = rec { colorSchemeDark =
primary = { let
normal = { normal = {
background = "181818"; black = "252525";
foreground = "b9b9b9"; gray = "5b5b5b";
red = "ed4a46";
green = "70b433";
yellow = "dbb32d";
blue = "368aeb";
magenta = "eb6eb7";
cyan = "3fc5b7";
white = "777777";
}; };
bright = { bright = {
background = bright.black; black = "3b3b3b";
foreground = bright.white; gray = "7b7b7b";
red = "ff5e56";
green = "83c746";
yellow = "efc541";
blue = "4f9cfe";
magenta = "ff81ca";
cyan = "56d8c9";
white = "dedede";
};
in
{
inherit normal bright;
primary = {
normal = {
background = "181818";
foreground = "b9b9b9";
};
bright = {
background = bright.black;
foreground = bright.white;
};
}; };
}; };
normal = {
black = "252525";
gray = "5b5b5b";
red = "ed4a46";
green = "70b433";
yellow = "dbb32d";
blue = "368aeb";
magenta = "eb6eb7";
cyan = "3fc5b7";
white = "777777";
};
bright = {
black = "3b3b3b";
gray = "7b7b7b";
red = "ff5e56";
green = "83c746";
yellow = "efc541";
blue = "4f9cfe";
magenta = "ff81ca";
cyan = "56d8c9";
white = "dedede";
};
};
colorScheme = colorScheme =
# if builtins.pathExists ./light then colorSchemeLight else colorSchemeDark; # if builtins.pathExists ./light then colorSchemeLight else colorSchemeDark;
@ -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,10 +487,12 @@ 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
src = pkgs."zsh-${name}".out; {
}; inherit name;
src = pkgs."zsh-${name}".out;
};
per-directory-history = { per-directory-history = {
name = "per-directory-history"; name = "per-directory-history";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
@ -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,29 +775,27 @@ in
}; };
services = { services = {
gpg-agent = rec { gpg-agent =
enable = true; let
enableSshSupport = true; defaultCacheTtl = 3600 * 6;
sshKeys = [ "8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965" ]; maxCacheTtl = 3600 * 24;
defaultCacheTtl = 3600 * 6; in
defaultCacheTtlSsh = defaultCacheTtl; {
maxCacheTtl = 3600 * 24; inherit defaultCacheTtl maxCacheTtl;
maxCacheTtlSsh = maxCacheTtl;
grabKeyboardAndMouse = false; enable = true;
pinentryFlavor = "qt"; enableSshSupport = true;
}; sshKeys = [ "8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965" ];
defaultCacheTtlSsh = defaultCacheTtl;
maxCacheTtlSsh = maxCacheTtl;
grabKeyboardAndMouse = false;
pinentryFlavor = "qt";
};
}; };
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"
''; '';