wew lad
This commit is contained in:
commit
d78da97be7
95
common.nix
Normal file
95
common.nix
Normal file
@ -0,0 +1,95 @@
|
||||
{ config, pkgs, lib, options, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./modules
|
||||
];
|
||||
|
||||
config = {
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
services.earlyoom.enable = true;
|
||||
|
||||
# based mosh
|
||||
programs.mosh.enable = true;
|
||||
|
||||
systemd.services.nix-daemon.serviceConfig.IOSchedulingClass = 3;
|
||||
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nixUnstable;
|
||||
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "20:00";
|
||||
options = "--delete-older-than 40d";
|
||||
};
|
||||
|
||||
daemonIONiceLevel = 7;
|
||||
daemonNiceLevel = 19;
|
||||
trustedUsers = [ "root" "builder" "@wheel" ];
|
||||
|
||||
extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
experimental-features = nix-command flakes
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
};
|
||||
|
||||
# make nginx have good logging and defaults
|
||||
services.nginx = {
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
appendHttpConfig = ''
|
||||
error_log stderr;
|
||||
access_log syslog:server=unix:/dev/log combined;
|
||||
'';
|
||||
};
|
||||
|
||||
# allow reverse ssh port shit to be public sometimes
|
||||
services.openssh.gatewayPorts = "clientspecified";
|
||||
|
||||
# no homo
|
||||
nixpkgs.config.oraclejdk.accept_license = true;
|
||||
|
||||
# set some basic system props
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
networking.networkmanager.enable = lib.mkDefault true;
|
||||
networking.nameservers = [ "1.1.1.1" "1.0.0.1" ];
|
||||
time.timeZone = lib.mkDefault "America/Phoenix";
|
||||
|
||||
# package list
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
vim
|
||||
nano
|
||||
curl
|
||||
httpie
|
||||
git
|
||||
unzip
|
||||
htop
|
||||
(python37Full.withPackages (ps: with ps; [ pip setuptools ]))
|
||||
neofetch
|
||||
ripgrep
|
||||
lsd
|
||||
lm_sensors
|
||||
rsync
|
||||
bind
|
||||
];
|
||||
|
||||
# Allow ssh
|
||||
services.openssh.enable = true;
|
||||
services.openssh.passwordAuthentication = false;
|
||||
|
||||
# Use a firewall
|
||||
networking.firewall.enable = lib.mkDefault true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 443 80 ];
|
||||
|
||||
programs.fish.enable = true;
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
|
||||
system.stateVersion = lib.mkDefault (builtins.abort "pls specify system.stateVersion (to 19.03)");
|
||||
};
|
||||
}
|
25
flake.lock
generated
Normal file
25
flake.lock
generated
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1604629176,
|
||||
"narHash": "sha256-ogLk0dOqWJ7FmyigD9ls8qrUD5VZ7BJqrPwC/YoBLkc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
31
flake.nix
Normal file
31
flake.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
outputs = { self, nixpkgs }: {
|
||||
nixosModules = {
|
||||
ezpassthru = import ./modules/ezpassthru.nix;
|
||||
ezpc = import ./modules/ezpc.nix;
|
||||
ezvahi = import ./modules/ezvahi.nix;
|
||||
ezwg = import ./modules/ezwg.nix;
|
||||
kiosk = import ./modules/kiosk.nix;
|
||||
fuckingprint = import ./modules/fuckingprint.nix;
|
||||
workstation = import ./modules/workstation.nix;
|
||||
all = import ./modules/default.nix;
|
||||
};
|
||||
|
||||
homeManagerModules = {
|
||||
ezpcusr = import ./home-manager/modules/ezpcusr.nix;
|
||||
all = import ./home-manager/modules/default.nix;
|
||||
};
|
||||
|
||||
# Not really modules? but eh
|
||||
nixosModules.common = import ./common.nix;
|
||||
nixosModules.common-notgne2 = import ./users/notgne2.nix;
|
||||
nixosModules.common-glooder = import ./users/glooder.nix;
|
||||
nixosModules.common-chekkie = import ./users/chekkie.nix;
|
||||
|
||||
homeManagerModules.common = import ./home-manager/common.nix;
|
||||
homeManagerModules.common-notgne2 = import ./home-manager/users/notgne2.nix;
|
||||
homeManagerModules.common-notgne2_pc = import ./home-manager/users/notgne2_pc.nix;
|
||||
homeManagerModules.common-glooder = import ./home-manager/users/glooder.nix;
|
||||
homeManagerModules.common-chekkie = import ./home-manager/users/chekkie.nix;
|
||||
};
|
||||
}
|
48
goodhm.nix
Normal file
48
goodhm.nix
Normal file
@ -0,0 +1,48 @@
|
||||
hm:
|
||||
|
||||
{ configuration
|
||||
, pkgs
|
||||
, inputs ? { }
|
||||
}:
|
||||
|
||||
with pkgs.lib;
|
||||
let
|
||||
collectFailed = cfg:
|
||||
map (x: x.message) (filter (x: !x.assertion) cfg.assertions);
|
||||
|
||||
showWarnings = res:
|
||||
let
|
||||
f = w: x: builtins.trace "[1;31mwarning: ${w}[0m" x;
|
||||
in
|
||||
fold f res res.config.warnings;
|
||||
|
||||
extendedLib = import "${hm}/modules/lib/stdlib-extended.nix" pkgs.lib;
|
||||
|
||||
hmModules =
|
||||
import "${hm}/modules/modules.nix" {
|
||||
inherit pkgs;
|
||||
check = true;
|
||||
useNixpkgsModule = false;
|
||||
lib = extendedLib;
|
||||
};
|
||||
|
||||
rawModule = extendedLib.evalModules {
|
||||
modules = [ configuration ] ++ hmModules;
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
modulesPath = "${hm}/modules";
|
||||
};
|
||||
};
|
||||
|
||||
module = showWarnings (
|
||||
let
|
||||
failed = collectFailed rawModule.config;
|
||||
failedStr = concatStringsSep "\n" (map (x: "- ${x}") failed);
|
||||
in
|
||||
if failed == [ ]
|
||||
then rawModule
|
||||
else throw "\nFailed assertions:\n${failedStr}"
|
||||
);
|
||||
|
||||
in
|
||||
module.config.home.activationPackage
|
74
home-manager/common.nix
Normal file
74
home-manager/common.nix
Normal file
@ -0,0 +1,74 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./modules ];
|
||||
|
||||
programs.vim = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
set nocompatible
|
||||
set nocp
|
||||
set backspace=indent,eol,start
|
||||
'';
|
||||
};
|
||||
|
||||
home.sessionVariables = { TERM = "xterm-256color"; };
|
||||
|
||||
programs.bat.enable = true;
|
||||
|
||||
programs.fish =
|
||||
let
|
||||
bobthefish = builtins.fetchGit {
|
||||
url = "https://github.com/oh-my-fish/theme-bobthefish.git";
|
||||
rev = "a2ad38aa051aaed25ae3bd6129986e7f27d42d7b";
|
||||
};
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
shellAliases = {
|
||||
cat = "bat";
|
||||
};
|
||||
plugins = [
|
||||
{
|
||||
name = "done";
|
||||
src = builtins.fetchGit {
|
||||
url = "https://github.com/franciscolourenco/done.git";
|
||||
rev = "9351f5a9f4ae6c73dd6f18e41364e63a77be5d90";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "bobthefish";
|
||||
src = bobthefish;
|
||||
}
|
||||
];
|
||||
interactiveShellInit = ''
|
||||
set TERM xterm-256color
|
||||
|
||||
# Load nix shit on non-NixOS computers (yea yea laugh it up we all have legacy machines somewhere)
|
||||
if not set -q NIX_PATH
|
||||
fenv source $HOME/.nix-profile/etc/profile.d/nix.sh
|
||||
end
|
||||
|
||||
set -U __done_min_cmd_duration 2000
|
||||
set -U __done_notification_command '${pkgs.espeak}/bin/espeak yyyyyi'
|
||||
|
||||
source ${bobthefish}/fish_prompt.fish
|
||||
|
||||
set -Ua fish_user_paths ~/.bin
|
||||
set -Ua fish_user_paths ~/.local/bin
|
||||
set -Ua fish_user_paths ~/.npm-global/bin
|
||||
set -Ua fish_user_paths ~/.cargo/bin
|
||||
|
||||
set -U fish_key_bindings fish_default_key_bindings
|
||||
set -g theme_nerd_fonts yes
|
||||
|
||||
function fish_greeting
|
||||
begin ${pkgs.figlet}/bin/figlet -f mini heh; echo ""; uptime; uname -a; end | ${pkgs.lolcat}/bin/lolcat
|
||||
end
|
||||
|
||||
eval (${pkgs.direnv}/bin/direnv hook fish)
|
||||
|
||||
${pkgs.thefuck}/bin/thefuck --alias | source
|
||||
'';
|
||||
};
|
||||
}
|
1134
home-manager/data/codium-base16.nix
Normal file
1134
home-manager/data/codium-base16.nix
Normal file
File diff suppressed because it is too large
Load Diff
1570
home-manager/data/emojis.txt
Normal file
1570
home-manager/data/emojis.txt
Normal file
File diff suppressed because it is too large
Load Diff
23
home-manager/data/gtk2-base16.nix
Normal file
23
home-manager/data/gtk2-base16.nix
Normal file
@ -0,0 +1,23 @@
|
||||
name: base16:
|
||||
|
||||
''
|
||||
gtk-color-scheme = "bg_color:#${base16."base00"}\nfg_color:#${
|
||||
base16."base05"
|
||||
}\nbase_color:#${base16."base00"}\ntext_color:#${
|
||||
base16."base05"
|
||||
}\nselected_bg_color:#${base16."base02"}\nselected_fg_color:#${
|
||||
base16."base05"
|
||||
}\ntooltip_bg_color:#${base16."base00"}\ntooltip_fg_color:#${
|
||||
base16."base04"
|
||||
}\ntitlebar_bg_color:#${base16."base00"}\ntitlebar_fg_color:#${
|
||||
base16."base0D"
|
||||
}\nmenubar_bg_color:#${base16."base00"}\nmenubar_fg_color:#${
|
||||
base16."base0D"
|
||||
}\ntoolbar_bg_color:#${base16."base00"}\ntoolbar_fg_color:#${
|
||||
base16."base0A"
|
||||
}\nmenu_bg_color:#${base16."base00"}\nmenu_fg_color:#${
|
||||
base16."base05"
|
||||
}\npanel_bg_color:#${base16."base00"}\npanel_fg_color:#${
|
||||
base16."base0B"
|
||||
}\nlink_color:#${base16."base09"}"
|
||||
''
|
38
home-manager/data/kitty-base16.nix
Normal file
38
home-manager/data/kitty-base16.nix
Normal file
@ -0,0 +1,38 @@
|
||||
name: base16:
|
||||
|
||||
''
|
||||
# Base16 ${name} - kitty color config
|
||||
# Scheme generated by ezpcusr in Nix
|
||||
background #${base16."base00"}
|
||||
foreground #${base16."base05"}
|
||||
selection_background #${base16."base05"}
|
||||
selection_foreground #${base16."base00"}
|
||||
url_color #${base16."base04"}
|
||||
cursor #${base16."base05"}
|
||||
active_border_color #${base16."base03"}
|
||||
inactive_border_color #${base16."base01"}
|
||||
active_tab_background #${base16."base00"}
|
||||
active_tab_foreground #${base16."base05"}
|
||||
inactive_tab_background #${base16."base01"}
|
||||
inactive_tab_foreground #${base16."base04"}
|
||||
|
||||
# normal
|
||||
color0 #${base16."base00"}
|
||||
color1 #${base16."base08"}
|
||||
color2 #${base16."base0B"}
|
||||
color3 #${base16."base0A"}
|
||||
color4 #${base16."base0D"}
|
||||
color5 #${base16."base0E"}
|
||||
color6 #${base16."base0C"}
|
||||
color7 #${base16."base05"}
|
||||
|
||||
# bright
|
||||
color8 #${base16."base03"}
|
||||
color9 #${base16."base09"}
|
||||
color10 #${base16."base01"}
|
||||
color11 #${base16."base02"}
|
||||
color12 #${base16."base04"}
|
||||
color13 #${base16."base06"}
|
||||
color14 #${base16."base0F"}
|
||||
color15 #${base16."base05"}
|
||||
''
|
BIN
home-manager/data/nixos_circlejerk.png
Normal file
BIN
home-manager/data/nixos_circlejerk.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
150
home-manager/data/rofi-base16.nix
Normal file
150
home-manager/data/rofi-base16.nix
Normal file
@ -0,0 +1,150 @@
|
||||
name: base16:
|
||||
|
||||
''
|
||||
/**
|
||||
* Base16 {{scheme-name}} ROFI Color theme
|
||||
*
|
||||
* Authors
|
||||
* Scheme: {{scheme-author}}
|
||||
* Template: Jordi Pakey-Rodriguez (https://github.com/0xdec), Andrea Scarpino (https://github.com/ilpianista)
|
||||
*/
|
||||
|
||||
* {
|
||||
red: #${base16."base08"};
|
||||
blue: #${base16."base0D"};
|
||||
lightfg: #${base16."base06"};
|
||||
lightbg: #${base16."base01"};
|
||||
foreground: #${base16."base05"};
|
||||
background: #${base16."base00"};
|
||||
background-color: #${base16."base00"};
|
||||
separatorcolor: @foreground;
|
||||
border-color: @foreground;
|
||||
selected-normal-foreground: @lightbg;
|
||||
selected-normal-background: @lightfg;
|
||||
selected-active-foreground: @background;
|
||||
selected-active-background: @blue;
|
||||
selected-urgent-foreground: @background;
|
||||
selected-urgent-background: @red;
|
||||
normal-foreground: @foreground;
|
||||
normal-background: @background;
|
||||
active-foreground: @blue;
|
||||
active-background: @background;
|
||||
urgent-foreground: @red;
|
||||
urgent-background: @background;
|
||||
alternate-normal-foreground: @foreground;
|
||||
alternate-normal-background: @lightbg;
|
||||
alternate-active-foreground: @blue;
|
||||
alternate-active-background: @lightbg;
|
||||
alternate-urgent-foreground: @red;
|
||||
alternate-urgent-background: @lightbg;
|
||||
spacing: 2;
|
||||
}
|
||||
window {
|
||||
background-color: @background;
|
||||
border: 1;
|
||||
padding: 5;
|
||||
}
|
||||
mainbox {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
message {
|
||||
border: 1px dash 0px 0px ;
|
||||
border-color: @separatorcolor;
|
||||
padding: 1px ;
|
||||
}
|
||||
textbox {
|
||||
text-color: @foreground;
|
||||
}
|
||||
listview {
|
||||
fixed-height: 0;
|
||||
border: 2px dash 0px 0px ;
|
||||
border-color: @separatorcolor;
|
||||
spacing: 2px ;
|
||||
scrollbar: true;
|
||||
padding: 2px 0px 0px ;
|
||||
}
|
||||
element {
|
||||
border: 0;
|
||||
padding: 1px ;
|
||||
}
|
||||
element normal.normal {
|
||||
background-color: @normal-background;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
element normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
element normal.active {
|
||||
background-color: @active-background;
|
||||
text-color: @active-foreground;
|
||||
}
|
||||
element selected.normal {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
element selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
text-color: @selected-urgent-foreground;
|
||||
}
|
||||
element selected.active {
|
||||
background-color: @selected-active-background;
|
||||
text-color: @selected-active-foreground;
|
||||
}
|
||||
element alternate.normal {
|
||||
background-color: @alternate-normal-background;
|
||||
text-color: @alternate-normal-foreground;
|
||||
}
|
||||
element alternate.urgent {
|
||||
background-color: @alternate-urgent-background;
|
||||
text-color: @alternate-urgent-foreground;
|
||||
}
|
||||
element alternate.active {
|
||||
background-color: @alternate-active-background;
|
||||
text-color: @alternate-active-foreground;
|
||||
}
|
||||
scrollbar {
|
||||
width: 4px ;
|
||||
border: 0;
|
||||
handle-color: @normal-foreground;
|
||||
handle-width: 8px ;
|
||||
padding: 0;
|
||||
}
|
||||
sidebar {
|
||||
border: 2px dash 0px 0px ;
|
||||
border-color: @separatorcolor;
|
||||
}
|
||||
button {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
button selected {
|
||||
background-color: @selected-normal-background;
|
||||
text-color: @selected-normal-foreground;
|
||||
}
|
||||
inputbar {
|
||||
spacing: 0px;
|
||||
text-color: @normal-foreground;
|
||||
padding: 1px ;
|
||||
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
|
||||
}
|
||||
case-indicator {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
entry {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
prompt {
|
||||
spacing: 0;
|
||||
text-color: @normal-foreground;
|
||||
}
|
||||
textbox-prompt-colon {
|
||||
expand: false;
|
||||
str: ":";
|
||||
margin: 0px 0.3000em 0.0000em 0.0000em ;
|
||||
text-color: inherit;
|
||||
}
|
||||
''
|
401
home-manager/data/vim-base16.nix
Normal file
401
home-manager/data/vim-base16.nix
Normal file
@ -0,0 +1,401 @@
|
||||
name: base16:
|
||||
|
||||
''
|
||||
" GUI color definitions
|
||||
let s:gui00 = "${base16.base00}"
|
||||
let g:base16_gui00 = "${base16.base00}"
|
||||
let s:gui01 = "${base16.base01}"
|
||||
let g:base16_gui01 = "${base16.base01}"
|
||||
let s:gui02 = "${base16.base02}"
|
||||
let g:base16_gui02 = "${base16.base02}"
|
||||
let s:gui03 = "${base16.base03}"
|
||||
let g:base16_gui03 = "${base16.base03}"
|
||||
let s:gui04 = "${base16.base04}"
|
||||
let g:base16_gui04 = "${base16.base04}"
|
||||
let s:gui05 = "${base16.base05}"
|
||||
let g:base16_gui05 = "${base16.base05}"
|
||||
let s:gui06 = "${base16.base06}"
|
||||
let g:base16_gui06 = "${base16.base06}"
|
||||
let s:gui07 = "${base16.base07}"
|
||||
let g:base16_gui07 = "${base16.base07}"
|
||||
let s:gui08 = "${base16.base08}"
|
||||
let g:base16_gui08 = "${base16.base08}"
|
||||
let s:gui09 = "${base16.base09}"
|
||||
let g:base16_gui09 = "${base16.base09}"
|
||||
let s:gui0A = "${base16.base0A}"
|
||||
let g:base16_gui0A = "${base16.base0A}"
|
||||
let s:gui0B = "${base16.base0B}"
|
||||
let g:base16_gui0B = "${base16.base0B}"
|
||||
let s:gui0C = "${base16.base0C}"
|
||||
let g:base16_gui0C = "${base16.base0C}"
|
||||
let s:gui0D = "${base16.base0D}"
|
||||
let g:base16_gui0D = "${base16.base0D}"
|
||||
let s:gui0E = "${base16.base0E}"
|
||||
let g:base16_gui0E = "${base16.base0E}"
|
||||
let s:gui0F = "${base16.base0F}"
|
||||
let g:base16_gui0F = "${base16.base0F}"
|
||||
|
||||
" Terminal color definitions
|
||||
let s:cterm00 = "00"
|
||||
let g:base16_cterm00 = "00"
|
||||
let s:cterm03 = "08"
|
||||
let g:base16_cterm03 = "08"
|
||||
let s:cterm05 = "07"
|
||||
let g:base16_cterm05 = "07"
|
||||
let s:cterm07 = "15"
|
||||
let g:base16_cterm07 = "15"
|
||||
let s:cterm08 = "01"
|
||||
let g:base16_cterm08 = "01"
|
||||
let s:cterm0A = "03"
|
||||
let g:base16_cterm0A = "03"
|
||||
let s:cterm0B = "02"
|
||||
let g:base16_cterm0B = "02"
|
||||
let s:cterm0C = "06"
|
||||
let g:base16_cterm0C = "06"
|
||||
let s:cterm0D = "04"
|
||||
let g:base16_cterm0D = "04"
|
||||
let s:cterm0E = "05"
|
||||
let g:base16_cterm0E = "05"
|
||||
if exists("base16colorspace") && base16colorspace == "256"
|
||||
let s:cterm01 = "18"
|
||||
let g:base16_cterm01 = "18"
|
||||
let s:cterm02 = "19"
|
||||
let g:base16_cterm02 = "19"
|
||||
let s:cterm04 = "20"
|
||||
let g:base16_cterm04 = "20"
|
||||
let s:cterm06 = "21"
|
||||
let g:base16_cterm06 = "21"
|
||||
let s:cterm09 = "16"
|
||||
let g:base16_cterm09 = "16"
|
||||
let s:cterm0F = "17"
|
||||
let g:base16_cterm0F = "17"
|
||||
else
|
||||
let s:cterm01 = "10"
|
||||
let g:base16_cterm01 = "10"
|
||||
let s:cterm02 = "11"
|
||||
let g:base16_cterm02 = "11"
|
||||
let s:cterm04 = "12"
|
||||
let g:base16_cterm04 = "12"
|
||||
let s:cterm06 = "13"
|
||||
let g:base16_cterm06 = "13"
|
||||
let s:cterm09 = "09"
|
||||
let g:base16_cterm09 = "09"
|
||||
let s:cterm0F = "14"
|
||||
let g:base16_cterm0F = "14"
|
||||
endif
|
||||
|
||||
" Neovim terminal colours
|
||||
if has("nvim")
|
||||
let g:terminal_color_0 = "#${base16.base00}"
|
||||
let g:terminal_color_1 = "#${base16.base08}"
|
||||
let g:terminal_color_2 = "#${base16.base0B}"
|
||||
let g:terminal_color_3 = "#${base16.base0A}"
|
||||
let g:terminal_color_4 = "#${base16.base0D}"
|
||||
let g:terminal_color_5 = "#${base16.base0E}"
|
||||
let g:terminal_color_6 = "#${base16.base0C}"
|
||||
let g:terminal_color_7 = "#${base16.base05}"
|
||||
let g:terminal_color_8 = "#${base16.base03}"
|
||||
let g:terminal_color_9 = "#${base16.base08}"
|
||||
let g:terminal_color_10 = "#${base16.base0B}"
|
||||
let g:terminal_color_11 = "#${base16.base0A}"
|
||||
let g:terminal_color_12 = "#${base16.base0D}"
|
||||
let g:terminal_color_13 = "#${base16.base0E}"
|
||||
let g:terminal_color_14 = "#${base16.base0C}"
|
||||
let g:terminal_color_15 = "#${base16.base07}"
|
||||
let g:terminal_color_background = g:terminal_color_0
|
||||
let g:terminal_color_foreground = g:terminal_color_5
|
||||
if &background == "light"
|
||||
let g:terminal_color_background = g:terminal_color_7
|
||||
let g:terminal_color_foreground = g:terminal_color_2
|
||||
endif
|
||||
elseif has("terminal")
|
||||
let g:terminal_ansi_colors = [
|
||||
\ "#${base16.base00}",
|
||||
\ "#${base16.base08}",
|
||||
\ "#${base16.base0B}",
|
||||
\ "#${base16.base0A}",
|
||||
\ "#${base16.base0D}",
|
||||
\ "#${base16.base0E}",
|
||||
\ "#${base16.base0C}",
|
||||
\ "#${base16.base05}",
|
||||
\ "#${base16.base03}",
|
||||
\ "#${base16.base08}",
|
||||
\ "#${base16.base0B}",
|
||||
\ "#${base16.base0A}",
|
||||
\ "#${base16.base0D}",
|
||||
\ "#${base16.base0E}",
|
||||
\ "#${base16.base0C}",
|
||||
\ "#${base16.base07}",
|
||||
\ ]
|
||||
endif
|
||||
|
||||
" Theme setup
|
||||
hi clear
|
||||
syntax reset
|
||||
let g:colors_name = "base16"
|
||||
|
||||
" Highlighting function
|
||||
" Optional variables are attributes and guisp
|
||||
function! g:Base16hi(group, guifg, guibg, ctermfg, ctermbg, ...)
|
||||
let l:attr = get(a:, 1, "")
|
||||
let l:guisp = get(a:, 2, "")
|
||||
|
||||
if a:guifg != ""
|
||||
exec "hi " . a:group . " guifg=#" . a:guifg
|
||||
endif
|
||||
if a:guibg != ""
|
||||
exec "hi " . a:group . " guibg=#" . a:guibg
|
||||
endif
|
||||
if a:ctermfg != ""
|
||||
exec "hi " . a:group . " ctermfg=" . a:ctermfg
|
||||
endif
|
||||
if a:ctermbg != ""
|
||||
exec "hi " . a:group . " ctermbg=" . a:ctermbg
|
||||
endif
|
||||
if l:attr != ""
|
||||
exec "hi " . a:group . " gui=" . l:attr . " cterm=" . l:attr
|
||||
endif
|
||||
if l:guisp != ""
|
||||
exec "hi " . a:group . " guisp=#" . l:guisp
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
fun <sid>hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
|
||||
call g:Base16hi(a:group, a:guifg, a:guibg, a:ctermfg, a:ctermbg, a:attr, a:guisp)
|
||||
endfun
|
||||
|
||||
" Vim editor colors
|
||||
call <sid>hi("Normal", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
|
||||
call <sid>hi("Bold", "", "", "", "", "bold", "")
|
||||
call <sid>hi("Debug", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("Directory", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("Error", s:gui00, s:gui08, s:cterm00, s:cterm08, "", "")
|
||||
call <sid>hi("ErrorMsg", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
|
||||
call <sid>hi("Exception", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("FoldColumn", s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "")
|
||||
call <sid>hi("Folded", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
|
||||
call <sid>hi("IncSearch", s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "")
|
||||
call <sid>hi("Italic", "", "", "", "", "none", "")
|
||||
call <sid>hi("Macro", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("MatchParen", "", s:gui03, "", s:cterm03, "", "")
|
||||
call <sid>hi("ModeMsg", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("MoreMsg", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("Question", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("Search", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "", "")
|
||||
call <sid>hi("Substitute", s:gui01, s:gui0A, s:cterm01, s:cterm0A, "none", "")
|
||||
call <sid>hi("SpecialKey", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("TooLong", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("Underlined", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("Visual", "", s:gui02, "", s:cterm02, "", "")
|
||||
call <sid>hi("VisualNOS", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("WarningMsg", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("WildMenu", s:gui08, s:gui0A, s:cterm08, "", "", "")
|
||||
call <sid>hi("Title", s:gui0D, "", s:cterm0D, "", "none", "")
|
||||
call <sid>hi("Conceal", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
|
||||
call <sid>hi("Cursor", s:gui00, s:gui05, s:cterm00, s:cterm05, "", "")
|
||||
call <sid>hi("NonText", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("LineNr", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
|
||||
call <sid>hi("SignColumn", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
|
||||
call <sid>hi("StatusLine", s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "")
|
||||
call <sid>hi("StatusLineNC", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
|
||||
call <sid>hi("VertSplit", s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "")
|
||||
call <sid>hi("ColorColumn", "", s:gui01, "", s:cterm01, "none", "")
|
||||
call <sid>hi("CursorColumn", "", s:gui01, "", s:cterm01, "none", "")
|
||||
call <sid>hi("CursorLine", "", s:gui01, "", s:cterm01, "none", "")
|
||||
call <sid>hi("CursorLineNr", s:gui04, s:gui01, s:cterm04, s:cterm01, "", "")
|
||||
call <sid>hi("QuickFixLine", "", s:gui01, "", s:cterm01, "none", "")
|
||||
call <sid>hi("PMenu", s:gui05, s:gui01, s:cterm05, s:cterm01, "none", "")
|
||||
call <sid>hi("PMenuSel", s:gui01, s:gui05, s:cterm01, s:cterm05, "", "")
|
||||
call <sid>hi("TabLine", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
|
||||
call <sid>hi("TabLineFill", s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
|
||||
call <sid>hi("TabLineSel", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "")
|
||||
|
||||
" Standard syntax highlighting
|
||||
call <sid>hi("Boolean", s:gui09, "", s:cterm09, "", "", "")
|
||||
call <sid>hi("Character", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("Comment", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("Conditional", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("Constant", s:gui09, "", s:cterm09, "", "", "")
|
||||
call <sid>hi("Define", s:gui0E, "", s:cterm0E, "", "none", "")
|
||||
call <sid>hi("Delimiter", s:gui0F, "", s:cterm0F, "", "", "")
|
||||
call <sid>hi("Float", s:gui09, "", s:cterm09, "", "", "")
|
||||
call <sid>hi("Function", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("Identifier", s:gui08, "", s:cterm08, "", "none", "")
|
||||
call <sid>hi("Include", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("Keyword", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("Label", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("Number", s:gui09, "", s:cterm09, "", "", "")
|
||||
call <sid>hi("Operator", s:gui05, "", s:cterm05, "", "none", "")
|
||||
call <sid>hi("PreProc", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("Repeat", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("Special", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
call <sid>hi("SpecialChar", s:gui0F, "", s:cterm0F, "", "", "")
|
||||
call <sid>hi("Statement", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("String", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("Structure", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("Tag", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("Todo", s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "")
|
||||
call <sid>hi("Type", s:gui0A, "", s:cterm0A, "", "none", "")
|
||||
call <sid>hi("Typedef", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
|
||||
" C highlighting
|
||||
call <sid>hi("cOperator", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
call <sid>hi("cPreCondit", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
|
||||
" C# highlighting
|
||||
call <sid>hi("csClass", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("csAttribute", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("csModifier", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("csType", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("csUnspecifiedStatement", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("csContextualStatement", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("csNewDecleration", s:gui08, "", s:cterm08, "", "", "")
|
||||
|
||||
" CSS highlighting
|
||||
call <sid>hi("cssBraces", s:gui05, "", s:cterm05, "", "", "")
|
||||
call <sid>hi("cssClassName", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("cssColor", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
|
||||
" Diff highlighting
|
||||
call <sid>hi("DiffAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
|
||||
call <sid>hi("DiffChange", s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
|
||||
call <sid>hi("DiffDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
|
||||
call <sid>hi("DiffText", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
|
||||
call <sid>hi("DiffAdded", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
|
||||
call <sid>hi("DiffFile", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
|
||||
call <sid>hi("DiffNewFile", s:gui0B, s:gui00, s:cterm0B, s:cterm00, "", "")
|
||||
call <sid>hi("DiffLine", s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
|
||||
call <sid>hi("DiffRemoved", s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
|
||||
|
||||
" Git highlighting
|
||||
call <sid>hi("gitcommitOverflow", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("gitcommitSummary", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("gitcommitComment", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("gitcommitUntracked", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("gitcommitDiscarded", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("gitcommitSelected", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("gitcommitHeader", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("gitcommitSelectedType", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("gitcommitUnmergedType", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("gitcommitDiscardedType", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("gitcommitBranch", s:gui09, "", s:cterm09, "", "bold", "")
|
||||
call <sid>hi("gitcommitUntrackedFile", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("gitcommitUnmergedFile", s:gui08, "", s:cterm08, "", "bold", "")
|
||||
call <sid>hi("gitcommitDiscardedFile", s:gui08, "", s:cterm08, "", "bold", "")
|
||||
call <sid>hi("gitcommitSelectedFile", s:gui0B, "", s:cterm0B, "", "bold", "")
|
||||
|
||||
" GitGutter highlighting
|
||||
call <sid>hi("GitGutterAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
|
||||
call <sid>hi("GitGutterChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
|
||||
call <sid>hi("GitGutterDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
|
||||
call <sid>hi("GitGutterChangeDelete", s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "")
|
||||
|
||||
" HTML highlighting
|
||||
call <sid>hi("htmlBold", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("htmlItalic", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("htmlEndTag", s:gui05, "", s:cterm05, "", "", "")
|
||||
call <sid>hi("htmlTag", s:gui05, "", s:cterm05, "", "", "")
|
||||
|
||||
" JavaScript highlighting
|
||||
call <sid>hi("javaScript", s:gui05, "", s:cterm05, "", "", "")
|
||||
call <sid>hi("javaScriptBraces", s:gui05, "", s:cterm05, "", "", "")
|
||||
call <sid>hi("javaScriptNumber", s:gui09, "", s:cterm09, "", "", "")
|
||||
" pangloss/vim-javascript highlighting
|
||||
call <sid>hi("jsOperator", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("jsStatement", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("jsReturn", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("jsThis", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("jsClassDefinition", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("jsFunction", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("jsFuncName", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("jsFuncCall", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("jsClassFuncName", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("jsClassMethodType", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("jsRegexpString", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
call <sid>hi("jsGlobalObjects", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("jsGlobalNodeObjects", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("jsExceptions", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("jsBuiltins", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
|
||||
" Mail highlighting
|
||||
call <sid>hi("mailQuoted1", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("mailQuoted2", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("mailQuoted3", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("mailQuoted4", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
call <sid>hi("mailQuoted5", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("mailQuoted6", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("mailURL", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("mailEmail", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
|
||||
" Markdown highlighting
|
||||
call <sid>hi("markdownCode", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("markdownError", s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
|
||||
call <sid>hi("markdownCodeBlock", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("markdownHeadingDelimiter", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
|
||||
" NERDTree highlighting
|
||||
call <sid>hi("NERDTreeDirSlash", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("NERDTreeExecFile", s:gui05, "", s:cterm05, "", "", "")
|
||||
|
||||
" PHP highlighting
|
||||
call <sid>hi("phpMemberSelector", s:gui05, "", s:cterm05, "", "", "")
|
||||
call <sid>hi("phpComparison", s:gui05, "", s:cterm05, "", "", "")
|
||||
call <sid>hi("phpParent", s:gui05, "", s:cterm05, "", "", "")
|
||||
call <sid>hi("phpMethodsVar", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
|
||||
" Python highlighting
|
||||
call <sid>hi("pythonOperator", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("pythonRepeat", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("pythonInclude", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("pythonStatement", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
|
||||
" Ruby highlighting
|
||||
call <sid>hi("rubyAttribute", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
call <sid>hi("rubyConstant", s:gui0A, "", s:cterm0A, "", "", "")
|
||||
call <sid>hi("rubyInterpolationDelimiter", s:gui0F, "", s:cterm0F, "", "", "")
|
||||
call <sid>hi("rubyRegexp", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
call <sid>hi("rubySymbol", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("rubyStringDelimiter", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
|
||||
" SASS highlighting
|
||||
call <sid>hi("sassidChar", s:gui08, "", s:cterm08, "", "", "")
|
||||
call <sid>hi("sassClassChar", s:gui09, "", s:cterm09, "", "", "")
|
||||
call <sid>hi("sassInclude", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("sassMixing", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("sassMixinName", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
|
||||
" Signify highlighting
|
||||
call <sid>hi("SignifySignAdd", s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
|
||||
call <sid>hi("SignifySignChange", s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
|
||||
call <sid>hi("SignifySignDelete", s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
|
||||
|
||||
" Spelling highlighting
|
||||
call <sid>hi("SpellBad", "", "", "", "", "undercurl", s:gui08)
|
||||
call <sid>hi("SpellLocal", "", "", "", "", "undercurl", s:gui0C)
|
||||
call <sid>hi("SpellCap", "", "", "", "", "undercurl", s:gui0D)
|
||||
call <sid>hi("SpellRare", "", "", "", "", "undercurl", s:gui0E)
|
||||
|
||||
" Startify highlighting
|
||||
call <sid>hi("StartifyBracket", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("StartifyFile", s:gui07, "", s:cterm07, "", "", "")
|
||||
call <sid>hi("StartifyFooter", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("StartifyHeader", s:gui0B, "", s:cterm0B, "", "", "")
|
||||
call <sid>hi("StartifyNumber", s:gui09, "", s:cterm09, "", "", "")
|
||||
call <sid>hi("StartifyPath", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("StartifySection", s:gui0E, "", s:cterm0E, "", "", "")
|
||||
call <sid>hi("StartifySelect", s:gui0C, "", s:cterm0C, "", "", "")
|
||||
call <sid>hi("StartifySlash", s:gui03, "", s:cterm03, "", "", "")
|
||||
call <sid>hi("StartifySpecial", s:gui03, "", s:cterm03, "", "", "")
|
||||
|
||||
" Java highlighting
|
||||
call <sid>hi("javaOperator", s:gui0D, "", s:cterm0D, "", "", "")
|
||||
|
||||
" Remove functions
|
||||
delf <sid>hi
|
||||
|
||||
" Remove color variables
|
||||
unlet s:gui00 s:gui01 s:gui02 s:gui03 s:gui04 s:gui05 s:gui06 s:gui07 s:gui08 s:gui09 s:gui0A s:gui0B s:gui0C s:gui0D s:gui0E s:gui0F
|
||||
unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F
|
||||
''
|
117
home-manager/data/waybar-base16.nix
Normal file
117
home-manager/data/waybar-base16.nix
Normal file
@ -0,0 +1,117 @@
|
||||
name: base16:
|
||||
|
||||
''
|
||||
window#waybar {
|
||||
background-color: #${base16."base00"};
|
||||
border-bottom: 3px solid #${base16."base01"};
|
||||
color: #${base16."base0B"};
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
background-color: #${base16."base00"};
|
||||
color: #${base16."base0B"};
|
||||
border-bottom: 3px solid #${base16."base01"};
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: #${base16."base00"};
|
||||
border-bottom: 3px solid #${base16."base01"};
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: #${base16."base02"};
|
||||
border-bottom: 3px solid #${base16."base01"};
|
||||
}
|
||||
|
||||
#clock {
|
||||
background-color: #${base16."base01"};
|
||||
color: #${base16."base0B"};
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
#battery {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #f53c3c;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#memory {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#backlight {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#network {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#network.disconnected {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#temperature {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
background-color: #${base16."base0D"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#mpd {
|
||||
background-color: #${base16."base0E"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#mpd.disconnected {
|
||||
background-color: #${base16."base08"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
|
||||
#mpd.stopped {
|
||||
background-color: #${base16."base00"};
|
||||
color: #${base16."base0B"};
|
||||
}
|
||||
|
||||
#mpd.paused {
|
||||
background-color: #${base16."base09"};
|
||||
color: #${base16."base00"};
|
||||
}
|
||||
''
|
111
home-manager/data/waybar.nix
Normal file
111
home-manager/data/waybar.nix
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
layer = "top";
|
||||
height = 30;
|
||||
modules-left = [ "sway/workspaces" "sway/mode" "custom/media" ];
|
||||
modules-center = [ "sway/window" ];
|
||||
modules-right = [
|
||||
"mpd"
|
||||
"idle_inhibitor"
|
||||
"pulseaudio"
|
||||
"network"
|
||||
"cpu"
|
||||
"memory"
|
||||
"temperature"
|
||||
"backlight"
|
||||
"battery"
|
||||
"battery#bat2"
|
||||
"clock"
|
||||
"tray"
|
||||
];
|
||||
"sway/mode" = { format = ''<span style="italic">{}</span>''; };
|
||||
mpd = {
|
||||
format =
|
||||
"{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ";
|
||||
format-disconnected = "Disconnected ";
|
||||
format-stopped =
|
||||
"{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
|
||||
unknown-tag = "N/A";
|
||||
interval = 2;
|
||||
consume-icons = { on = " "; };
|
||||
random-icons = {
|
||||
off = ''<span color="#f53c3c"></span> '';
|
||||
on = " ";
|
||||
};
|
||||
repeat-icons = { on = " "; };
|
||||
single-icons = { on = "1 "; };
|
||||
state-icons = {
|
||||
paused = "";
|
||||
playing = "";
|
||||
};
|
||||
tooltip-format = "MPD (connected)";
|
||||
tooltip-format-disconnected = "MPD (disconnected)";
|
||||
};
|
||||
tray = { spacing = 10; };
|
||||
clock = {
|
||||
tooltip-format = "{:%Y-%m-%d | %H:%M}";
|
||||
format-alt = "{:%Y-%m-%d}";
|
||||
};
|
||||
cpu = {
|
||||
format = "{usage}% ";
|
||||
tooltip = false;
|
||||
};
|
||||
memory = { format = "{}% "; };
|
||||
temperature = {
|
||||
critical-threshold = 80;
|
||||
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = [ "" "" "" ];
|
||||
};
|
||||
backlight = {
|
||||
format = "{percent}% {icon}";
|
||||
format-icons = [ "" "" ];
|
||||
};
|
||||
battery = {
|
||||
states = {
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
format-charging = "{capacity}% ";
|
||||
format-plugged = "{capacity}% ";
|
||||
format-alt = "{time} {icon}";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
};
|
||||
"battery#bat2" = { bat = "BAT2"; };
|
||||
network = {
|
||||
format-wifi = "{essid} ({signalStrength}%) ";
|
||||
format-ethernet = "{ifname}: {ipaddr}/{cidr} ";
|
||||
format-linked = "{ifname} (No IP) ";
|
||||
format-disconnected = "Disconnected ⚠";
|
||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
||||
format-bluetooth-muted = " {icon} {format_source}";
|
||||
format-muted = " {format_source}";
|
||||
format-source = "{volume}% ";
|
||||
format-source-muted = "";
|
||||
format-icons = {
|
||||
headphones = "";
|
||||
handsfree = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [ "" "" "" ];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
"custom/media" = {
|
||||
format = "{icon} {}";
|
||||
return-type = "json";
|
||||
max-length = 40;
|
||||
format-icons = {
|
||||
spotify = "";
|
||||
default = "🎜";
|
||||
};
|
||||
escape = true;
|
||||
exec = "$HOME/.config/waybar/mediaplayer.py 2> /dev/null";
|
||||
};
|
||||
}
|
370
home-manager/modules/colors.nix
Normal file
370
home-manager/modules/colors.nix
Normal file
@ -0,0 +1,370 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.colors;
|
||||
|
||||
pow = n: i: if i == 1 then n else if i == 0 then 1 else n * pow n (i - 1);
|
||||
|
||||
alf = [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" ];
|
||||
fil = c: lib.imap0 (n: x: if (lib.toLower x) == c then n else null) alf;
|
||||
fin = c: builtins.elemAt (builtins.filter (x: x != null) (fil c)) 0;
|
||||
add = l: lib.foldr ({ n, x }: c: (x * (pow 16 n)) + c) 0 (lib.imap0 (n: x: { inherit n x; }) l);
|
||||
calc = s: add (builtins.map fin (builtins.filter (x: builtins.isString x && builtins.stringLength x == 1) (builtins.split "" s)));
|
||||
|
||||
hexToRgb = c:
|
||||
let
|
||||
s' = builtins.match "(..)(..)(..)|(.)(.)(.)" c;
|
||||
ss = builtins.elemAt s';
|
||||
o = if ss 0 == null then 3 else 0;
|
||||
in
|
||||
builtins.mapAttrs (_: calc) {
|
||||
r = ss (0 + o);
|
||||
g = ss (1 + o);
|
||||
b = ss (2 + o);
|
||||
};
|
||||
in
|
||||
{
|
||||
options.colors = {
|
||||
enable = mkEnableOption "Enable automatic colors";
|
||||
|
||||
i3BarColors = mkOption {
|
||||
description = "Exported color attrset for i3bar/swaybar";
|
||||
default = { };
|
||||
};
|
||||
|
||||
waybarCss = mkOption {
|
||||
description = "Exported CSS for waybar";
|
||||
default = "";
|
||||
};
|
||||
|
||||
base16Rgb = mkOption {
|
||||
readOnly = true;
|
||||
type = types.attrsOf (types.attrsOf types.int);
|
||||
};
|
||||
|
||||
base16 = mkOption {
|
||||
readOnly = true;
|
||||
type = types.attrsOf types.str;
|
||||
};
|
||||
|
||||
favColors = mkOption {
|
||||
description = "Your favourite color scheme";
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "Monokai";
|
||||
description = "Name of your color scheme";
|
||||
};
|
||||
base16 = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {
|
||||
base00 = "272822";
|
||||
base01 = "383830";
|
||||
base02 = "49483e";
|
||||
base03 = "75715e";
|
||||
base04 = "a59f85";
|
||||
base05 = "f8f8f2";
|
||||
base06 = "f5f4f1";
|
||||
base07 = "f9f8f5";
|
||||
base08 = "f92672";
|
||||
base09 = "fd971f";
|
||||
base0A = "f4bf75";
|
||||
base0B = "a6e22e";
|
||||
base0C = "a1efe4";
|
||||
base0D = "66d9ef";
|
||||
base0E = "ae81ff";
|
||||
base0F = "cc6633";
|
||||
};
|
||||
description = "BASE16 color scheme";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
i3config = {
|
||||
config = {
|
||||
colors = {
|
||||
background = "#${cfg.favColors.base16.base07}";
|
||||
focused = {
|
||||
border = "#${cfg.favColors.base16.base05}";
|
||||
background = "#${cfg.favColors.base16.base0D}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
indicator = "#${cfg.favColors.base16.base0D}";
|
||||
childBorder = "#${cfg.favColors.base16.base0D}";
|
||||
};
|
||||
focusedInactive = {
|
||||
border = "#${cfg.favColors.base16.base01}";
|
||||
background = "#${cfg.favColors.base16.base01}";
|
||||
text = "#${cfg.favColors.base16.base05}";
|
||||
indicator = "#${cfg.favColors.base16.base03}";
|
||||
childBorder = "#${cfg.favColors.base16.base01}";
|
||||
};
|
||||
unfocused = {
|
||||
border = "#${cfg.favColors.base16.base01}";
|
||||
background = "#${cfg.favColors.base16.base00}";
|
||||
text = "#${cfg.favColors.base16.base05}";
|
||||
indicator = "#${cfg.favColors.base16.base01}";
|
||||
childBorder = "#${cfg.favColors.base16.base01}";
|
||||
};
|
||||
urgent = {
|
||||
border = "#${cfg.favColors.base16.base08}";
|
||||
background = "#${cfg.favColors.base16.base08}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
indicator = "#${cfg.favColors.base16.base08}";
|
||||
childBorder = "#${cfg.favColors.base16.base08}";
|
||||
};
|
||||
placeholder = {
|
||||
border = "#${cfg.favColors.base16.base00}";
|
||||
background = "#${cfg.favColors.base16.base00}";
|
||||
text = "#${cfg.favColors.base16.base05}";
|
||||
indicator = "#${cfg.favColors.base16.base00}";
|
||||
childBorder = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
elementTheme = {
|
||||
name = "Nix colors 11";
|
||||
is_dark = true;
|
||||
colors = {
|
||||
"accent-color" = "#${cfg.favColors.base16.base02}";
|
||||
"primary-color" = "#${cfg.favColors.base16.base08}";
|
||||
"warning-color" = "#${cfg.favColors.base16.base0F}";
|
||||
|
||||
"sidebar-color" = "#${cfg.favColors.base16.base01}";
|
||||
"roomlist-background-color" = "#${cfg.favColors.base16.base00}";
|
||||
"roomlist-text-color" = "#${cfg.favColors.base16.base05}";
|
||||
"roomlist-text-secondary-color" = "${cfg.favColors.base16.base06}";
|
||||
"roomlist-highlights-color" = "#${cfg.favColors.base16.base02}";
|
||||
"roomlist-separator-color" = "#${cfg.favColors.base16.base05}";
|
||||
|
||||
"timeline-background-color" = "#${cfg.favColors.base16.base00}";
|
||||
"timeline-text-color" = "#${cfg.favColors.base16.base07}";
|
||||
"timeline-text-secondary-color" = "#${cfg.favColors.base16.base05}";
|
||||
"timeline-highlights-color" = "#${cfg.favColors.base16.base02}";
|
||||
"reaction-row-button-selected-bg-color" = "#${cfg.favColors.base16.base0B}";
|
||||
};
|
||||
};
|
||||
|
||||
elementConfig = {
|
||||
settingDefaults.custom_themes = [ elementTheme ];
|
||||
|
||||
settingDefaults.theme = "custom-${elementTheme.name}";
|
||||
default_theme = "custom-${elementTheme.name}";
|
||||
|
||||
showLabsSettings = true;
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
# Read only utility attributes
|
||||
colors.base16 = cfg.favColors.base16;
|
||||
colors.base16Rgb = builtins.map hexToRgb cfg.favColors.base16;
|
||||
|
||||
# Element
|
||||
xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig;
|
||||
xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig;
|
||||
xdg.configFile."element_theme.json".text = builtins.toJSON elementTheme;
|
||||
|
||||
# Mako
|
||||
programs.mako = {
|
||||
backgroundColor = "#${cfg.favColors.base16.base00}";
|
||||
textColor = "#${cfg.favColors.base16.base07}";
|
||||
borderColor = "#${cfg.favColors.base16.base08}";
|
||||
progressColor = "over #${cfg.favColors.base16.base0D}";
|
||||
};
|
||||
|
||||
# I3/sway
|
||||
wayland.windowManager.sway = i3config;
|
||||
xsession.windowManager.i3 = i3config;
|
||||
colors.i3BarColors = {
|
||||
background = "#${cfg.favColors.base16.base00}";
|
||||
separator = "#${cfg.favColors.base16.base01}";
|
||||
statusline = "#${cfg.favColors.base16.base04}";
|
||||
|
||||
focusedWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base05}";
|
||||
background = "#${cfg.favColors.base16.base0D}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
activeWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base05}";
|
||||
background = "#${cfg.favColors.base16.base03}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
inactiveWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base03}";
|
||||
background = "#${cfg.favColors.base16.base01}";
|
||||
text = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
urgentWorkspace = {
|
||||
border = "#${cfg.favColors.base16.base08}";
|
||||
background = "#${cfg.favColors.base16.base08}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
bindingMode = {
|
||||
border = "#${cfg.favColors.base16.base00}";
|
||||
background = "#${cfg.favColors.base16.base0A}";
|
||||
text = "#${cfg.favColors.base16.base00}";
|
||||
};
|
||||
};
|
||||
|
||||
# Waybar
|
||||
colors.waybarCss =
|
||||
"\n" + (
|
||||
(import ../data/waybar-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.base16
|
||||
);
|
||||
|
||||
# Dunst
|
||||
services.dunst = {
|
||||
settings = {
|
||||
global = {
|
||||
frame_color = "#${cfg.favColors.base16.base09}";
|
||||
separator_color = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
|
||||
urgency_low = {
|
||||
background = "#${cfg.favColors.base16.base01}";
|
||||
foreground = "#${cfg.favColors.base16.base03}";
|
||||
};
|
||||
|
||||
urgency_normal = {
|
||||
background = "#${cfg.favColors.base16.base02}";
|
||||
foreground = "#${cfg.favColors.base16.base05}";
|
||||
};
|
||||
|
||||
urgency_critical = {
|
||||
background = "#${cfg.favColors.base16.base08}";
|
||||
foreground = "#${cfg.favColors.base16.base06}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Rofi
|
||||
programs.rofi = {
|
||||
theme = (
|
||||
pkgs.writeText "rofi-base16-config"
|
||||
(
|
||||
(import ../data/rofi-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.favColors.base16
|
||||
)
|
||||
).outPath;
|
||||
};
|
||||
|
||||
# Kitty
|
||||
programs.kitty.extraConfig =
|
||||
let
|
||||
kittyColors =
|
||||
pkgs.writeText
|
||||
"favcolors-kitty-${cfg.favColors.name}.conf"
|
||||
(
|
||||
(import ../data/kitty-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.favColors.base16
|
||||
);
|
||||
in
|
||||
''
|
||||
include ${kittyColors}
|
||||
'';
|
||||
|
||||
# neovim
|
||||
xdg.configFile."nvim/colors/base16.vim".text = import ../data/vim-base16.nix cfg.favColors.name cfg.favColors.base16;
|
||||
programs.neovim.extraConfig = ''
|
||||
colorscheme base16
|
||||
set termguicolors
|
||||
'';
|
||||
|
||||
# GTK
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme =
|
||||
let
|
||||
materia_colors = pkgs.writeText "gtk-generated-colors" ''
|
||||
BG=${cfg.favColors.base16.base00}
|
||||
FG=${cfg.favColors.base16.base07}
|
||||
BTN_BG=${cfg.favColors.base16.base00}
|
||||
BTN_FG=${cfg.favColors.base16.base07}
|
||||
MENU_BG=${cfg.favColors.base16.base00}
|
||||
MENU_FG=${cfg.favColors.base16.base07}
|
||||
ACCENT_BG=${cfg.favColors.base16.base02}
|
||||
SEL_BG=${cfg.favColors.base16.base0D}
|
||||
SEL_FG=${cfg.favColors.base16.base00}
|
||||
TXT_BG=${cfg.favColors.base16.base00}
|
||||
TXT_FG=${cfg.favColors.base16.base07}
|
||||
HDR_BTN_BG=${cfg.favColors.base16.base00}
|
||||
HDR_BTN_FG=${cfg.favColors.base16.base07}
|
||||
WM_BORDER_FOCUS=${cfg.favColors.base16.base02}
|
||||
WM_BORDER_UNFOCUS=${cfg.favColors.base16.base01}
|
||||
MATERIA_STYLE_COMPACT=True
|
||||
MATERIA_COLOR_VARIANT=dark
|
||||
UNITY_DEFAULT_LAUNCHER_STYLE=False
|
||||
NAME=generated
|
||||
'';
|
||||
|
||||
generated-gtk-theme = pkgs.stdenv.mkDerivation {
|
||||
name = "generated-gtk-theme";
|
||||
src = pkgs.materia-theme.src;
|
||||
buildInputs = with pkgs; [ sassc bc which inkscape optipng ];
|
||||
installPhase = ''
|
||||
HOME=/build
|
||||
chmod 777 -R .
|
||||
patchShebangs .
|
||||
mkdir -p $out/share/themes
|
||||
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
|
||||
echo "Changing colours:"
|
||||
./change_color.sh -o Generated ${materia_colors}
|
||||
chmod 555 -R .
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
name = "Generated";
|
||||
package = generated-gtk-theme;
|
||||
};
|
||||
gtk2.extraConfig = (
|
||||
(import ../data/gtk2-base16.nix)
|
||||
cfg.favColors.name
|
||||
cfg.favColors.base16
|
||||
);
|
||||
};
|
||||
|
||||
# Codium/VSCODE
|
||||
programs.vscode.userSettings = {
|
||||
"workbench.colorTheme" = "nix colors";
|
||||
};
|
||||
|
||||
home.file = lib.mkMerge
|
||||
[
|
||||
(mkIf config.programs.vscode.enable {
|
||||
".vscode-oss/extensions/base16-1.0.0/themes/nix-colors.json".text = (import ../data/codium-base16.nix) cfg.favColors.name cfg.favColors.base16;
|
||||
".vscode-oss/extensions/base16-1.0.0/package.json".text = builtins.toJSON {
|
||||
name = "nix colors";
|
||||
displayName = "Automatic Nix-generated base16 colors";
|
||||
version = "1.0.0";
|
||||
publisher = "colors";
|
||||
author = {
|
||||
name = "ezpc usr";
|
||||
email = "usr@ezpc";
|
||||
};
|
||||
engines.vscode = "^1.11.1";
|
||||
categories = "Themes";
|
||||
contributes.themes = [
|
||||
{
|
||||
label = "nix colors";
|
||||
uiTheme = "vs-dark";
|
||||
path = "./themes/nix-colors.json";
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
15
home-manager/modules/default.nix
Normal file
15
home-manager/modules/default.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(lib.mkAliasOptionModule [ "ezpcusr" "favColors" ] [ "colors" "favColors" ])
|
||||
(lib.mkAliasOptionModule [ "ezpcusr" "favFont" ] [ "fonts" "favFont" ])
|
||||
(lib.mkAliasOptionModule [ "ezpcusr" "waybarCss" ] [ "programs" "waybar" "style" ])
|
||||
|
||||
./ezpcusr.nix
|
||||
./ezchromium.nix
|
||||
./ezcodium.nix
|
||||
./colors.nix
|
||||
./fonts.nix
|
||||
];
|
||||
}
|
128
home-manager/modules/ezchromium.nix
Normal file
128
home-manager/modules/ezchromium.nix
Normal file
@ -0,0 +1,128 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.ez.chromium;
|
||||
in
|
||||
{
|
||||
options.ez.chromium = {
|
||||
enable = mkEnableOption "Enable simple Chromium config";
|
||||
|
||||
extensions = mkOption {
|
||||
description = "List of extensions to be automatically installed";
|
||||
type = types.listOf (types.submodule {
|
||||
options = {
|
||||
id = mkOption {
|
||||
description = "ID of the extension on the store";
|
||||
type = types.str;
|
||||
};
|
||||
hash = mkOption {
|
||||
description = "Hash of the extension file";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
name = mkOption {
|
||||
description = "Name of the extension (in path form)";
|
||||
type = types.str;
|
||||
};
|
||||
url = mkOption {
|
||||
description = "URL of the extension if not on the chrome store";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
package = pkgs.ungoogled-chromium.override {
|
||||
commandLineArgs = "--enable-features=VaapiVideoDecoder";
|
||||
};
|
||||
};
|
||||
|
||||
home.file =
|
||||
let
|
||||
splitVersion = builtins.splitVersion pkgs.ungoogled-chromium.version;
|
||||
basicVersion = "${elemAt splitVersion 0}.${elemAt splitVersion 1}";
|
||||
|
||||
extensionJson = ext: {
|
||||
name = "${config.xdg.configHome}/chromium/External Extensions/${ext.id}.json";
|
||||
value.text = builtins.toJSON (({
|
||||
external_version = "0.420.69";
|
||||
}) // (if ext.hash == null then {
|
||||
external_update_url = "https://clients2.google.com/service/update2/crx";
|
||||
} else {
|
||||
external_crx = builtins.fetchurl {
|
||||
name = "${ext.name}";
|
||||
url = if ext.url != null then ext.url else "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${basicVersion}&x=id%3D${ext.id}%26installsource%3Dondemand%26uc";
|
||||
sha256 = ext.hash;
|
||||
};
|
||||
}));
|
||||
};
|
||||
in
|
||||
listToAttrs (map extensionJson cfg.extensions);
|
||||
|
||||
ez.chromium.extensions = [
|
||||
{
|
||||
id = "plfoiobmoplmhebmdiofljgnbekcdjan";
|
||||
hash = "1ml5f3nc6g07idvj85yk2bgkqpgbgd1a78g2zb0vqrmv211vqnzb";
|
||||
name = "ruffle";
|
||||
url = "https://github.com/ruffle-rs/ruffle/releases/download/nightly-2021-02-21/ruffle_nightly_2021_02_21_extension.zip";
|
||||
}
|
||||
{
|
||||
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
|
||||
# hash = "0klh5js0bpf21fqasx56kqipsv6dj29fz1jxjl49pwzk16bz8p1v";
|
||||
name = "ublock-origin";
|
||||
}
|
||||
{
|
||||
id = "eimadpbcbfnmbkopoojfekhnkhdbieeh";
|
||||
# hash = "085ysd0xxp1dpw6q4cngplnj51m1l1k3xkbf433hxrpaxlm0vafr";
|
||||
name = "dark-reader";
|
||||
}
|
||||
{
|
||||
id = "nngceckbapebfimnlniiiahkandclblb";
|
||||
# hash = "0gi23wy5a1l22hbln4mfvwa6f6c0cbzbaj9nvv8fkv97d1m5nlca";
|
||||
name = "bitwarden";
|
||||
}
|
||||
{
|
||||
url = "https://github.com/NeverDecaf/chromium-web-store/releases/download/v1.2.3/Chromium.Web.Store.crx";
|
||||
id = "ocaahdebbfolfmndjeplogmgcagdmblk";
|
||||
hash = "1v1c8q43y2gmsygacvri0cshfjgybxsasaf0c7cxwgnsx2kf98xh";
|
||||
name = "chromium-web-store";
|
||||
}
|
||||
{
|
||||
id = "lanfdkkpgfjfdikkncbnojekcppdebfp";
|
||||
# hash = "02dhazdxl1jm6nx8dkxk9dc0l0kqyfypj3sl1vmic1sqgib0nb5v";
|
||||
name = "canvas-fingerprint-defend";
|
||||
}
|
||||
{
|
||||
id = "fhkphphbadjkepgfljndicmgdlndmoke";
|
||||
# hash = "05yf2677s2scr3w8f6x93gv83cssy62h4v18gc2yigpgr2y3df7g";
|
||||
name = "font-fingerprint-defend";
|
||||
}
|
||||
{
|
||||
id = "olnbjpaejebpnokblkepbphhembdicik";
|
||||
# hash = "088gc2is92nkn5yrjc65657w0vvkkhks371c92ndz6w5mrc39xmw";
|
||||
name = "webgl-fingerprint-defend";
|
||||
}
|
||||
{
|
||||
id = "pcbjiidheaempljdefbdplebgdgpjcbe";
|
||||
# hash = "06rirbbp037yd6d3xsrc383k0n2y5rh7j69zax6mpzjx3zyvzkmn";
|
||||
name = "audio-fingerprint-defend";
|
||||
}
|
||||
# {
|
||||
# id = "npeicpdbkakmehahjeeohfdhnlpdklia";
|
||||
# hash = "1sfwfa28lrkq3df3r1645vy1qih9qc8x764bc5x2i2hrmg2vb8wp";
|
||||
# name = "webrtc-network-limiter";
|
||||
# }
|
||||
{
|
||||
id = "dhdgffkkebhmkfjojejmpbldmpobfkfo";
|
||||
# hash = "06acbcwwp3l9c6d178rq6my2pspl9gvqgp8l81al8pbbmwkfyjqv";
|
||||
name = "tampermonkey";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
73
home-manager/modules/ezcodium.nix
Normal file
73
home-manager/modules/ezcodium.nix
Normal file
@ -0,0 +1,73 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.ez.codium;
|
||||
in
|
||||
{
|
||||
options.ez.codium = {
|
||||
enable = mkEnableOption "Enable simple codium config";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.vscode.package = lib.mkDefault pkgs.vscodium;
|
||||
programs.vscode.extensions = with pkgs.vscode-extensions; [ vscodevim.vim bbenoist.Nix llvm-org.lldb-vscode ms-python.python ms-vscode-remote.remote-ssh redhat.vscode-yaml skyapps.fish-vscode ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
# programs.vscode.extensions = with pkgs.vscode-extensions; [ vscodevim.vim bbenoist.Nix llvm-org.lldb-vscode matklad.rust-analyzer ms-python.python ms-vscode-remote.remote-ssh redhat.vscode-yaml skyapps.fish-vscode ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
name = "bracket-pair-colorizer";
|
||||
publisher = "CoenraadS";
|
||||
version = "1.0.61";
|
||||
sha256 = "0r3bfp8kvhf9zpbiil7acx7zain26grk133f0r0syxqgml12i652";
|
||||
}
|
||||
{
|
||||
name = "vscode-direnv";
|
||||
publisher = "Rubymaniac";
|
||||
version = "0.0.2";
|
||||
sha256 = "1gml41bc77qlydnvk1rkaiv95rwprzqgj895kxllqy4ps8ly6nsd";
|
||||
}
|
||||
{
|
||||
name = "nixpkgs-fmt";
|
||||
publisher = "B4dM4n";
|
||||
version = "0.0.1";
|
||||
sha256 = "1gvjqy54myss4w1x55lnyj2l887xcnxc141df85ikmw1gr9s8gdz";
|
||||
}
|
||||
{
|
||||
name = "elm-ls-vscode";
|
||||
publisher = "Elmtooling";
|
||||
version = "1.3.0";
|
||||
sha256 = "0h0pibjq1rk7ji4f342vqky2zbq3f4fg1y260rig7y6x3z4007h3";
|
||||
}
|
||||
];
|
||||
|
||||
programs.vscode.userSettings = {
|
||||
"editor.selectionClipboard" = "native";
|
||||
"editor.emptySelectionClipboard" = true;
|
||||
"editor.dragAndDrop" = false;
|
||||
"editor.renderWhitespace" = "all";
|
||||
"editor.tabSize" = 2;
|
||||
"editor.wordWrap" = "on";
|
||||
|
||||
"telemetry.enableTelemetry" = false;
|
||||
"telemetry.enableCrashReporter" = false;
|
||||
|
||||
"window.titleBarStyle" = "native";
|
||||
"window.menuBarVisibility" = "toggle";
|
||||
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
|
||||
"git.enableSmartCommit" = true;
|
||||
"git.autofetch" = true;
|
||||
|
||||
"workbench.startupEditor" = "newUntitledFile";
|
||||
|
||||
"vim.easymotion" = true;
|
||||
"vim.camelCaseMotion.enable" = true;
|
||||
"vim.useSystemClipboard" = true;
|
||||
|
||||
"editor.formatOnSave" = true;
|
||||
|
||||
"elmLS.elmPath" = "${pkgs.elmPackages.elm}/bin/elm";
|
||||
"elmLS.elmFormatPath" = "${pkgs.elmPackages.elm-format}/bin/elm-format";
|
||||
"elmLS.elmAnalyseTrigger" = "change";
|
||||
};
|
||||
};
|
||||
}
|
1006
home-manager/modules/ezpcusr.nix
Normal file
1006
home-manager/modules/ezpcusr.nix
Normal file
File diff suppressed because it is too large
Load Diff
64
home-manager/modules/fonts.nix
Normal file
64
home-manager/modules/fonts.nix
Normal file
@ -0,0 +1,64 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.fonts;
|
||||
in
|
||||
{
|
||||
options.fonts = {
|
||||
enable = mkEnableOption "Enable automatic fonts";
|
||||
|
||||
favFont = mkOption {
|
||||
description = "Your favourite font";
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "Monoid Nerd Font Mono";
|
||||
description = "Name of your font";
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.nerdfonts.override { fonts = [ "Hack" "Monoid" "Hermit" ]; };
|
||||
description = "Package for your font";
|
||||
};
|
||||
size = mkOption {
|
||||
type = types.int;
|
||||
default = 10;
|
||||
description = "Size for your font";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
mkIf cfg.enable {
|
||||
home.packages = [ cfg.favFont.package ];
|
||||
|
||||
programs.vscode.userSettings = {
|
||||
"editor.fontFamily" = "\"${cfg.favFont.name}\"";
|
||||
};
|
||||
|
||||
gtk.font = {
|
||||
package = cfg.favFont.package;
|
||||
name = "${cfg.favFont.name} ${toString cfg.favFont.size}";
|
||||
};
|
||||
|
||||
programs.kitty.settings = {
|
||||
font_family = cfg.favFont.name;
|
||||
font_size = cfg.favFont.size;
|
||||
};
|
||||
|
||||
programs.rofi.font = "${cfg.favFont.name} ${toString cfg.favFont.size}";
|
||||
|
||||
programs.mako.font = "${cfg.favFont.name} ${toString cfg.favFont.size}";
|
||||
|
||||
wayland.windowManager.sway.config.fonts = [ cfg.favFont.name ];
|
||||
xsession.windowManager.i3.config.fonts = [ cfg.favFont.name ];
|
||||
|
||||
programs.neovim.extraConfig = ''
|
||||
set guifont=${lib.replaceChars [ " " ] [ "\\ " ] cfg.favFont.name}:h${toString (cfg.favFont.size + 0.5)}
|
||||
'';
|
||||
};
|
||||
}
|
39
home-manager/users/chekkie.nix
Normal file
39
home-manager/users/chekkie.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.packages = with pkgs; [ zsh-powerlevel9k ];
|
||||
|
||||
programs.htop = {
|
||||
enable = true;
|
||||
meters.left = [
|
||||
"LeftCPUs"
|
||||
"Blank"
|
||||
"Memory"
|
||||
{
|
||||
kind = "Uptime";
|
||||
mode = 4;
|
||||
}
|
||||
];
|
||||
meters.right = [ "RightCPUs" "Blank" "CPU" ];
|
||||
fields = [
|
||||
"USER"
|
||||
"PRIORITY"
|
||||
"NICE"
|
||||
"M_RESIDENT"
|
||||
"PERCENT_MEM"
|
||||
"PERCENT_CPU"
|
||||
"TIME"
|
||||
"COMM"
|
||||
];
|
||||
showProgramPath = false;
|
||||
showThreadNames = true;
|
||||
delay = 10;
|
||||
cpuCountFromZero = true;
|
||||
};
|
||||
|
||||
programs.fish.shellAliases = {
|
||||
node = "node --experimental-repl-await";
|
||||
ls = "lsd";
|
||||
bp = "npm version patch && npm publish && git push";
|
||||
};
|
||||
}
|
80
home-manager/users/glooder.nix
Normal file
80
home-manager/users/glooder.nix
Normal file
@ -0,0 +1,80 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.packages = with pkgs; [ zsh-powerlevel9k ];
|
||||
|
||||
programs.htop = {
|
||||
enable = true;
|
||||
meters.left = [
|
||||
"LeftCPUs"
|
||||
"Blank"
|
||||
"Memory"
|
||||
{
|
||||
kind = "Uptime";
|
||||
mode = 4;
|
||||
}
|
||||
];
|
||||
meters.right = [ "RightCPUs" "Blank" "CPU" ];
|
||||
fields = [
|
||||
"USER"
|
||||
"PRIORITY"
|
||||
"NICE"
|
||||
"M_RESIDENT"
|
||||
"PERCENT_MEM"
|
||||
"PERCENT_CPU"
|
||||
"TIME"
|
||||
"COMM"
|
||||
];
|
||||
showProgramPath = false;
|
||||
showThreadNames = true;
|
||||
delay = 10;
|
||||
cpuCountFromZero = true;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
oh-my-zsh.enable = true;
|
||||
oh-my-zsh.plugins = [ "powerlevel9k" ];
|
||||
|
||||
localVariables = {
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
TERM = "xterm-256color";
|
||||
DEFAULT_USER = "glooder";
|
||||
|
||||
POWERLEVEL9K_MODE = "awesome-fontconfig";
|
||||
POWERLEVEL9K_DIR_PATH_SEPARATOR = " ";
|
||||
POWERLEVEL9K_SHORTEN_DIR_LENGTH = "4";
|
||||
POWERLEVEL9K_SHORTEN_STRATEGY = "truncate_middle";
|
||||
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD = "0.3";
|
||||
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS =
|
||||
[ "status" "command_execution_time" ];
|
||||
POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER = "true";
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
export PATH=~/.bin:$PATH
|
||||
|
||||
eval $(thefuck --alias)
|
||||
|
||||
source ${pkgs.zsh-powerlevel9k}/share/zsh-powerlevel9k/powerlevel9k.zsh-theme
|
||||
function edt() {
|
||||
if [ "$TERM_PROGRAM" = "vscode" ]; then
|
||||
codium $@
|
||||
else
|
||||
vi $@
|
||||
fi
|
||||
}
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
code = "codium";
|
||||
node = "node --experimental-repl-await";
|
||||
ls = "lsd";
|
||||
bp = "npm version patch && npm publish && git push";
|
||||
nano = "edt";
|
||||
vi = "edt";
|
||||
};
|
||||
};
|
||||
}
|
50
home-manager/users/notgne2.nix
Normal file
50
home-manager/users/notgne2.nix
Normal file
@ -0,0 +1,50 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
zsh-powerlevel9k
|
||||
ncurses.dev
|
||||
lsd
|
||||
fzf # also needed for fzf.vim
|
||||
];
|
||||
|
||||
programs.fish.shellAliases = {
|
||||
node = "node --experimental-repl-await";
|
||||
ls = "lsd";
|
||||
};
|
||||
|
||||
programs.htop = {
|
||||
enable = true;
|
||||
meters.left = [
|
||||
"LeftCPUs"
|
||||
"Blank"
|
||||
"Memory"
|
||||
{
|
||||
kind = "Uptime";
|
||||
mode = 4;
|
||||
}
|
||||
];
|
||||
meters.right = [ "RightCPUs" "Blank" "CPU" ];
|
||||
fields = [
|
||||
"USER"
|
||||
"PRIORITY"
|
||||
"NICE"
|
||||
"M_RESIDENT"
|
||||
"PERCENT_MEM"
|
||||
"PERCENT_CPU"
|
||||
"TIME"
|
||||
"COMM"
|
||||
];
|
||||
delay = 10;
|
||||
cpuCountFromZero = true;
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
userName = "notgne2";
|
||||
userEmail = "gen2@gen2.space";
|
||||
};
|
||||
}
|
438
home-manager/users/notgne2_pc.nix
Normal file
438
home-manager/users/notgne2_pc.nix
Normal file
@ -0,0 +1,438 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
# TODO: find a better source
|
||||
mimeTypes = pkgs.fetchurl {
|
||||
url =
|
||||
"https://raw.githubusercontent.com/eprints/eprints3.4/master/lib/mime.types";
|
||||
sha256 = "0cdhq71wk5h3zcfrz8dyqc3vrjyikwjqsla855v036r54lch0kn2";
|
||||
};
|
||||
|
||||
edt = pkgs.writeScriptBin "edt" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
nvim $@
|
||||
else
|
||||
# nvim-qt $@
|
||||
nohup kitty nvim "$@" > /dev/null & disown
|
||||
fi
|
||||
'';
|
||||
|
||||
sc = pkgs.writeScript "sc.sh" ''
|
||||
#!${pkgs.zsh}/bin/zsh
|
||||
git commit -am "$*"
|
||||
'';
|
||||
|
||||
allgm8 = pkgs.writeScript "sc.sh" ''
|
||||
#!${pkgs.zsh}/bin/zsh
|
||||
for loc in au-02 us-03 us-04 eu-01; do echo "--- $loc: "; ssh "$loc.gm8.app" "$1"; echo "done"; done
|
||||
'';
|
||||
|
||||
prefetch-git = pkgs.writeScript "prefetch-git.sh" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
nix-prefetch-git $1 --rev $(git ls-remote -h $1 |cut -f1)
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ./notgne2.nix ];
|
||||
|
||||
programs.fish.interactiveShellInit = ''
|
||||
export GPG_TTY=(tty)
|
||||
${pkgs.gnupg}/bin/gpgconf --launch gpg-agent
|
||||
'';
|
||||
|
||||
home.file.".gnupg/gpg-agent.conf".text = ''
|
||||
enable-ssh-support
|
||||
pinentry-program ${pkgs.pinentry.curses}/bin/pinentry-curses
|
||||
default-cache-ttl 60
|
||||
max-cache-ttl 120
|
||||
'';
|
||||
|
||||
programs.git.signing.key = "BB661E172B42A7F8";
|
||||
programs.git.signing.signByDefault = true;
|
||||
|
||||
xdg.configFile."nvim/coc-settings.json".source = pkgs.writeText "coc-settings.json" (builtins.toJSON {
|
||||
languageserver = {
|
||||
nix = {
|
||||
command = "${pkgs.rnix-lsp}/bin/rnix-lsp";
|
||||
filetypes = [ "nix" ];
|
||||
};
|
||||
elmLS = {
|
||||
command = "${pkgs.elmPackages.elm-language-server}/bin/elm-language-server";
|
||||
filetypes = [ "elm" ];
|
||||
rootPatterns = [ "elm.json" ];
|
||||
};
|
||||
};
|
||||
codeLens.enable = true;
|
||||
coc.preferences.formatOnSaveFiletypes = [ "rust" "elm" "javascript" "typescript" "json" ];
|
||||
});
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withNodeJs = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-nix
|
||||
camelcasemotion
|
||||
vim-indent-object
|
||||
vim-commentary
|
||||
vim-surround
|
||||
{
|
||||
plugin = vim-airline;
|
||||
config = ''
|
||||
if exists('g:started_by_firenvim')
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
let g:airline_powerline_fonts = 0
|
||||
else
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline_powerline_fonts = 1
|
||||
endif
|
||||
|
||||
" remove c, which contains filename, without firevim it's in the buffer, with firevim I don't want to see it, so this can always be applied
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'a', 'b' ],
|
||||
\ [ 'x', 'y', 'z', 'error', 'warning' ]
|
||||
\ ]
|
||||
'';
|
||||
}
|
||||
coc-nvim
|
||||
coc-rust-analyzer
|
||||
coc-tsserver
|
||||
vim-visual-multi
|
||||
{
|
||||
plugin = fzf-vim;
|
||||
config = ''
|
||||
map ; :Files<CR>
|
||||
'';
|
||||
}
|
||||
(
|
||||
pkgs.vimUtils.buildVimPlugin {
|
||||
name = "firenvim";
|
||||
src = builtins.fetchGit {
|
||||
url = "git+ssh://git@github.com/glacambre/firenvim.git";
|
||||
rev = "3b6558c47f6a3721fadce5b4ac70335be9863632";
|
||||
};
|
||||
})
|
||||
vim-gitgutter
|
||||
];
|
||||
extraConfig = ''
|
||||
set encoding=utf-8
|
||||
set hidden
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
set cmdheight=2
|
||||
set updatetime=200
|
||||
set shortmess+=c
|
||||
" maybe should be number?
|
||||
set signcolumn=yes
|
||||
|
||||
set clipboard+=unnamedplus
|
||||
set mouse=a
|
||||
|
||||
map <Tab> :bnext<CR>
|
||||
map <S-Tab> :bprev<CR>
|
||||
|
||||
" Use tab for trigger completion with characters ahead and navigate.
|
||||
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
||||
" other plugin before putting this into your config.
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
if has('nvim')
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
else
|
||||
inoremap <silent><expr> <c-@> coc#refresh()
|
||||
endif
|
||||
|
||||
" Make <CR> auto-select the first completion item and notify coc.nvim to
|
||||
" format on enter, <cr> could be remapped by other vim plugin
|
||||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
||||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||
|
||||
" Use `[g` and `]g` to navigate diagnostics
|
||||
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
|
||||
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
||||
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
||||
|
||||
" GoTo code navigation.
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
nmap <silent> gy <Plug>(coc-type-definition)
|
||||
nmap <silent> gi <Plug>(coc-implementation)
|
||||
nmap <silent> gr <Plug>(coc-references)
|
||||
|
||||
" Use K to show documentation in preview window.
|
||||
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||
|
||||
function! s:show_documentation()
|
||||
if (index(['vim','help'], &filetype) >= 0)
|
||||
execute 'h '.expand('<cword>')
|
||||
elseif (coc#rpc#ready())
|
||||
call CocActionAsync('doHover')
|
||||
else
|
||||
execute '!' . &keywordprg . " " . expand('<cword>')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Highlight the symbol and its references when holding the cursor.
|
||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||
|
||||
" Symbol renaming.
|
||||
nmap <leader>rn <Plug>(coc-rename)
|
||||
|
||||
" Formatting selected code.
|
||||
xmap <leader>f <Plug>(coc-format-selected)
|
||||
nmap <leader>f <Plug>(coc-format-selected)
|
||||
|
||||
" Applying codeAction to the selected region.
|
||||
" Example: `<leader>aap` for current paragraph
|
||||
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
|
||||
" Remap keys for applying codeAction to the current buffer.
|
||||
nmap <leader>ac <Plug>(coc-codeaction)
|
||||
" Apply AutoFix to problem on the current line.
|
||||
nmap <leader>qf <Plug>(coc-fix-current)
|
||||
|
||||
" Map function and class text objects
|
||||
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
|
||||
xmap if <Plug>(coc-funcobj-i)
|
||||
omap if <Plug>(coc-funcobj-i)
|
||||
xmap af <Plug>(coc-funcobj-a)
|
||||
omap af <Plug>(coc-funcobj-a)
|
||||
xmap ic <Plug>(coc-classobj-i)
|
||||
omap ic <Plug>(coc-classobj-i)
|
||||
xmap ac <Plug>(coc-classobj-a)
|
||||
omap ac <Plug>(coc-classobj-a)
|
||||
|
||||
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
||||
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
||||
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
|
||||
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
|
||||
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
||||
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
||||
|
||||
" Use CTRL-S for selections ranges.
|
||||
" Requires 'textDocument/selectionRange' support of language server.
|
||||
nmap <silent> <C-s> <Plug>(coc-range-select)
|
||||
xmap <silent> <C-s> <Plug>(coc-range-select)
|
||||
|
||||
" Add `:Format` command to format current buffer.
|
||||
command! -nargs=0 Format :call CocAction('format')
|
||||
|
||||
" Add `:Fold` command to fold current buffer.
|
||||
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
||||
|
||||
" Add `:OR` command for organize imports of the current buffer.
|
||||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
||||
|
||||
" Mappings for CoCList
|
||||
" Show all diagnostics.
|
||||
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
|
||||
" Manage extensions.
|
||||
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
|
||||
" Show commands.
|
||||
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
|
||||
" Find symbol of current document.
|
||||
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
|
||||
" Search workspace symbols.
|
||||
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
|
||||
" Do default action for next item.
|
||||
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
|
||||
" Do default action for previous item.
|
||||
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
|
||||
" Resume latest coc list.
|
||||
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
|
||||
'';
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
FZF_DEFAULT_COMMAND = "${pkgs.fd}/bin/fd --type f";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
xclip # needed for nvim
|
||||
direnv
|
||||
nixpkgs-fmt
|
||||
neovim-qt
|
||||
edt
|
||||
];
|
||||
|
||||
ezpcusr.uploadScript = pkgs.writeScript "upload_file.sh" ''
|
||||
#!${pkgs.zsh}/bin/zsh
|
||||
fileid=$(${pkgs.pwgen}/bin/pwgen 16 1)
|
||||
|
||||
filename=$(basename $1)
|
||||
extension=$(echo "''${filename##*.}" | awk '{gsub(/^ +| +$/,"")} {print $0}')
|
||||
if [[ "$extension" = "$filename" ]] then
|
||||
extension=$(grep "$(file -b --mime-type $1)" ${mimeTypes} | awk '{print $2}')
|
||||
fi
|
||||
|
||||
rsync -a --chmod=664 "$1" "wizbos.club:~/public/uploads/$fileid.$extension"
|
||||
echo "https://p.gen2.space/uploads/$fileid.$extension"
|
||||
'';
|
||||
|
||||
ezpcusr = {
|
||||
favFont.name = "Hack Nerd Font Mono";
|
||||
favFont.size = 10;
|
||||
# favColors = {
|
||||
# name = "Tube";
|
||||
# base16 = {
|
||||
# base00 = "231f20";
|
||||
# base01 = "1c3f95";
|
||||
# base02 = "5a5758";
|
||||
# base03 = "737171";
|
||||
# base04 = "959ca1";
|
||||
# base05 = "d9d8d8";
|
||||
# base06 = "e7e7e8";
|
||||
# base07 = "ffffff";
|
||||
# base08 = "ee2e24";
|
||||
# base09 = "f386a1";
|
||||
# base0A = "ffd204";
|
||||
# base0B = "00853e";
|
||||
# base0C = "85cebc";
|
||||
# base0D = "009ddc";
|
||||
# base0E = "98005d";
|
||||
# base0F = "b06110";
|
||||
# };
|
||||
# };
|
||||
# DO NOT USE
|
||||
# favColors = {
|
||||
# name = "Minecraft";
|
||||
# base16 = {
|
||||
# base00 = "080a10";
|
||||
# base08 = "373b41";
|
||||
# base01 = "b60000";
|
||||
# base09 = "a74c4d";
|
||||
# base02 = "568549";
|
||||
# base0A = "afb12f";
|
||||
# base03 = "966c4a";
|
||||
# base0B = "ffbc5e";
|
||||
# base04 = "243e75";
|
||||
# base0C = "78a7ff";
|
||||
# base05 = "ca00e9";
|
||||
# base0D = "db74f3";
|
||||
# base06 = "00897b";
|
||||
# base0E = "1de9b6";
|
||||
# base07 = "afb8c8";
|
||||
# base0F = "b1b1b1";
|
||||
# };
|
||||
# };
|
||||
# favColors = {
|
||||
# name = "Summerfruit-Dark";
|
||||
# base16 = {
|
||||
# base00 = "151515";
|
||||
# base01 = "202020";
|
||||
# base02 = "303030";
|
||||
# base03 = "505050";
|
||||
# base04 = "B0B0B0";
|
||||
# base05 = "D0D0D0";
|
||||
# base06 = "E0E0E0";
|
||||
# base07 = "FFFFFF";
|
||||
# base08 = "FF0086";
|
||||
# base09 = "FD8900";
|
||||
# base0A = "ABA800";
|
||||
# base0B = "00C918";
|
||||
# base0C = "1FAAAA";
|
||||
# base0D = "3777E6";
|
||||
# base0E = "AD00A1";
|
||||
# base0F = "CC6633";
|
||||
# };
|
||||
# };
|
||||
# favColors = {
|
||||
# name = "Materia";
|
||||
# base16 = {
|
||||
# base00 = "263238";
|
||||
# base01 = "2C393F";
|
||||
# base02 = "37474F";
|
||||
# base03 = "707880";
|
||||
# base04 = "C9CCD3";
|
||||
# base05 = "CDD3DE";
|
||||
# base06 = "D5DBE5";
|
||||
# base07 = "FFFFFF";
|
||||
# base08 = "EC5F67";
|
||||
# base09 = "EA9560";
|
||||
# base0A = "FFCC00";
|
||||
# base0B = "8BD649";
|
||||
# base0C = "80CBC4";
|
||||
# base0D = "89DDFF";
|
||||
# base0E = "82AAFF";
|
||||
# base0F = "EC5F67";
|
||||
# };
|
||||
# };
|
||||
# favColors = {
|
||||
# name = "spacemacs";
|
||||
# base16 = {
|
||||
# base00 = "1F2022";
|
||||
# base01 = "282828";
|
||||
# base02 = "444155";
|
||||
# base03 = "585858";
|
||||
# base04 = "B8B8B8";
|
||||
# base05 = "A3A3A3";
|
||||
# base06 = "E8E8E8";
|
||||
# base07 = "F8F8F8";
|
||||
# base08 = "F2241F";
|
||||
# base09 = "FFA500";
|
||||
# base0A = "B1951D";
|
||||
# base0B = "67B11D";
|
||||
# base0C = "2D9574";
|
||||
# base0D = "4F97D7";
|
||||
# base0E = "A31DB1";
|
||||
# base0F = "B03060";
|
||||
# };
|
||||
# };
|
||||
favColors = {
|
||||
name = "Material Vivid";
|
||||
base16 = {
|
||||
base00 = "202124";
|
||||
base01 = "27292c";
|
||||
base02 = "323639";
|
||||
base03 = "44464d";
|
||||
base04 = "676c71";
|
||||
base05 = "80868b";
|
||||
base06 = "9e9e9e";
|
||||
base07 = "ffffff";
|
||||
base08 = "f44336";
|
||||
base09 = "ff9800";
|
||||
base0A = "ffeb3b";
|
||||
base0B = "00e676";
|
||||
base0C = "00bcd4";
|
||||
base0D = "2196f3";
|
||||
base0E = "673ab7";
|
||||
base0F = "8d6e63";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.fish.shellAliases = {
|
||||
bp = "npm version patch && npm publish && git push";
|
||||
nano = "edt";
|
||||
vi = "edt";
|
||||
sc = "${sc}";
|
||||
allgm8 = "${allgm8}";
|
||||
prefetch-git = "${prefetch-git}";
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
userName = "notgne2";
|
||||
userEmail = "gen2@gen2.space";
|
||||
};
|
||||
|
||||
xdg.configFile."nvim-qt/nvim-qt.conf".text = ''
|
||||
ext_tabline=false
|
||||
ext_popupmenu=false
|
||||
'';
|
||||
|
||||
programs.vscode.enable = true;
|
||||
}
|
13
modules/default.nix
Normal file
13
modules/default.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./ezvahi.nix
|
||||
./ezwg.nix
|
||||
./ezpc.nix
|
||||
./kiosk.nix
|
||||
./ezpassthru.nix
|
||||
./fuckingprint.nix
|
||||
./workstation.nix
|
||||
];
|
||||
}
|
51
modules/ezpassthru.nix
Normal file
51
modules/ezpassthru.nix
Normal file
@ -0,0 +1,51 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.ezpassthru;
|
||||
in
|
||||
{
|
||||
options.services.ezpassthru = {
|
||||
enable =
|
||||
mkEnableOption
|
||||
"Enable simple VM PCI passthrough config (NOTE: this is only for ppl with a primary AMD/Intel, and a non-primary NVidia)";
|
||||
|
||||
PCIs = mkOption {
|
||||
description = "The ID pairs of your PCI devices to passthrough";
|
||||
example = {
|
||||
"10de:1b80" = "0000:41:00.0";
|
||||
"10de:10f0" = "0000:41:00.1";
|
||||
"1022:43ba" = "0000:01:00.0";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.kernelModules = [
|
||||
"kvm-intel"
|
||||
"kvm-amd"
|
||||
"vfio_virqfd"
|
||||
"vfio_pci"
|
||||
"vfio_iommu_type1"
|
||||
"vfio"
|
||||
];
|
||||
|
||||
boot.kernelParams = [
|
||||
"intel_iommu=on"
|
||||
"amd_iommu=on"
|
||||
"pcie_aspm=off"
|
||||
];
|
||||
|
||||
boot.extraModprobeConfig = "options vfio-pci ids=${
|
||||
builtins.concatStringsSep "," (builtins.attrNames cfg.PCIs)
|
||||
}";
|
||||
|
||||
boot.postBootCommands = ''
|
||||
DEVS="${builtins.concatStringsSep " " (builtins.attrValues cfg.PCIs)}"
|
||||
for DEV in $DEVS; do
|
||||
echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
|
||||
done
|
||||
|
||||
modprobe -i vfio-pci
|
||||
'';
|
||||
};
|
||||
}
|
197
modules/ezpc.nix
Normal file
197
modules/ezpc.nix
Normal file
@ -0,0 +1,197 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.ezpc;
|
||||
|
||||
mainConfig = {
|
||||
services.thermald.enable = true;
|
||||
|
||||
environment.etc."chromium/policies/managed/policies.json".text = ''
|
||||
{
|
||||
"NewTabPageLocation": "https://wizbos.club/"
|
||||
}
|
||||
'';
|
||||
|
||||
workstation.enable = true;
|
||||
workstation.user = cfg.user;
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
networking.firewall.allowedUDPPorts = [ 1900 ];
|
||||
|
||||
hardware.pulseaudio.enable = lib.mkDefault (!cfg.portals);
|
||||
|
||||
services.pipewire.enable = lib.mkDefault cfg.portals;
|
||||
services.pipewire.jack.enable = lib.mkDefault cfg.portals;
|
||||
services.pipewire.alsa.enable = lib.mkDefault cfg.portals;
|
||||
services.pipewire.alsa.support32Bit = lib.mkDefault cfg.portals;
|
||||
services.pipewire.pulse.enable = lib.mkDefault cfg.portals;
|
||||
|
||||
xdg.portal.enable = lib.mkDefault cfg.portals;
|
||||
xdg.portal.gtkUsePortal = lib.mkDefault cfg.portals;
|
||||
xdg.portal.extraPortals = lib.mkDefault (if cfg.portals then with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ] else []);
|
||||
# https://github.com/NixOS/nixpkgs/issues/108855
|
||||
systemd.user.services.xdg-desktop-portal.environment = lib.mkDefault (lib.mkIf cfg.portals {
|
||||
XDG_DESKTOP_PORTAL_DIR = config.environment.variables.XDG_DESKTOP_PORTAL_DIR;
|
||||
});
|
||||
|
||||
# let me use audio and phones
|
||||
programs.adb.enable = cfg.developer;
|
||||
|
||||
# Set some X11 props
|
||||
services.xserver = {
|
||||
enable = lib.mkDefault (cfg.gfx == "nvidia");
|
||||
layout = lib.mkDefault "us";
|
||||
libinput.enable = true;
|
||||
|
||||
# automatic gfx drivers
|
||||
videoDrivers = mkIf (cfg.gfx != null) [ cfg.gfx ];
|
||||
};
|
||||
security.pam.services = {
|
||||
swaylock.text = ''
|
||||
auth include login
|
||||
'';
|
||||
};
|
||||
};
|
||||
notBatteryConfig = {
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
};
|
||||
batteryConfig = {
|
||||
services.upower = {
|
||||
enable = true;
|
||||
percentageLow = 15;
|
||||
percentageCritical = 10;
|
||||
percentageAction = 5;
|
||||
};
|
||||
services.tlp.enable = true;
|
||||
services.tlp.extraConfig = ''
|
||||
TLP_ENABLE=1
|
||||
CPU_SCALING_GOVERNOR_ON_BAT=powersave
|
||||
CPU_SCALING_GOVERNOR_ON_AC=ondemand
|
||||
CPU_BOOST_ON_BAT=0
|
||||
CPU_BOOST_ON_AC=1
|
||||
CPU_MIN_PERF_ON_BAT=0
|
||||
CPU_MAX_PERF_ON_BAT=30
|
||||
CPU_MIN_PERF_ON_AC=0
|
||||
CPU_MAX_PERF_ON_AC=100
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT=power
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC=ondemand
|
||||
'';
|
||||
};
|
||||
gamingConfig = {
|
||||
environment.systemPackages =
|
||||
let
|
||||
steam = pkgs.steam.override { withJava = true; };
|
||||
|
||||
steam-run = steam.run;
|
||||
|
||||
newwine = (pkgs.wineFull.override { wineBuild = "wineWow"; wineRelease = "staging"; });
|
||||
newwinetricks = pkgs.winetricks.override { wine = newwine; };
|
||||
|
||||
oldwine = (pkgs.wineFull.override { wineBuild = "wineWow"; });
|
||||
oldwinetricks = pkgs.winetricks.override { wine = oldwine; };
|
||||
in
|
||||
with pkgs; ([
|
||||
steam
|
||||
steam-run
|
||||
xlibs.xf86inputjoystick
|
||||
oldwine
|
||||
oldwinetricks
|
||||
(writeScriptBin "steam-run-native" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
${(steam.override { nativeOnly = true; }).run}/bin/steam-run $@
|
||||
'')
|
||||
] ++ (
|
||||
if cfg.newWine then [
|
||||
(
|
||||
pkgs.runCommand "new-wine-stuff"
|
||||
{ } ''
|
||||
mkdir -p $out/bin
|
||||
ln -s ${newwine}/bin/wine $out/bin/new-wine
|
||||
ln -s ${newwine}/bin/winecfg $out/bin/new-winecfg
|
||||
ln -s ${newwinetricks}/bin/winetricks $out/bin/new-winetricks
|
||||
''
|
||||
)
|
||||
] else [ ]
|
||||
));
|
||||
};
|
||||
in
|
||||
{
|
||||
options.ezpc = {
|
||||
enable = mkEnableOption "Enable simple PC config";
|
||||
|
||||
battery = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If this device has a battery";
|
||||
};
|
||||
|
||||
portals = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "use weird new hipster portal shit";
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
description = "The main user of this PC";
|
||||
};
|
||||
|
||||
gaming = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If this PC is used for gaming";
|
||||
};
|
||||
|
||||
touchscreen = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If this PC has a touchscreen";
|
||||
};
|
||||
|
||||
gfx = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Type of your PC's graphics card";
|
||||
example = "intel";
|
||||
};
|
||||
|
||||
print = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If this PC should support printing/scanning";
|
||||
};
|
||||
|
||||
developer = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Should enable advanced shit for developers";
|
||||
};
|
||||
|
||||
bluetooth = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If this PC has bluetooth support";
|
||||
};
|
||||
|
||||
tiling = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "If you are based and redpilled, and want a tiling WM (deprecated, default)";
|
||||
};
|
||||
|
||||
newWine = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "If you want to include wine-staging as new-wine";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [
|
||||
mainConfig
|
||||
(mkIf cfg.gaming gamingConfig)
|
||||
(mkIf cfg.battery batteryConfig)
|
||||
(mkIf (cfg.battery != true) notBatteryConfig)
|
||||
]
|
||||
);
|
||||
}
|
22
modules/ezvahi.nix
Normal file
22
modules/ezvahi.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.ezvahi;
|
||||
in
|
||||
{
|
||||
options.services.ezvahi.enable = mkEnableOption "Enable simple Avahi config";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
domain = true;
|
||||
workstation = true;
|
||||
userServices = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
97
modules/ezwg.nix
Normal file
97
modules/ezwg.nix
Normal file
@ -0,0 +1,97 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.ezwg;
|
||||
in
|
||||
{
|
||||
options.services.ezwg = {
|
||||
enable = mkEnableOption "Enable simple Wireguard connection";
|
||||
|
||||
proxy = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Route all your traffic through this connection";
|
||||
};
|
||||
|
||||
lanSize = mkOption {
|
||||
type = types.int;
|
||||
default = 24;
|
||||
description = "Size of your VLAN (only relevant if proxy is false)";
|
||||
};
|
||||
|
||||
serverIP = mkOption {
|
||||
type = types.str;
|
||||
description = "The IP of the wg server";
|
||||
};
|
||||
|
||||
serverPort = mkOption {
|
||||
type = types.int;
|
||||
default = 51820;
|
||||
description = "The port of the wg server";
|
||||
};
|
||||
|
||||
serverKey = mkOption {
|
||||
type = types.str;
|
||||
description = "The public key of the wg server";
|
||||
};
|
||||
|
||||
privateKeyFile = mkOption {
|
||||
type = types.str;
|
||||
description = "Private wg key";
|
||||
};
|
||||
|
||||
vlanIP = mkOption {
|
||||
type = types.str;
|
||||
description = "The IP to use on the wg VLAN";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall.checkReversePath = false;
|
||||
networking.wireguard.interfaces.wg0 =
|
||||
let
|
||||
generateRangesScript =
|
||||
builtins.toFile "exclusionary-wildcard-ranges-generator.py" ''
|
||||
import ipaddress
|
||||
n1 = ipaddress.ip_network('0.0.0.0/0')
|
||||
n2 = ipaddress.ip_network('${cfg.serverIP}/32')
|
||||
print(':'.join(list(map(lambda x: str(x), list(n1.address_exclude(n2))))), end="")
|
||||
'';
|
||||
|
||||
rangesOutput =
|
||||
pkgs.runCommandNoCC "exclusionary-wildcard-ranges"
|
||||
{ } ''
|
||||
${pkgs.python3}/bin/python3 ${generateRangesScript} > $out
|
||||
'';
|
||||
|
||||
generateSubnetScript =
|
||||
builtins.toFile "subnet-without-host-bits-generator.py" ''
|
||||
import ipaddress
|
||||
n1 = ipaddress.ip_network('${cfg.vlanIP}/${toString cfg.lanSize}', False)
|
||||
print(n1, end="")
|
||||
'';
|
||||
|
||||
subnetOutput =
|
||||
pkgs.runCommandNoCC "subnet-without-host-bits"
|
||||
{ } ''
|
||||
${pkgs.python3}/bin/python3 ${generateSubnetScript} > $out
|
||||
'';
|
||||
|
||||
ranges = lib.splitString ":" (builtins.readFile "${rangesOutput}");
|
||||
subnet = builtins.readFile "${subnetOutput}";
|
||||
in
|
||||
{
|
||||
ips = [ "${cfg.vlanIP}/32" ];
|
||||
privateKeyFile = cfg.privateKeyFile;
|
||||
|
||||
peers = [
|
||||
{
|
||||
publicKey = cfg.serverKey;
|
||||
allowedIPs = if cfg.proxy then ranges else [ subnet ];
|
||||
endpoint = "${cfg.serverIP}:${toString cfg.serverPort}";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
57
modules/fuckingprint.nix
Normal file
57
modules/fuckingprint.nix
Normal file
@ -0,0 +1,57 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.fuckingprint;
|
||||
in
|
||||
{
|
||||
options.fuckingprint.enable = mkEnableOption "Make my fucking printer work";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.ezvahi.enable = lib.mkDefault true;
|
||||
|
||||
# Enable CUPS and SANE for printing and scanning
|
||||
services.printing.enable = true;
|
||||
services.printing.browsing = true;
|
||||
services.printing.listenAddresses = [ "*:631" ];
|
||||
services.printing.allowFrom = [ "all" ];
|
||||
services.printing.defaultShared = true;
|
||||
services.printing.drivers = with pkgs; [
|
||||
gutenprint
|
||||
gutenprintBin
|
||||
|
||||
hplip
|
||||
|
||||
samsungUnifiedLinuxDriver
|
||||
splix
|
||||
brlaser
|
||||
|
||||
brgenml1lpr
|
||||
brgenml1cupswrapper
|
||||
|
||||
cups-brother-hl1110
|
||||
|
||||
mfcj470dw-cupswrapper
|
||||
mfcj6510dw-cupswrapper
|
||||
|
||||
mfcl3770cdwcupswrapper
|
||||
mfcl2700dncupswrapper
|
||||
mfcl2720dwcupswrapper
|
||||
mfcl2740dwcupswrapper
|
||||
|
||||
mfcj470dwlpr
|
||||
mfcj6510dwlpr
|
||||
|
||||
mfcl3770cdwlpr
|
||||
mfcl2700dnlpr
|
||||
mfcl2720dwlpr
|
||||
mfcl2740dwlpr
|
||||
];
|
||||
hardware.sane.enable = true;
|
||||
hardware.sane.brscan4.enable = true;
|
||||
hardware.sane.extraBackends = with pkgs; [
|
||||
utsushi
|
||||
epkowa
|
||||
hplipWithPlugin
|
||||
];
|
||||
};
|
||||
}
|
84
modules/kiosk.nix
Normal file
84
modules/kiosk.nix
Normal file
@ -0,0 +1,84 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.kiosk;
|
||||
in
|
||||
{
|
||||
options.services.kiosk = {
|
||||
enable = mkEnableOption "Enable simple kiosk display";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "root";
|
||||
description = "The user to run the kiosk under";
|
||||
};
|
||||
|
||||
cursor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Allow a cursor";
|
||||
};
|
||||
|
||||
session = mkOption {
|
||||
type = types.lines;
|
||||
default = "${pkgs.kitty}/bin/kitty ${pkgs.htop}/bin/htop";
|
||||
description = "The session script to run for the kiosk";
|
||||
};
|
||||
|
||||
wayland = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Use wayland instead of xserver";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.cage = mkIf cfg.wayland {
|
||||
enable = true;
|
||||
user = cfg.user;
|
||||
program = cfg.session;
|
||||
# TODO cursor
|
||||
};
|
||||
|
||||
services.xserver = mkIf (!cfg.wayland) {
|
||||
enable = true;
|
||||
|
||||
windowManager.ratpoison.enable = true;
|
||||
|
||||
monitorSection = ''
|
||||
Option "NODPMS"
|
||||
'';
|
||||
|
||||
serverLayoutSection = ''
|
||||
Option "BlankTime" "0"
|
||||
Option "DPMS" "false"
|
||||
'';
|
||||
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "${cfg.user}";
|
||||
};
|
||||
};
|
||||
|
||||
displayManager.xserverArgs = if cfg.cursor then [ ] else [ "-nocursor" ];
|
||||
displayManager.defaultSession = "kiosk+ratpoison";
|
||||
|
||||
desktopManager.session = [
|
||||
{
|
||||
name = "kiosk";
|
||||
start = ''
|
||||
# dont blank the screen after 5min
|
||||
xset dpms force on
|
||||
xset -dpms
|
||||
xset s noblank
|
||||
xset s off
|
||||
|
||||
${cfg.session}
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
118
modules/workstation.nix
Normal file
118
modules/workstation.nix
Normal file
@ -0,0 +1,118 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.workstation;
|
||||
in
|
||||
{
|
||||
options.workstation = {
|
||||
enable = mkEnableOption "make my computer work";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
description = "The main user of this PC";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# support gay men (and video)
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
vaapiIntel
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
];
|
||||
};
|
||||
hardware.steam-hardware.enable = true;
|
||||
hardware.uinput.enable = true;
|
||||
fonts.fontconfig.cache32Bit = true;
|
||||
|
||||
# proton esync
|
||||
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
|
||||
security.pam.loginLimits = [
|
||||
{
|
||||
domain = "*";
|
||||
type = "hard";
|
||||
item = "nofile";
|
||||
value = "1048576";
|
||||
}
|
||||
];
|
||||
|
||||
# the user should have some basic permissions lol
|
||||
users.users."${cfg.user}" = {
|
||||
extraGroups = [ "adbusers" "audio" "video" "libvirtd" "sway" "wheel" "networkmanager" "docker" "input" "uinput" ];
|
||||
|
||||
subUidRanges = [
|
||||
{
|
||||
startUid = 100000;
|
||||
count = 65536;
|
||||
}
|
||||
];
|
||||
subGidRanges = [
|
||||
{
|
||||
startGid = 100000;
|
||||
count = 65536;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# fuck alsa
|
||||
nixpkgs.config.pulseaudio = true;
|
||||
|
||||
# brightness
|
||||
programs.light.enable = true;
|
||||
|
||||
# make fonts not fucked up
|
||||
fonts.fontconfig.enable = true;
|
||||
fonts.fontconfig.dpi = lib.mkDefault 96;
|
||||
services.xserver.dpi = lib.mkDefault 96;
|
||||
|
||||
# this helps with some compatibility
|
||||
hardware.pulseaudio.daemon.config = {
|
||||
"default-sample-rate" = "48000";
|
||||
};
|
||||
|
||||
# networking.networkmanager.ethernet.macAddress = "random";
|
||||
networking.networkmanager.wifi.macAddress = lib.mkDefault "random";
|
||||
networking.networkmanager.wifi.scanRandMacAddress = lib.mkDefault true;
|
||||
|
||||
# Used for chromecast bullshit
|
||||
networking.firewall.allowedUDPPortRanges = [
|
||||
{
|
||||
from = 32768;
|
||||
to = 60999;
|
||||
}
|
||||
];
|
||||
|
||||
# Shit breaks without this lol
|
||||
services.dbus.packages = [ pkgs.gnome3.dconf ];
|
||||
|
||||
# better default swap
|
||||
boot.kernel.sysctl = { "vm.swappiness" = lib.mkDefault 45; };
|
||||
|
||||
# you probably want this system wide?
|
||||
environment.systemPackages = with pkgs; [
|
||||
exfat
|
||||
];
|
||||
|
||||
# self explanatory
|
||||
fuckingprint.enable = true;
|
||||
|
||||
# Enable sound.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = lib.mkOverride 1100 true;
|
||||
hardware.pulseaudio.support32Bit = lib.mkDefault true;
|
||||
hardware.pulseaudio.zeroconf.discovery.enable = lib.mkDefault true;
|
||||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
||||
hardware.pulseaudio.extraConfig = ''
|
||||
load-module module-dbus-protocol
|
||||
'';
|
||||
|
||||
# bluetooth
|
||||
services.blueman.enable = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.pulseaudio.extraModules = [ pkgs.pulseaudio-modules-bt ];
|
||||
hardware.bluetooth.config.General.Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
}
|
13
users/chekkie.nix
Normal file
13
users/chekkie.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
users.users.chekkie = {
|
||||
isNormalUser = true;
|
||||
useDefaultShell = true;
|
||||
home = "/home/chekkie";
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJJtUlHA/mz7BE/ePgJKM9ENc4qV9nSyefDQuVNHCf3FprhwDIp+gr8xABL/PYLg2UgADfl3L7VR/e/UG2joSN/lK0qq3O2H0LbMgfUEBOAbLGKTMOmev82ySHWxIKCFyYhS73qE+zGurc2SBe4jL9kS+zVIaZEvIpY30ZjUx6U3Edn9egqE5avloGSNufhMEJkgTXLZfSXvaKjZVUj7UVGNKERLXrvWAljnAfIL417vaQcrzlu9aiRSOlOfksACbwDP75Z/5r40w7kQjCA9Sonvhfhc6pngYGWyyhUtkbd9EeAkXeeM4D278YhWRl3dcTYIT5Y5rwVItsr+6mKBP3 chekkie@ChubbaBee"
|
||||
];
|
||||
};
|
||||
}
|
14
users/glooder.nix
Normal file
14
users/glooder.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# config for me
|
||||
users.users.glooder = {
|
||||
isNormalUser = true;
|
||||
useDefaultShell = true;
|
||||
home = "/home/glooder";
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVF3wvfIbyD4gEbHoqECkKCSHYozzfC5dsOsa0vS+xKiFt/ofPmvBiUYNPlFzH4mW8/wqtDJpzgiEIcAB/UM+LjvUW8W8emlGTJ9VZYbsEQVCOJ+u8pJ1JfXBRCzjCmwTITzgDXzuNb+x3bla+KZUk71gbrH2i8z9Ih+RzpDVAhBYPq2ixVjjFhykseaj3rzy21D0yFgsIn13Fmirurlw9fas9puzQRmFDRXlpsUOWvn9m+CtnhKNkl1hjCE1v92h+G0nGzFg9cmA9ZwXhY/6/MGWfsTeozbGyLKUesRAhVPTsdK6wEm3vk2R0Sw0iX7nlp2/76+qIcIHIOjUBjlTN glooder@subm4rine"
|
||||
];
|
||||
};
|
||||
}
|
16
users/notgne2.nix
Normal file
16
users/notgne2.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
nix.trustedUsers = [ "notgne2" ];
|
||||
|
||||
users.users.notgne2 = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.fish;
|
||||
home = "/home/notgne2";
|
||||
description = "notgne2";
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6QX3kMz1z3+QrMZQldgc2Flp+YcxDGWyGp3umdGgGhI3b91IZoOpgxrKFa/XPCa37ysrrMn2z15qR0JazghQOXAPbRbf6ZZ7H4sYDhk8D6O9/1Kcpm1UTJtcz3I3/Da9RvM9f+2biknP2lQEyZN1rW8F/olMQ0rB5QUoJBpZxGnkGH3XXdRf7DAi+kZTQyrsnoWFtJvjKe1kzmXC6xyVtwDHPgQjDA7hD5dGbceMtIge5ZW3KFoQJLO/gWsOR+NXRaBy1cmYhaCW7i7e0+409IUWR5fwWyTHTKcXSLusZcbc1JQItJVkiUcDk0slLS9RT8Leg9OpbRrqJ9oDJO+DV notgne2@peppa"
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user