219 lines
6 KiB
Nix
219 lines
6 KiB
Nix
{ pkgs, lib, config, ... }:
|
||
with lib;
|
||
let
|
||
xmodmapConfig = pkgs.writeText "xmodmap" ''
|
||
!
|
||
! Swap Caps_Lock and Control_L
|
||
!
|
||
|
||
! replace capslock keys with Escape Keys
|
||
! remove Lock = Caps_Lock
|
||
clear Lock
|
||
add Lock = Scroll_Lock
|
||
|
||
keysym Caps_Lock = Escape
|
||
|
||
! Set Right function Key to Windows-key
|
||
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
|
||
|
||
! Map umlauts to RIGHT ALT + <key>
|
||
keycode 108 = Mode_switch
|
||
keysym e = e E EuroSign
|
||
keysym c = c C cent
|
||
keysym a = a A adiaeresis Adiaeresis
|
||
keysym o = o O odiaeresis Odiaeresis
|
||
keysym u = u U udiaeresis Udiaeresis
|
||
keysym s = s S ssharp
|
||
'';
|
||
in {
|
||
|
||
imports = [
|
||
./home-manager/spacemacs.nix
|
||
./home-manager/spacevim.nix
|
||
./home-manager/ssh.nix
|
||
./home-manager/xmonad.nix
|
||
];
|
||
|
||
home-manager.users.mainUser = {
|
||
|
||
home.file.".config/bugwarrior/bugwarriorrc".text = lib.generators.toINI{} {
|
||
general = {
|
||
# todo : make this a list of strings and generate a comma separated list (as one string)
|
||
target = "my-github";
|
||
};
|
||
my-github = {
|
||
service = "github";
|
||
# todo : make this a attrset
|
||
"github.login" = "mrVanDalo";
|
||
"github.token" = "@oracle:eval:${pkgs.pass}/bin/pass development/github/mrVanDalo/bugwarriorAccessToken";
|
||
"github.username" = "mrVanDalo";
|
||
|
||
# Instead of fetching issues and pull requests based on {{username}}’s owned repositories, you may instead get those that {{username}} is involved in. This includes all issues and pull requests where the user is the author, the assignee, mentioned in, or has commented on. To do so, add the following configuration option:
|
||
"github.involved_issues" = "True";
|
||
|
||
# By default, issues from all repos belonging to github.username are included. To turn this off, set:
|
||
# "github.include_user_repos" = False
|
||
|
||
# noisy_repository is the repository you would not like issues created for:
|
||
#"github.exclude_repos" = noisy_repository
|
||
};
|
||
};
|
||
|
||
home.file.".zshrc".text = ''
|
||
# a fix for https://github.com/NixOS/nixpkgs/issues/27587
|
||
autoload -U compinit && compinit
|
||
'';
|
||
|
||
programs.git = {
|
||
enable = true;
|
||
userName = "Ingolf Wagner";
|
||
userEmail = "contact@ingolf-wagner.de";
|
||
signing = {
|
||
key = "42AC51C9482D0834CF488AF1389EC2D64AC71EAC";
|
||
signByDefault = true;
|
||
};
|
||
};
|
||
|
||
programs.gpg = {
|
||
enable = true;
|
||
settings = {
|
||
auto-key-locate = "local";
|
||
keyid-format = "long";
|
||
utf8-strings = "";
|
||
verbose = "";
|
||
with-fingerprint = "";
|
||
keyserver = "hkp://pgp.mit.edu";
|
||
personal-digest-preferences = "SHA512";
|
||
cert-digest-algo = "SHA512";
|
||
default-preference-list =
|
||
"SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
|
||
};
|
||
};
|
||
|
||
programs.htop = {
|
||
enable = true;
|
||
highlightBaseName = true;
|
||
treeView = true;
|
||
};
|
||
|
||
xdg.configFile."albert/albert.conf".text = ''
|
||
[General]
|
||
hotkey=Meta+Space
|
||
showTray=false
|
||
telemetry=false
|
||
terminal=urxvt -e
|
||
|
||
[org.albert.extension.applications]
|
||
enabled=true
|
||
fuzzy=true
|
||
use_generic_name=true
|
||
use_keywords=true
|
||
|
||
[org.albert.extension.calculator]
|
||
enabled=true
|
||
|
||
[org.albert.extension.hashgenerator]
|
||
enabled=true
|
||
|
||
[org.albert.frontend.widgetboxmodel]
|
||
alwaysOnTop=true
|
||
clearOnHide=false
|
||
displayIcons=true
|
||
displayScrollbar=false
|
||
displayShadow=false
|
||
hideOnClose=false
|
||
hideOnFocusLoss=true
|
||
itemCount=5
|
||
showCentered=true
|
||
theme=SolarizedBrightViolet
|
||
'';
|
||
|
||
xdg.configFile."Code/User/settings.json".text = builtins.toJSON {
|
||
"keyboard.dispatch" = "keyCode";
|
||
"explorer.confirmDragAndDrop" = false;
|
||
"editor.tabSize" = 2;
|
||
"window.zoomLevel" = -1;
|
||
"git.enableSmartCommit" = true;
|
||
"files.autoSave" = "onFocusChange";
|
||
"terminal.integrated.setLocaleVariables" = true;
|
||
"terminal.external.linuxExec" = "xterm";
|
||
"explorer.confirmDelete" = false;
|
||
"todo-tree.tags" = [ "todo" "TODO" "fixme" "FIXME" ];
|
||
"workbench.colorTheme" = "Solarized Light";
|
||
};
|
||
|
||
xdg.configFile."mimeapps.list".text = ''
|
||
[Default Applications]
|
||
text/html=browser-select.desktop
|
||
x-scheme-handler/http=browser-select.desktop
|
||
x-scheme-handler/https=browser-select.desktop
|
||
x-scheme-handler/about=browser-select.desktop
|
||
x-scheme-handler/mailto=thunderbird.desktop;
|
||
x-scheme-handler/unknown=browser-select.desktop
|
||
image/png=sxiv.desktop
|
||
image/jpeg=sxiv.desktop
|
||
'';
|
||
|
||
home.file.".xprofile".text = ''
|
||
# load keyboard mappings
|
||
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
|
||
|
||
# to allow sudo commands to access X
|
||
# todo : only allow the browsers and rambox access
|
||
${pkgs.xorg.xhost}/bin/xhost +
|
||
|
||
# no shitty pcspkr crap
|
||
${pkgs.xorg.xset}/bin/xset -b
|
||
|
||
# no sleeping monitor
|
||
${pkgs.xorg.xset}/bin/xset -dpms
|
||
${pkgs.xorg.xset}/bin/xset s off
|
||
|
||
${pkgs.flameshot}/bin/flameshot &
|
||
|
||
# cleanup xmonad
|
||
rm -f ~/.xmonad/xmonad.state
|
||
'';
|
||
|
||
};
|
||
|
||
environment.systemPackages = let
|
||
library = import <library> { inherit pkgs lib; };
|
||
|
||
fixKeyboard = pkgs.writeScriptBin "fix-Keyboard" # sh
|
||
''
|
||
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
|
||
'';
|
||
|
||
fixXhost = pkgs.writeScriptBin "fix-xhost" # sh
|
||
''
|
||
${pkgs.xorg.xhost}/bin/xhost + &> /dev/null
|
||
'';
|
||
|
||
fixX = pkgs.writeScriptBin "fix-X" # sh
|
||
''
|
||
|
||
${fixKeyboard}/bin/fix-Keyboard
|
||
|
||
for file in `ls ~/.screenlayout`
|
||
do
|
||
echo $file
|
||
~/.screenlayout/$file &> /dev/null
|
||
RETURN_CODE=$?
|
||
|
||
if [[ $RETURN_CODE -eq 0 ]]
|
||
then
|
||
exit 0;
|
||
fi
|
||
|
||
done
|
||
'';
|
||
in [
|
||
fixX
|
||
fixXhost
|
||
(library.desktopFile fixX { longName = "fix X"; })
|
||
fixKeyboard
|
||
(library.desktopFile fixKeyboard { longName = "fix keyboard"; })
|
||
];
|
||
|
||
}
|