Complete rewrite

This commit is contained in:
Henrik Lissner 2020-01-12 18:17:17 -05:00
parent 59def1c531
commit b90b0894f0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
87 changed files with 955 additions and 1376 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
secrets.nix
result

View file

@ -1,17 +1,4 @@
#!/usr/bin/env zsh
if [[ $OSTYPE == darwin* ]]; then
alias emacs='emacs -nw'
e() { # Emacs version of v
if pgrep Emacs 2>&1 >/dev/null; then
emacsclient -n $@
else
/Applications/Emacs.app/Contents/MacOS/Emacs $@ &
fi
}
else
alias e='emacsclient -n'
fi
alias e='emacsclient -n'
ediff() { e --eval "(ediff-files \"$1\" \"$2\")"; }

View file

@ -1,3 +0,0 @@
#!/usr/bin/env zsh
export PATH="$HOME/.emacs.d/bin:$PATH"

View file

@ -1,2 +0,0 @@
export MPD_HOME="$XDG_CONFIG_HOME/mpd"
export NCMPCPP_HOME="$XDG_CONFIG_HOME/ncmpcpp"

View file

@ -1,5 +0,0 @@
#!/usr/bin/env zsh
alias rs=rustc
alias rsp=rustup
alias ca=cargo

View file

@ -1,5 +0,0 @@
#!/usr/bin/env zsh
export CARGO_HOME="$XDG_DATA_HOME/cargo"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export PATH="$CARGO_HOME/bin:$PATH"

View file

@ -12,10 +12,10 @@ super + apostrophe
# focus/swap the node in the given direction
super + {_,ctrl +}{h,j,k,l}
~/.config/bspwm/bin/bspc-focus {_,-m }{west,south,north,east}
bspc-focus {_,-m }{west,south,north,east}
super + shift + {_,ctrl +}{h,j,k,l}
~/.config/bspwm/bin/bspc-swap {_,-m }{west,south,north,east}
bspc-swap {_,-m }{west,south,north,east}
super + {_,shift +}{1-9,0}
bspc {desktop -f,node -d} {1-9,10}
@ -30,13 +30,13 @@ super + shift + grave
emacsclient -e '(open-scratch-frame)'
super + space
~/.config/rofi/bin/rofi-appmenu
rofi-appmenu
super + Tab
~/.config/rofi/bin/rofi-windowmenu
rofi-windowmenu
super + backslash
~/.config/rofi/bin/rofi-passmenu
rofi-passmenu
super + Escape
pkill -USR1 -x sxhkd
@ -56,11 +56,14 @@ super + {_,ctrl + }f
#
## Media keys
Print # screenshot region
# screenshot region
Print
scrcap
super + Print # screencast region to mp4
# screencast region to mp4
super + Print
scrrec -s ~/recordings/$(date +%F-%T).mp4
super + ctrl + Print # screencast region to gif
# screencast region to gif
super + ctrl + Print
scrrec -s ~/recordings/$(date +%F-%T).gif
XF86MonBrightnessUp

View file

@ -1,13 +1,8 @@
export ZGEN_DIR="$XDG_CACHE_HOME/zgen"
export ZGEN_SOURCE="$ZGEN_DIR/zgen.zsh"
for dir in $XDG_CONFIG_HOME/*/bin(N); do
export PATH="$dir:$PATH"
done
for file in $XDG_CONFIG_HOME/zsh/rc.d/env.*.zsh(N); do
source $file
done
## TODO
source $ZDOTDIR/extra.zshenv
# If you have host-local configuration, this is where you'd put it
[ -f ~/.config/zsh/env ] && source ~/.config/zsh/env
[ -f ~/.zshenv ] && source ~/.zshenv

View file

@ -1,6 +1,5 @@
if [[ ! -d "$ZGEN_DIR" ]]; then
[ -d "$ZGEN_DIR" ] || \
git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
fi
source $ZGEN_SOURCE
if ! zgen saved; then
@ -12,7 +11,7 @@ if ! zgen saved; then
zgen load zsh-users/zsh-completions src
zgen load junegunn/fzf shell
if [[ -z $SSH_CONNECTION ]]; then
if [ -z "$SSH_CONNECTION" ]; then
zgen load zdharma/fast-syntax-highlighting
fi
@ -25,9 +24,6 @@ if [[ $TERM != dumb ]]; then
source $ZDOTDIR/keybinds.zsh
source $ZDOTDIR/completion.zsh
source $ZDOTDIR/aliases.zsh
for file in $XDG_CONFIG_HOME/zsh/rc.d/aliases.*.zsh(N); do
source $file
done
##
function _cache {
@ -49,16 +45,15 @@ if [[ $TERM != dumb ]]; then
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd -t d . $HOME"
fi
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
_cache direnv hook zsh
## TODO
source $ZDOTDIR/extra.zshrc
##
autoload -Uz compinit && compinit -u -d $ZSH_CACHE/zcompdump
autopair-init
# If you have host-local configuration, this is where you'd put it
[ -f ~/.config/zsh/rc ] && source ~/.config/zsh/rc
[ -f ~/.zshrc ] && source ~/.zshrc
fi

View file

@ -13,13 +13,6 @@ alias mv='mv -i'
alias mkdir='mkdir -p'
alias wget='wget -c'
alias rg='noglob rg'
alias bc='bc -lq'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
if command -v exa >/dev/null; then
alias exa='exa --group-directories-first'
alias l='exa -1'

View file

@ -1,8 +1,6 @@
# Stop TRAMP (in Emacs) from hanging or term/shell from echoing back commands
if [[ $TERM == dumb || -n $INSIDE_EMACS ]]; then
unsetopt zle
unsetopt prompt_cr
unsetopt prompt_subst
unsetopt zle prompt_cr prompt_subst
whence -w precmd >/dev/null && unfunction precmd
whence -w preexec >/dev/null && unfunction preexec
PS1='$ '

View file

@ -1,119 +0,0 @@
# Ao -- my home development server
{ config, ... }:
{
imports = [
./. # import common settings
./modules/services/ssh.nix
./modules/services/nginx.nix
./modules/services/gitea.nix
./modules/services/syncthing.nix
./modules/shell/git.nix
./modules/shell/zsh.nix
];
time.timeZone = "America/Toronto";
networking.hostName = "ao";
networking.networkmanager.enable = true;
# syncthing
services.syncthing.guiAddress = "192.168.1.10:8384";
networking.firewall.allowedTCPPorts = [ 8384 ];
# nginx hosts
services.nginx = {
user = "hlissner";
virtualHosts = {
"v0.io" = {
default = true;
enableACME = true;
forceSSL = true;
root = "/var/www/v0.io";
};
"dl.v0.io" = {
enableACME = true;
addSSL = true;
root = "/var/www/dl.v0.io";
locations."~* \.(?:ico|css|js|gif|jpe?g|png|mp4)$".extraConfig = ''
expires 30d;
add_header Pragma public;
add_header Cache-Control public;
'';
};
"git.v0.io" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = http://127.0.0.1:3000;
};
"plex.v0.io" = {
http2 = true; # more performant for streaming
enableACME = true;
forceSSL = true;
extraConfig = ''
# Some players don't reopen a socket and playback stops totally
# instead of resuming after an extended pause
send_timeout 100m;
# Intentionally not hardened for security for player support and
# encryption video streams has a lot of overhead with something like
# AES-256-GCM-SHA384.
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
# Forward real ip and host to Plex
proxy_set_header Referer $server_addr;
proxy_set_header Origin $server_addr;
# Nginx default client_max_body_size is 1MB, which breaks Camera
# Upload feature from the phones. Increasing the limit fixes the
# issue. Anyhow, if 4K videos are expected to be uploaded, the size
# might need to be increased even more
client_max_body_size 100M;
# Plex headers
proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
proxy_set_header X-Plex-Device $http_x_plex_device;
proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
proxy_set_header X-Plex-Platform $http_x_plex_platform;
proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
proxy_set_header X-Plex-Product $http_x_plex_product;
proxy_set_header X-Plex-Token $http_x_plex_token;
proxy_set_header X-Plex-Version $http_x_plex_version;
proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
proxy_set_header X-Plex-Provides $http_x_plex_provides;
proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
proxy_set_header X-Plex-Model $http_x_plex_model;
# Buffering off send to the client as soon as the data is received
# from Plex.
proxy_buffering off;
'';
locations."= /".return = "302 https://plex.v0.io/web/index.html";
locations."/" = {
proxyWebsockets = true;
proxyPass = "http://192.168.1.13:32400";
};
};
};
};
security.acme.certs = {
"v0.io".email = "henrik@lissner.net";
"dl.v0.io".email = "henrik@lissner.net";
"git.v0.io".email = "henrik@lissner.net";
"plex.v0.io".email = "henrik@lissner.net";
};
services.gitea = {
appName = "V-NOUGHT";
domain = "v0.io";
rootUrl = "https://git.v0.io/";
extraConfig = ''
[server]
SSH_DOMAIN = v0.io
'';
};
}

View file

@ -1,50 +0,0 @@
# Kuro -- my desktop
{ config, pkgs, ... }:
{
imports = [
./. # import common settings
./modules/desktop/bspwm.nix
./modules/audio/audacity.nix
./modules/audio/lmms.nix
./modules/audio/spotify.nix
./modules/browser/firefox.nix
./modules/dev
./modules/dev/rust.nix
./modules/editors/emacs.nix
./modules/editors/vim.nix
./modules/gaming/steam.nix
./modules/graphics/aseprite.nix
# ./modules/graphics/blender.nix
./modules/graphics/gimp.nix
./modules/misc/virtualbox.nix
./modules/shell/direnv.nix
./modules/shell/git.nix
./modules/shell/gnupg.nix
./modules/shell/pass.nix
./modules/shell/zsh.nix
# ./modules/video/kdenlive.nix
# ./modules/video/obs.nix
# Services
./modules/services/syncthing.nix
# Themes
./themes/aquanaut
];
networking.hostName = "kuro";
networking.networkmanager.enable = true;
time.timeZone = "America/Toronto";
services.xserver.videoDrivers = [ "nvidia" ];
# For ergodox ez
environment = {
systemPackages = [ pkgs.teensy-loader-cli ];
shellAliases.teensyload = "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
};
}

View file

@ -1,62 +0,0 @@
# Shiro -- my laptop
{ config, lib, pkgs, ... }:
let nixos-hardware = builtins.fetchTarball https://github.com/NixOS/nixos-hardware/archive/master.tar.gz;
in {
imports = [
./. # import common settings
# Hardware specific
"${nixos-hardware}/dell/xps/13-9370"
./modules/desktop/bspwm.nix
./modules/audio/spotify.nix
./modules/browser/firefox.nix
./modules/dev
./modules/graphics/aseprite.nix
./modules/graphics/gimp.nix
./modules/editors/emacs.nix
./modules/editors/vim.nix
./modules/shell/direnv.nix
./modules/shell/git.nix
./modules/shell/gnupg.nix
./modules/shell/pass.nix
./modules/shell/zsh.nix
# ./modules/video/obs.nix
#
./modules/services/syncthing.nix
# Themes
./themes/aquanaut
];
time.timeZone = "America/Toronto";
# time.timeZone = "Europe/Copenhagen";
networking.hostName = "shiro";
networking.wireless.enable = true;
# Optimize power use
environment.systemPackages = [ pkgs.acpi ];
services.tlp.enable = true;
powerManagement = {
powertop.enable = true;
cpuFreqGovernor = "ondemand";
};
# Monitor backlight control
programs.light.enable = true;
# Encrypted /home
boot.initrd.luks.devices = [
{
name = "home";
device = "/dev/nvme0n1p8";
preLVM = true;
allowDiscards = true;
}
];
}

View file

@ -1,26 +1,31 @@
# Common configuration across systems. This should be required by
# configuration.$HOSTNAME.nix files.
{ pkgs, options, config, ... }:
# ...
device:
{ pkgs, options, lib, config, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
./settings.nix
/etc/nixos/hardware-configuration.nix
./options/my.nix
./options/secrets.nix
./secrets.nix
"${./machines}/${device}.nix"
];
###
nix = {
nixPath = options.nix.nixPath.default ++ [
"config=/etc/dotfiles/config"
"packages=/etc/dotfiles/packages"
"my=/etc/dotfiles"
];
autoOptimiseStore = true;
trustedUsers = [ "root" "@wheel" ];
trustedUsers = [ "root" ];
};
nixpkgs.config = {
# Forgive me Stallman senpai
allowUnfree = true;
nixpkgs.config = {
allowUnfree = true; # forgive me Stallman senpai
# Occasionally, "stable" packages are broken or incomplete, so access to the
# bleeding edge is necessary, as a last resort.
packageOverrides = pkgs: {
unstable = import <nixpkgs-unstable> {
config = config.nixpkgs.config;
@ -28,61 +33,6 @@
};
};
# Nothing in /tmp should survive a reboot
boot.cleanTmpDir = true;
# Use simple bootloader; I prefer the on-demand BIOs boot menu
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
environment = {
systemPackages = with pkgs; [
# Just the bear necessities~
libqalculate
coreutils
git
killall
unzip
vim
wget
# Support for extra filesystems
sshfs
exfat
ntfs3g
hfsprogs
];
# These are the defaults, but some applications are buggy when these lack
# explicit values.
variables = {
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_BIN_HOME = "$HOME/.local/bin";
};
};
location = (if config.time.timeZone == "America/Toronto" then {
latitude = 43.70011;
longitude = -79.4163;
} else if config.time.timeZone == "Europe/Copenhagen" then {
latitude = 55.88;
longitude = 12.5;
} else {});
# Set up hlissner user account
users.users.hlissner = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" "video" "networkmanager" "vboxusers" ];
shell = pkgs.zsh;
};
home = {
xdg.enable = true;
home.file."bin" = { source = ./bin; recursive = true; };
};
networking.firewall.enable = true;
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you

View file

@ -2,18 +2,18 @@
# access to my work files from anywhere.
{ config, ... }:
{
imports = [
./. # import common settings
./modules/services/ssh.nix
./modules/services/plex.nix
./modules/shell/zsh.nix
<my/modules/services/ssh.nix>
# ./modules/services/plex.nix
<my/modules/services/jellyfin.nix>
<my/modules/shell/zsh.nix>
];
time.timeZone = "America/Toronto";
networking.hostName = "aka";
networking.networkmanager.enable = true;
time.timeZone = "America/Toronto";
}

158
machines/ao.nix Normal file
View file

@ -0,0 +1,158 @@
# Ao -- my home development server
{ config, ... }:
{
imports = [
./. # import common settings
<my/modules/services/ssh.nix>
<my/modules/services/nginx.nix>
<my/modules/services/gitea.nix>
<my/modules/services/syncthing.nix>
<my/modules/shell/git.nix>
<my/modules/shell/zsh.nix>
];
networking.hostName = "ao";
networking.networkmanager.enable = true;
time.timeZone = "America/Toronto";
# syncthing
services.syncthing.guiAddress = "192.168.1.10:8384";
networking.firewall.allowedTCPPorts = [ 8384 ];
# nginx hosts
services.nginx = {
user = config.my.username;
virtualHosts = {
"v0.io" = {
default = true;
enableACME = true;
forceSSL = true;
root = "/var/www/v0.io";
};
"dl.v0.io" = {
enableACME = true;
addSSL = true;
root = "/var/www/dl.v0.io";
locations."~* \.(?:ico|css|js|gif|jpe?g|png|mp4)$".extraConfig = ''
expires 30d;
add_header Pragma public;
add_header Cache-Control public;
'';
};
"git.v0.io" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = http://127.0.0.1:3000;
};
"tv.v0.io" = {
http2 = true; # more performant for streaming
enableACME = true;
forceSSL = true;
extraConfig = ''
add_header Content-Security-Policy "default-src https: data: blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com/cv/js/sender/v1/cast_sender.js; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'";
# Some players don't reopen a socket and playback stops totally
# instead of resuming after an extended pause
send_timeout 100m;
# Intentionally not hardened for security for player support and
# encryption video streams has a lot of overhead with something like
# AES-256-GCM-SHA384.
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_stapling on;
ssl_stapling_verify on;
# Forward real ip and host to Plex
proxy_set_header Referer $server_addr;
proxy_set_header Origin $server_addr;
# Security / XSS Mitigation Headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
'';
# locations."= /".return = "302 https://tv.v0.io/web/index.html";
locations."/socket" = {
proxyPass = "http://192.168.1.13:8096";
proxyHttpVersion = "1.1";
# Buffering off send to the client as soon as the data is received
# from JellyFin.
proxyBuffering = "off";
};
locations."/" = {
proxyWebsockets = true;
proxyPass = "http://192.168.1.13:8096";
};
};
# "plex.v0.io" = {
# http2 = true; # more performant for streaming
# enableACME = true;
# forceSSL = true;
# extraConfig = ''
# # Some players don't reopen a socket and playback stops totally
# # instead of resuming after an extended pause
# send_timeout 100m;
# # Intentionally not hardened for security for player support and
# # encryption video streams has a lot of overhead with something like
# # AES-256-GCM-SHA384.
# ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
# # Forward real ip and host to Plex
# proxy_set_header Referer $server_addr;
# proxy_set_header Origin $server_addr;
# # Nginx default client_max_body_size is 1MB, which breaks Camera
# # Upload feature from the phones. Increasing the limit fixes the
# # issue. Anyhow, if 4K videos are expected to be uploaded, the size
# # might need to be increased even more
# client_max_body_size 100M;
# # Plex headers
# proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
# proxy_set_header X-Plex-Device $http_x_plex_device;
# proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
# proxy_set_header X-Plex-Platform $http_x_plex_platform;
# proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
# proxy_set_header X-Plex-Product $http_x_plex_product;
# proxy_set_header X-Plex-Token $http_x_plex_token;
# proxy_set_header X-Plex-Version $http_x_plex_version;
# proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
# proxy_set_header X-Plex-Provides $http_x_plex_provides;
# proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
# proxy_set_header X-Plex-Model $http_x_plex_model;
# # Buffering off send to the client as soon as the data is received
# # from Plex.
# proxy_buffering off;
# '';
# locations."= /".return = "302 https://plex.v0.io/web/index.html";
# locations."/" = {
# proxyWebsockets = true;
# proxyPass = "http://192.168.1.13:32400";
# };
# };
};
};
security.acme.certs = {
"v0.io".email = "henrik@lissner.net";
"dl.v0.io".email = "henrik@lissner.net";
"git.v0.io".email = "henrik@lissner.net";
"plex.v0.io".email = "henrik@lissner.net";
};
services.gitea = {
appName = "V-NOUGHT";
domain = "v0.io";
rootUrl = "https://git.v0.io/";
extraConfig = ''
[server]
SSH_DOMAIN = v0.io
'';
};
}

57
machines/default.nix Normal file
View file

@ -0,0 +1,57 @@
# ...
{ config, lib, pkgs, ... }:
{
# Nothing in /tmp should survive a reboot
boot.cleanTmpDir = true;
# Use simple bootloader; I prefer the on-demand BIOs boot menu
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Just the bear necessities~
environment.systemPackages = with pkgs; [
coreutils
git
killall
unzip
vim
wget
# Support for extra filesystems
sshfs
exfat
ntfs3g
hfsprogs
# cached-nix-shell, for instant nix-shell scripts
(callPackage
(builtins.fetchTarball
https://github.com/xzfc/cached-nix-shell/archive/master.tar.gz) {})
];
###
# My user settings
my = {
username = "hlissner";
env.PATH = [ <my/bin> ];
user = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" "video" "networkmanager" ];
shell = pkgs.zsh;
};
};
# Obey XDG conventions; a tidy $HOME is a tidy mind.
my.home.xdg.enable = true;
environment.variables = {
# These are the defaults, but some applications are buggy when these lack
# explicit values.
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_BIN_HOME = "$HOME/.local/bin";
};
nix.trustedUsers = [ config.my.username ];
### Universal defaults
networking.firewall.enable = true;
}

54
machines/kuro.nix Normal file
View file

@ -0,0 +1,54 @@
# Kuro -- my desktop
{ config, lib, utils, pkgs, ... }:
{
imports = [
./. # import common settings
<my/modules/desktop/bspwm.nix>
<my/modules/chat.nix> # discord, mainly
<my/modules/recording.nix> # recording video & audio
<my/modules/daw.nix> # making music
<my/modules/music.nix> # playing music
<my/modules/graphics.nix> # art & design
<my/modules/vm.nix> # virtualbox for testing
<my/modules/browser/firefox.nix>
<my/modules/dev/cpp.nix>
<my/modules/dev/rust.nix>
<my/modules/editors/emacs.nix>
<my/modules/editors/vim.nix>
<my/modules/gaming/steam.nix>
<my/modules/shell/direnv.nix>
<my/modules/shell/git.nix>
<my/modules/shell/gnupg.nix>
<my/modules/shell/pass.nix>
<my/modules/shell/zsh.nix>
# Services
<my/modules/services/syncthing.nix>
# Themes
<my/modules/themes/aquanaut>
];
networking.hostName = "kuro";
networking.networkmanager.enable = true;
time.timeZone = "America/Toronto";
## Hardware
# GPU
services.xserver.videoDrivers = [ "nvidia" ];
# For ergodox ez
my.packages = [ pkgs.teensy-loader-cli ];
my.alias.teensyload = "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
# For my intuos4 pro. My cintiq doesn't work on Linux though :(
services.xserver.wacom.enable = true;
my.init = ''
# lock tablet to main display
xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen eraser") DVI-I-1
xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen cursor") DVI-I-1
xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen stylus") DVI-I-1
'';
}

60
machines/shiro.nix Normal file
View file

@ -0,0 +1,60 @@
# Shiro -- my laptop
{ config, lib, pkgs, ... }:
let nixos-hardware = builtins.fetchTarball https://github.com/NixOS/nixos-hardware/archive/master.tar.gz;
in {
imports = [
./. # import common settings
# Hardware specific
"${nixos-hardware}/dell/xps/13-9370"
<my/modules/desktop/bspwm.nix>
<my/modules/chat.nix> # discord, mainly
<my/modules/recording.nix> # recording video & audio
<my/modules/daw.nix> # making music
<my/modules/music.nix> # playing music
<my/modules/graphics.nix> # art & design
# <my/modules/vm.nix> # virtualbox for testing
<my/modules/browser/firefox.nix>
<my/modules/dev>
<my/modules/editors/emacs.nix>
<my/modules/editors/vim.nix>
<my/modules/shell/direnv.nix>
<my/modules/shell/git.nix>
<my/modules/shell/gnupg.nix>
<my/modules/shell/pass.nix>
<my/modules/shell/zsh.nix>
# Services
<my/modules/services/syncthing.nix>
# Themes
<modules/themes/aquanaut>
];
theme.wallpaper = <my/assets/wallpapers/aquanaut.2560x1440.jpg>;
networking.hostName = "shiro";
networking.wireless.enable = true;
time.timeZone = "America/Toronto";
# time.timeZone = "Europe/Copenhagen";
# Optimize power use
environment.systemPackages = [ pkgs.acpi ];
powerManagement.powertop.enable = true;
# Monitor backlight control
programs.light.enable = true;
# Encrypted /home
boot.initrd.luks.devices = [
{
name = "home";
device = "/dev/nvme0n1p8";
preLVM = true;
allowDiscards = true;
}
];
}

View file

@ -1,25 +1,21 @@
{ config, lib, pkgs, ... }:
{
environment = {
systemPackages = with pkgs; [
firefox-bin
(pkgs.writeScriptBin "firefox-private" ''
#! ${pkgs.bash}/bin/bash
firefox --private-window "$@"
'')
(makeDesktopItem {
name = "firefox-private";
desktopName = "Firefox (Private)";
genericName = "Open a private Firefox window";
icon = "firefox";
exec = "${firefox-bin}/bin/firefox --private-window";
categories = "Network";
})
];
variables = {
BROWSER = "firefox";
XDG_DESKTOP_DIR = "$HOME"; # prevent firefox creating ~/Desktop
};
};
my.packages = with pkgs; [
firefox-bin (pkgs.writeScriptBin "firefox-private" ''
#! ${pkgs.bash}/bin/bash
firefox --private-window "$@"
'')
(makeDesktopItem {
name = "firefox-private";
desktopName = "Firefox (Private)";
genericName = "Open a private Firefox window";
icon = "firefox";
exec = "${firefox-bin}/bin/firefox --private-window";
categories = "Network";
})
];
my.env.BROWSER = "firefox";
my.env.XDG_DESKTOP_DIR = "$HOME"; # prevent firefox creating ~/Desktop
}

View file

@ -1,19 +1,14 @@
{ config, lib, pkgs, ... }:
{
environment = {
systemPackages = with pkgs; [
qutebrowser
];
variables.BROWSER = "qutebrowser";
};
home.xdg = {
my.packages = [ pkgs.qutebrowser ];
my.env.BROWSER = "qutebrowser";
my.home.xdg = {
configFile."qutebrowser" = {
source = <config/qutebrowser>;
source = <my/config/qutebrowser>;
recursive = true;
};
dataFile."qutebrowser/greasemonkey" = {
source = <config/qutebrowser/greasemonkey>;
source = <my/config/qutebrowser/greasemonkey>;
recursive = true;
};
};

10
modules/chat.nix Normal file
View file

@ -0,0 +1,10 @@
# Even neckbeards have a social life. Not that I have one. A neckbeard, I mean.
# But when I do have either, then discord and weechat (or Emacs) are my go-to.
{ config, lib, pkgs, ... }:
{
my.packages = with pkgs; [
# weechat # TODO For the real neckbeards
discord # For everyone else
];
}

View file

@ -5,7 +5,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
my.packages = with pkgs; [
audacity # for recording and remastering audio
# lmms # for making music
sunvox # for making music (where LMMS is overkill)
@ -13,6 +13,6 @@
# Build our own LMMS because the built-in nixpkg is broken, due to a 'Could
# not find the Qt platform plugin "xcb" in ""' error on startup:
# https://github.com/NixOS/nixpkgs/issues/76074
(callPackage <packages/lmms.nix> {})
(callPackage <my/packages/lmms.nix> {})
];
}

View file

@ -12,68 +12,62 @@
./thunar.nix
];
environment = {
systemPackages = with pkgs; [
lightdm
bspwm
dunst
libnotify
(polybar.override {
pulseSupport = true;
nlSupport = true;
})
environment.systemPackages = with pkgs; [
lightdm
bspwm
dunst
libnotify
(polybar.override {
pulseSupport = true;
nlSupport = true;
})
xst # st + nice-to-have extensions
(makeDesktopItem {
name = "xst";
desktopName = "Suckless Terminal";
genericName = "Default terminal";
icon = "utilities-terminal";
exec = "${xst}/bin/xst";
categories = "Development;System;Utility";
})
xst # st + nice-to-have extensions
(makeDesktopItem {
name = "xst";
desktopName = "Suckless Terminal";
genericName = "Default terminal";
icon = "utilities-terminal";
exec = "${xst}/bin/xst";
categories = "Development;System;Utility";
})
(writeScriptBin "st-scratch" ''
#!${stdenv.shell}
SCRID=st-scratch
focused=$(xdotool getactivewindow)
scratch=$(xdotool search --onlyvisible --classname $SCRID)
if [[ -n $scratch ]]; then
if [[ $focused == $scratch ]]; then
xdotool windowkill $scratch
else
xdotool windowactivate $scratch
fi
(writeScriptBin "st-scratch" ''
#!${stdenv.shell}
SCRID=st-scratch
focused=$(xdotool getactivewindow)
scratch=$(xdotool search --onlyvisible --classname $SCRID)
if [[ -n $scratch ]]; then
if [[ $focused == $scratch ]]; then
xdotool windowkill $scratch
else
xst -t $SCRID -n $SCRID -c $SCRID \
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
-g 100x26 \
-e $SHELL
xdotool windowactivate $scratch
fi
'')
(writeScriptBin "st-calc" ''
#!${stdenv.shell}
SCRID=st-calc
scratch=$(xdotool search --onlyvisible --classname $SCRID)
[ -n "$scratch" ] && xdotool windowkill $scratch
else
xst -t $SCRID -n $SCRID -c $SCRID \
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
-g 80x12 \
-e $SHELL -c qalc
'')
(makeDesktopItem {
name = "st-calc";
desktopName = "Calculator";
icon = "calc";
exec = "st-calc";
categories = "Development";
})
];
};
fonts.fonts = [ pkgs.siji ];
programs.zsh.interactiveShellInit = "export TERM=xterm-256color";
-g 100x26 \
-e $SHELL
fi
'')
(writeScriptBin "st-calc" ''
#!${stdenv.shell}
SCRID=st-calc
scratch=$(xdotool search --onlyvisible --classname $SCRID)
[ -n "$scratch" ] && xdotool windowkill $scratch
xst -t $SCRID -n $SCRID -c $SCRID \
-f "$(xrdb -query | grep 'st-scratch\.font' | cut -f2)" \
-g 80x12 \
-e $SHELL -c qalc
'')
(makeDesktopItem {
name = "st-calc";
desktopName = "Calculator";
icon = "calc";
exec = "st-calc";
categories = "Development";
})
];
services = {
xserver = {
@ -83,7 +77,7 @@
enable = true;
greeters.mini = {
enable = true;
user = "hlissner";
user = config.my.username;
};
};
};
@ -92,13 +86,34 @@
enable = true;
backend = "glx";
vSync = true;
opacityRules = [
"100:class_g = 'Firefox'"
"100:class_g = 'VirtualBox Machine'"
# Art/image programs where we need fidelity
"100:class_g = 'Gimp'"
"100:class_g = 'Inkscape'"
"100:class_g = 'aseprite'"
"100:class_g = 'krita'"
"100:class_g = 'feh'"
"100:class_g = 'mpv'"
];
settings.blur-background-exclude = [
"window_type = 'dock'"
"window_type = 'desktop'"
"_GTK_FRAME_EXTENTS@:c"
];
};
};
home.xdg.configFile = {
"sxhkd".source = <config/sxhkd>;
# For polybar
fonts.fonts = [ pkgs.siji ];
# link recursively so other modules can link files in their folders
"bspwm" = { source = <config/bspwm>; recursive = true; };
my = {
env.PATH = [ <my/config/bspwm/bin> ];
home.xdg.configFile = {
"sxhkd".source = <my/config/sxhkd>;
# link recursively so other modules can link files in their folders
"bspwm" = { source = <my/config/bspwm>; recursive = true; };
};
};
}

View file

@ -1,15 +1,12 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
redshift
my.packages = with pkgs; [
libqalculate
xclip
xdotool
ffmpeg
mpv # video player
feh # image viewer
maim
slop
# Useful apps
evince # pdf reader
@ -23,6 +20,15 @@
redshift.enable = true;
};
# For redshift
location = (if config.time.timeZone == "America/Toronto" then {
latitude = 43.70011;
longitude = -79.4163;
} else if config.time.timeZone == "Europe/Copenhagen" then {
latitude = 55.88;
longitude = 12.5;
} else {});
fonts = {
enableFontDir = true;
enableGhostscriptFonts = true;

View file

@ -1,32 +1,38 @@
{ config, lib, pkgs, ... }:
{
environment = {
systemPackages = with pkgs; [
my = {
env.PATH = [ <my/config/rofi/bin> ];
# link recursively so other modules can link files in its folder
home.xdg.configFile."rofi" = {
source = <my/config/rofi>;
recursive = true;
};
packages = with pkgs; [
(writeScriptBin "rofi" ''
#!${stdenv.shell}
exec ${rofi}/bin/rofi -terminal xst -m -1 "$@"
'')
rofi
# Fake rofi dmenu entries
(makeDesktopItem {
name = "rofi-browsermenu";
desktopName = "Open Bookmark in Firefox";
icon = "bookmark-new-symbolic";
exec = "${<config/rofi>}/bin/rofi-browsermenu";
exec = "${<my/config/rofi>}/bin/rofi-browsermenu";
})
(makeDesktopItem {
name = "rofi-filemenu";
desktopName = "Open Directory in Terminal";
icon = "folder";
exec = "${<config/rofi>}/bin/rofi-filemenu";
exec = "${<my/config/rofi>}/bin/rofi-filemenu";
})
(makeDesktopItem {
name = "rofi-filemenu-scratch";
desktopName = "Open Directory in Scratch Terminal";
icon = "folder";
exec = "${<config/rofi>}/bin/rofi-filemenu -x";
exec = "${<my/config/rofi>}/bin/rofi-filemenu -x";
})
(makeDesktopItem {
@ -49,12 +55,4 @@
})
];
};
home.xdg.configFile = {
# link recursively so other modules can link files in its folder
"rofi" = {
source = <config/rofi>;
recursive = true;
};
};
}

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
my.packages = with pkgs; [
xfce.thunar
xfce.tumbler # for thumbnails
];

View file

@ -3,9 +3,10 @@
{
imports = [ ./. ];
environment.systemPackages = with pkgs; [
my.packages = with pkgs; [
clang
gcc
cmake
llvmPackages.libcxx
];
}

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
my.packages = with pkgs; [
gnumake
];
}

View file

@ -1,12 +1,10 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
rustup
];
home.xdg.configFile = {
"zsh/rc.d/aliases.rust.zsh".source = <config/rust/aliases.zsh>;
"zsh/rc.d/env.rust.zsh".source = <config/rust/env.zsh>;
my = {
packages = with pkgs; [ rustup ];
env.CARGO_HOME = "$XDG_DATA_HOME/cargo";
env.RUSTUP_HOME = "$XDG_DATA_HOME/rustup";
env.PATH = [ "$CARGO_HOME/bin" ];
};
}

View file

@ -1,3 +1,6 @@
# I don't often use unity except for team projects. On my own, I prefer rolling
# my own (or godot).
{ config, lib, pkgs, ... }:
{

View file

@ -1,37 +1,37 @@
# Emacs is my main driver. I'm the author of Doom Emacs
# <https://github.com/hlissner/doom-emacs>. This module sets it up to meed my
# https://github.com/hlissner/doom-emacs. This module sets it up to meet my
# particular Doomy needs.
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Doom dependencies
emacs
git
(ripgrep.override {withPCRE2 = true;})
# Optional dependencies
editorconfig-core-c # per-project style config
fd # faster projectile indexing
imagemagick # for image-dired
gnutls # for TLS connectivity
(lib.mkIf (config.programs.gnupg.agent.enable)
pinentry_emacs) # in-emacs gnupg prompts
zstd # for undo-tree compression
ffmpeg # for screen recording emacs
# Module dependencies
sqlite # :tools (lookup +docsets)
texlive.combined.scheme-medium # :lang org -- for latex previews
ccls # :lang (cc +lsp)
nodePackages.javascript-typescript-langserver # :lang (javascript +lsp)
rls # :lang (rust +lsp)
];
my = {
packages = with pkgs; [
# Doom dependencies
emacs
git
(ripgrep.override {withPCRE2 = true;})
# Optional dependencies
editorconfig-core-c # per-project style config
fd # faster projectile indexing
imagemagick # for image-dired
gnutls # for TLS connectivity
(lib.mkIf (config.programs.gnupg.agent.enable)
pinentry_emacs) # in-emacs gnupg prompts
zstd # for undo-tree compression
ffmpeg # for screen recording emacs
# Module dependencies
sqlite # :tools (lookup +docsets)
texlive.combined.scheme-medium # :lang org -- for latex previews
ccls # :lang (cc +lsp)
nodePackages.javascript-typescript-langserver # :lang (javascript +lsp)
rls
];
env.PATH = [ "$HOME/.emacs.d/bin" ];
zsh.rc = lib.readFile <my/config/emacs/aliases.zsh>;
};
fonts.fonts = [
pkgs.emacs-all-the-icons-fonts
];
home.xdg.configFile = {
"zsh/rc.d/aliases.emacs.zsh".source = <config/emacs/aliases.zsh>;
"zsh/rc.d/env.emacs.zsh".source = <config/emacs/env.zsh>;
};
}

View file

@ -1,15 +1,14 @@
# When I'm stuck in the terminal or don't have access to Emacs, (neo)vim is my
# go-to. I am a vimmer at heart, after all.
{ config, lib, pkgs, ... }:
{
environment = {
sessionVariables = {
EDITOR = "nvim";
VIMINIT = "let \\$MYVIMRC='\\$XDG_CONFIG_HOME/nvim/init.vim' | source \\$MYVIMRC";
};
systemPackages = with pkgs; [
my = {
packages = with pkgs; [
editorconfig-core-c
neovim
];
env.EDITOR = "nvim";
env.VIMINIT = "let \\$MYVIMRC='\\$XDG_CONFIG_HOME/nvim/init.vim' | source \\$MYVIMRC";
};
}

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
my.packages = with pkgs; [
steam
steam-run-native # for GOG or humblebundle games
];

22
modules/graphics.nix Normal file
View file

@ -0,0 +1,22 @@
# It's difficult to be an artist/designer on Linux. I miss adobe and my tablets
# don't work without a lot of heart-ache. I set up a second computer just for
# adobe work (and gaming) to address this, so why do I install these programs on
# linux? Because sometimes I need to do some quick work right there and then.
{ config, lib, pkgs, ... }:
{
my.packages = with pkgs; [
font-manager # so many damned fonts...
imagemagick # for image manipulation from the shell
aseprite-unfree # pixel art
inkscape # illustrator & indesign
krita # replaces photoshop
gimp # replaces photoshop
gimpPlugins.resynthesizer2 # content-aware scaling in gimp
];
my.home.xdg.configFile = {
"GIMP/2.10" = { source = <my/config/gimp>; recursive = true; };
};
}

View file

@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = [
pkgs.aseprite-unfree
];
}

View file

@ -1,7 +0,0 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
blender
];
}

View file

@ -1,12 +0,0 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gimp
gimpPlugins.resynthesizer2
];
home-manager.users.hlissner.xdg.configFile = {
"GIMP/2.10" = { source = <config/gimp>; recursive = true; };
};
}

39
modules/music.nix Normal file
View file

@ -0,0 +1,39 @@
# I use spotify for my music needs. Gone are the days where I'd manage 200gb+ of
# local music; most of which I haven't heard or don't even like.
{ config, lib, pkgs, ... }:
{
# services.spotifyd doesn't work so we'll have to roll our own spotifyd +
# spotify-tui solution. The dbus interface doesn't work, though, so we have to
# wait for spotify-tui to implement CLI command for controlling spotify
# playback. See https://github.com/Rigellute/spotify-tui/issues/147 or for
# spotifyd to get fixed.
my.packages = with pkgs; [
unstable.spotifyd
(writeScriptBin "spt" ''
#!${stdenv.shell}
if ! systemctl --user is-active spotifyd >/dev/null; then
systemctl --user start spotifyd
fi
${unstable.spotify-tui}/bin/spt
'')
# spotify-tui is fine for selecting and playing music, but incomplete. We
# occasionally still need the official client for more sophisticated search
# and the "made for you" playlists.
spotify
];
systemd.user.services.spotifyd.serviceConfig =
let spotifydConf = pkgs.writeText "spotifyd.conf" ''
[global]
username = g2qwjcs6334oacg1zg9wrihnn
password_cmd = ${pkgs.pass}/bin/pass www/spotify.com | head -n1
backend = pulseaudio
'';
in {
ExecStart = "${pkgs.unstable.spotifyd}/bin/spotifyd --no-daemon --cache-path /tmp/spotifyd --config-path ${spotifydConf}";
Restart = "always";
RestartSec = 6;
};
}

View file

@ -9,9 +9,7 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
slop # for selecting arbitrary regions on screen
ffmpeg # for recording gifs/mp4s quickly
my.packages = with pkgs; [
audacity # for recording and remastering audio
obs-studio # for streaming to twitch/recording for youtube
handbrake # for encoding footage

View file

@ -4,7 +4,7 @@
services.syncthing = {
enable = true;
openDefaultPorts = true;
user = "hlissner";
user = config.my.username;
configDir = "/home/hlissner/.config/syncthing";
dataDir = "/home/hlissner/sync";
};

View file

@ -1,8 +1,10 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
direnv
(import <nixpkgs-unstable> {}).lorri
];
services.lorri.enable = true;
my = {
packages = [ pkgs.direnv ];
zsh.rc = "_cache direnv hook zsh";
};
}

View file

@ -1,14 +1,16 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
gitAndTools.hub
gitAndTools.diff-so-fancy
];
home.xdg.configFile = {
"git/config".source = <config/git/config>;
"git/ignore".source = <config/git/ignore>;
"zsh/rc.d/aliases.git.zsh".source = <config/git/aliases.zsh>;
my = {
packages = with pkgs; [
gitAndTools.hub
gitAndTools.diff-so-fancy
];
zsh.rc = lib.readFile <my/config/git/aliases.zsh>;
# Do recursively, in case git stores files in this folder
home.xdg.configFile = {
"git/config".source = <my/config/git/config>;
"git/ignore".source = <my/config/git/ignore>;
};
};
}

View file

@ -1,16 +1,13 @@
{ config, lib, pkgs, ... }:
{
environment = {
extraInit = ''
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
mkdir -p "$GNUPGHOME" -m 700
'';
systemPackages = with pkgs; [
my = {
packages = with pkgs; [
gnupg
pinentry
];
env.GNUPGHOME = "$XDG_CONFIG_HOME/gnupg";
init = "mkdir -p \"$GNUPGHOME\" -m 700";
};
programs.gnupg.agent = {
@ -23,7 +20,7 @@
${pkgs.gnupg}/bin/gpg-agent \
--supervised \
--allow-emacs-pinentry \
--default-cache-ttl 1200 \
--default-cache-ttl 1800 \
--pinentry-program ${pkgs.pinentry}/bin/pinentry-gtk-2
''
];

View file

@ -1,14 +1,19 @@
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
my.packages = with pkgs; [
(ncmpcpp.override { visualizerSupport = true; })
];
home.xdg.configFile = {
"zsh/rc.d/aliases.ncmpcpp.zsh".source = <config/ncmpcpp/aliases.zsh>;
"zsh/rc.d/env.ncmpcpp.zsh".source = <config/ncmpcpp/env.zsh>;
"ncmpcpp/config".source = <config/ncmpcpp/config>;
"ncmpcpp/bindings".source = <config/ncmpcpp/bindings>;
my.env.MPD_HOME = "$XDG_CONFIG_HOME/mpd";
my.env.NCMPCPP_HOME = "$XDG_CONFIG_HOME/ncmpcpp";
my.alias.rate = "mpd-rate";
my.alias.mpcs = "mpc search any";
my.alias.mpcsp = "mpc searchplay any";
my.home.xdg.configFile = {
"ncmpcpp/config".source = <my/config/ncmpcpp/config>;
"ncmpcpp/bindings".source = <my/config/ncmpcpp/bindings>;
};
}

View file

@ -1,14 +1,13 @@
{ config, pkgs, lib, ... }:
{
environment = {
systemPackages = with pkgs; [
my = {
packages = with pkgs; [
(pass.withExtensions (exts: [
exts.pass-otp
exts.pass-genphrase
]))
];
variables.PASSWORD_STORE_DIR = "$HOME/.secrets/password-store";
env.PASSWORD_STORE_DIR = "$HOME/.secrets/password-store";
};
}

View file

@ -1,24 +1,23 @@
{ config, pkgs, libs, ... }:
{
environment = {
systemPackages = with pkgs; [
my = {
packages = with pkgs; [
zsh
nix-zsh-completions
fasd
bat
exa
fasd
fd
fzf
tmux
htop
tree
tldr
tree
];
variables = {
ZDOTDIR = "$XDG_CONFIG_HOME/zsh";
ZSH_CACHE = "$XDG_CACHE_HOME/zsh";
};
env.ZDOTDIR = "$XDG_CONFIG_HOME/zsh";
env.ZSH_CACHE = "$XDG_CACHE_HOME/zsh";
home.xdg.configFile."zsh" = { source = <my/config/zsh>; recursive = true; };
};
programs.zsh = {
@ -27,13 +26,4 @@
enableGlobalCompInit = false; # I'll do it myself
promptInit = "";
};
home.xdg.configFile = {
# link recursively so other modules can link files in this folder,
# particularly in zsh/rc.d/*.zsh
"zsh" = {
source = <config/zsh>;
recursive = true;
};
};
}

View file

@ -0,0 +1,82 @@
# We trained for this. The waves shudder and glare at me through its bright
# tapestry. The clouds see me off as gravity lures me in lazily. How long have I
# been down here? I imagined Jenny leading the team back on a rescue mission and
# it upsets me. It was not worth the risk. We knew what we signed up for.
#
# I hear glass crack. The sea depths hold my waist in a vice. Its strength
# squeezing between the kelvar pockets of my suit. It's hard to breathe. If I
# cut off the oxygen supply perhaps it'd be a nicer way to go.
#
# When did I get so creative?
#
# I can't see further than three feet. Snowflake fractures creep along my visor.
# Would Jorgen be relieved to have a dorm bunk to himself? HQ packs us into our
# subs like sardines. I'll miss his snoring. Maybe I'll catch up on all that
# missed sleep.
{ config, pkgs, ... }:
{
imports = [ ../. ]; # Load framework for themes
theme.wallpaper = ./wallpaper.jpg;
services.compton = {
activeOpacity = "0.96";
inactiveOpacity = "0.75";
settings = {
blur-background = true;
blur-background-frame = true;
blur-background-fixed = true;
blur-kern = "7x7box";
blur-strength = 340;
};
};
services.xserver.displayManager.lightdm = {
greeters.mini.extraConfig = ''
text-color = "#bbc2cf"
password-background-color = "#29323d"
window-color = "#0b1117"
border-color = "#0b1117"
'';
};
fonts.fonts = [ pkgs.nerdfonts ];
my.packages = with pkgs; [
nordic
paper-icon-theme # for rofi
];
my.home.xdg.configFile = {
"bspwm/rc.d/polybar".source = ./polybar/run.sh;
"bspwm/rc.d/theme".source = ./bspwmrc;
"dunst/dunstrc".source = ./dunstrc;
"polybar" = { source = ./polybar; recursive = true; };
"rofi/theme".source = ./rofi;
"tmux/theme".source = ./tmux.conf;
"xtheme/90-theme".source = ./Xresources;
"zsh/prompt.zsh".source = ./zsh/prompt.zsh;
# GTK
"gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Nordic-blue
gtk-icon-theme-name=Paper
gtk-fallback-icon-theme=gnome
gtk-application-prefer-dark-theme=true
gtk-cursor-theme-name=Paper
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-xft-rgba=none
'';
# GTK2 global theme (widget and icon theme)
"gtk-2.0/gtkrc".text = ''
gtk-theme-name="Nordic-blue"
gtk-icon-theme-name="Paper-Mono-Dark"
gtk-font-name="Sans 10"
'';
# QT4/5 global theme
"Trolltech.conf".text = ''
[Qt]
style=Nordic-blue
'';
};
}

View file

@ -0,0 +1,3 @@
/* -*- mode: css; -*- */
@import "appmenu.rasi"

View file

@ -0,0 +1,28 @@
/** -*- mode: css; -*-
* This theme is intended for a 5 items wide menu on a 1920x1080 pixels resolution.
* You may have to tweak values such as the window padding if you have a different resolution.
*/
@import "appmenu.rasi"
#element {
padding: 30px;
background-color: @background-light;
}
#element.selected {
background-color: @accent;
text-color: @background;
}
#window {
/* padding: @option-5-window-padding; */
}
#listview {
/* spacing: @option-5-listview-spacing; */
/* lines: 5; */
columns: 1;
}
#window {
children: [ horibox ];
}
#horibox {
children: [ listview ];
}

View file

@ -0,0 +1,60 @@
# -- THEME -------------------------------
# The statusbar
set -g status-position bottom
set -g status-justify centre
set -g status-bg default
set -g status-fg colour15
set -g status-interval 10
set -g status-attr dim
# set -g status-left '#[fg=colour236]_________________________'
set -g status-left '#[fg=colour236]―――――――――――――――――――――――――'
# set -g status-right "#[fg=colour236]#{prefix_highlight} #[fg=colour5] #S #[fg=colour236]──"
# set -g status-right '#[fg=colour236]_________________________'
set -g status-right '#[fg=colour236]―――――――――――――――――――――――――'
set -g status-right-length 12
set -g status-left-length 12
# The messages
set -g message-fg colour4
set -g message-bg colour237
set -g message-command-fg blue
set -g message-command-bg black
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity on
set-option -g bell-action none
# The modes
setw -g clock-mode-colour colour135
setw -g mode-attr bold
setw -g mode-fg colour196
setw -g mode-bg colour238
# The panes
set -g pane-border-fg colour235
# set -g pane-border-bg default
set -g pane-active-border-fg colour5
# set -g pane-active-border-bg default
setw -g window-status-current-fg colour2
setw -g window-status-current-bg default
# setw -g window-status-current-attr none
setw -g window-status-current-format ' #W '
setw -g window-status-fg colour236
setw -g window-status-bg default
setw -g window-status-attr none
# setw -g window-status-format '#[fg=colour8] #I #[fg=default]#W '
setw -g window-status-format ' #W '
setw -g window-status-activity-bg default
setw -g window-status-activity-fg colour240
setw -g window-status-activity-attr none
setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1

View file

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View file

@ -1,16 +1,17 @@
{ config, lib, pkgs, ... }:
{
environment.variables = {
imports = [ <my/options/theme.nix> ];
# Try really hard to get QT to respect my GTK theme.
my.env = {
GTK_DATA_PREFIX = [ "${config.system.path}" ];
QT_QPA_PLATFORMTHEME = "gtk2";
};
qt5 = {
style = "gtk2";
platformTheme = "gtk2";
};
services.xserver.displayManager.sessionCommands = ''
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
source "$XDG_CONFIG_HOME"/xsession/*.sh

View file

@ -1,8 +1,11 @@
{ config, lib, pkgs, ... }:
# For testing software or building my games for other OSes
{ config, lib, pkgs, ... }:
{
virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
};
my.user.extraGroups = [ "vboxusers" ];
}

84
options/my.nix Normal file
View file

@ -0,0 +1,84 @@
{ config, options, lib, utils, pkgs, ... }:
with lib;
{
imports = [ <home-manager/nixos> ];
options.my = {
username = mkOption {
type = types.str;
default = "hlissner";
};
home = mkOption {
type = options.home-manager.users.type.functor.wrapped;
default = {};
};
user = mkOption {
type = types.submodule;
default = {};
description = "My users.users.NAME submodule";
};
env = mkOption {
type = with types; attrsOf (either (either str path) (listOf (either str path)));
default = {};
description = "...";
apply = mapAttrs
(n: v: if isList v
then concatMapStringsSep ":" (x: toString x) v
else (toString v));
};
alias = mkOption {
type = with types; nullOr (attrsOf (nullOr (either str path)));
default = {};
description = "...";
};
packages = mkOption {
type = types.listOf types.package;
default = [];
description = "The set of packages to appear in the user environment.";
};
init = mkOption {
type = types.lines;
default = "";
description = "...";
};
zsh = {
rc = mkOption {
type = types.lines;
default = "";
description = "...";
};
env = mkOption {
type = types.lines;
default = "";
description = "...";
};
};
};
config = {
users.users.${config.my.username} = mkAliasDefinitions options.my.user;
home-manager.users.${config.my.username} = mkAliasDefinitions options.my.home;
my.user.packages = config.my.packages;
my.env.PATH = [ "$PATH" ];
environment.shellAliases = config.my.alias;
environment.extraInit =
let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env;
in ''
${concatStringsSep "\n" exportLines}
${config.my.init}
'';
my.home.xdg.configFile."zsh/extra.zshrc".text = config.my.zsh.rc;
my.home.xdg.configFile."zsh/extra.zshenv".text = config.my.zsh.env;
};
}

29
options/theme.nix Normal file
View file

@ -0,0 +1,29 @@
{ config, options, lib, pkgs, ... }:
with lib;
{
options.theme = {
wallpaper = mkOption {
type = with types; nullOr (either str path);
default = null;
description = "The wallpaper to use";
};
# TODO Colors?
};
config = {
# Set up wallpaper and blur/darken it for lock/login screen
my.home.home.file.".background-image".source = config.theme.wallpaper;
services.xserver.displayManager.lightdm.background =
let blurredWallpaper =
with pkgs; runCommand "blurWallpaper"
{ buildInputs = [ imagemagick ]; } ''
mkdir "$out"
convert -gaussian-blur 0x2 -modulate 70 -level 5% \
${config.theme.wallpaper} $out/wallpaper.blurred.png
'';
in mkIf (config.theme.wallpaper != null)
"${blurredWallpaper}/wallpaper.blurred.png";
};
}

BIN
secrets.nix.gpg Normal file

Binary file not shown.

View file

@ -1,45 +0,0 @@
{ config, options, lib, utils, pkgs, ... }:
with lib;
{
imports = [
<home-manager/nixos>
];
options = {
username = mkOption {
type = types.str;
default = "hlissner";
description = "My username";
};
home = mkOption {
type = options.home-manager.users.type.functor.wrapped;
default = {};
description = "Home-manager configuration for my user";
};
# TODO
# paths = mkOption {
# type = types.listOf types.path;
# default = [];
# description = "Custom PATH entries";
# };
my = mkOption {
type = types.listOf types.functor;
default = [];
description = "Nix config helpers";
};
};
config = {
home-manager.users = {
${config.username} = mkAliasDefinitions options.home;
};
# environment.extraInit = ''
# export PATH="${lib.concatStringsSep ":" (map builtins.toString config.paths)}:$PATH"
# '';
};
}

View file

@ -1,91 +0,0 @@
{ config, pkgs, ... }:
{
imports = [ ../. ]; # Load framework for themes
environment.systemPackages = with pkgs; [
nordic
paper-icon-theme # for rofi
];
fonts.fonts = [ pkgs.nerdfonts ];
services.compton = {
backend = "glx";
activeOpacity = "0.96";
inactiveOpacity = "0.75";
opacityRules = [
"100:class_g = 'Firefox'"
"100:class_g = 'Gimp'"
"100:class_g = 'inkscape'"
"100:class_g = 'aseprite'"
"100:class_g = 'krita'"
"100:class_g = 'Peek'"
"100:class_g = 'feh'"
"100:class_g = 'mpv'"
];
settings = {
blur-background = true;
blur-background-frame = true;
blur-background-fixed = true;
blur-kern = "7x7box";
blur-strength = 340;
blur-background-exclude = [
"window_type = 'dock'"
"window_type = 'desktop'"
"class_g = 'Peek'"
"_GTK_FRAME_EXTENTS@:c"
];
};
};
services.xserver.displayManager.lightdm = {
background = "${./wallpaper.blurred.jpg}";
greeters.mini.extraConfig = ''
text-color = "#bbc2cf"
password-background-color = "#29323d"
window-color = "#0b1117"
border-color = "#0b1117"
'';
};
home = {
home.file.".background-image".source = ./wallpaper.jpg;
xdg.configFile = {
"xtheme/90-theme".source = ./Xresources;
"dunst/dunstrc".source = ./dunstrc;
"bspwm/rc.d/theme".source = ./bspwmrc;
"bspwm/rc.d/polybar".source = ./polybar/run.sh;
"polybar" = { source = ./polybar; recursive = true; };
"rofi/theme" = { source = ./rofi; recursive = true; };
"zsh/prompt.zsh".source = ./zsh/prompt.zsh;
# GTK
"gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Nordic-blue
gtk-icon-theme-name=Paper
gtk-fallback-icon-theme=gnome
gtk-application-prefer-dark-theme=true
gtk-cursor-theme-name=Paper
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-xft-rgba=none
'';
# GTK2 global theme (widget and icon theme)
"gtk-2.0/gtkrc".text = ''
gtk-theme-name="Nordic-blue"
gtk-icon-theme-name="Paper-Mono-Dark"
gtk-font-name="Sans 10"
'';
# QT4/5 global theme
"Trolltech.conf".text = ''
[Qt]
style=Nordic-blue
'';
};
};
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 KiB

View file

@ -1,66 +0,0 @@
!! Colors
#define blk #21242b
#define bblk #969896
#define red #cc6666
#define bred #de935f
#define grn #b5bd68
#define bgrn #757d28
#define ylw #f0c674
#define bylw #f9a03f
#define blu #81a2be
#define bblu #2a8fed
#define mag #b294bb
#define bmag #bc77a8
#define cyn #8abeb7
#define bcyn #a3685a
#define wht #c5c8c6
#define bwht #ffffff
#define bg blk
#define fg wht
*.foreground: fg
*.background: bg
*.cursorColor: mag
*.color0: blk
*.color8: bblk
*.color1: red
*.color9: bred
*.color2: grn
*.color10: bgrn
*.color3: ylw
*.color11: bylw
*.color4: blu
*.color12: bblu
*.color5: mag
*.color13: bmag
*.color6: cyn
*.color14: bcyn
*.color7: wht
*.color15: bwht
! greys
*.color234: #1d2021
*.color235: #282828
*.color236: #32302f
*.color237: #3c3836
*.color239: #504945
*.color240: #544c49
*.color241: #665c54
!! Fonts
st.font: Fira Code:pixelsize=13
rofi.font: Fira Code 15
!! Rofi
rofi.padding: 12
! bg fg bgalt hlbg hlfg
rofi.color-normal: argb:00292d35, #bbc2cf, #292d35, #141411, #f8f8f2
rofi.color-urgent: argb:00292d35, #bbc2cf, #292d35, #f92672, #f8f8f2
rofi.color-active: argb:00292d35, #bbc2cf, #292d35, #141411, #a6e22a
! bg border sep
rofi.color-window: argb:ee292d35, argb:00bbc2cf, #292d35
! Separator style (none, dash, solid)
rofi.separator-style: solid

View file

@ -1,42 +0,0 @@
{ config, pkgs, ... }:
{
imports = [ ../. ]; # Load framework for themes
environment.systemPackages = with pkgs; [ arc-theme ];
home = {
home.file.".background-image".source = ./wallpaper.jpg;
xdg.configFile = {
"xtheme/90-theme".source = ./Xresources;
"dunst/dunstrc".source = ./dunstrc;
# GTK
"gtk-3.0/settings.ini".text = ''
[Settings]
gtk-theme-name=Arc-Dark
gtk-icon-theme-name=Arc-Dark
gtk-fallback-icon-theme=gnome
gtk-application-prefer-dark-theme=true
gtk-cursor-theme-name=Numix
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-xft-rgba=none
'';
# GTK2 global theme (widget and icon theme)
"gtk-2.0/gtkrc".text = ''
gtk-theme-name="Arc-Dark"
gtk-icon-theme-name="adwaita"
gtk-font-name="Sans 10"
'';
# QT4/5 global theme
"Trolltech.conf".text = ''
[Qt]
style=Arc-Dark
'';
};
};
}

View file

@ -1,57 +0,0 @@
[global]
alignment = left
markup = full
bounce_freq = 0
browser = firefox -new-tab
dmenu = rofi -dmenu -p dunst:
follow = none
font = Fira Code 14
# font = Misc Tamsyn 12
format = "%s\n%b"
# geometry [{width}]x{height}][+/-{x}+/-{y}]
geometry = "365x15-21+21"
history_length = 20
horizontal_padding = 16
idle_threshold = 120
ignore_newline = no
indicate_hidden = yes
line_height = 0
monitor = 0
padding = 12
separator_color = "#18191b"
separator_height = 2
show_age_threshold = 60
show_indicators = yes
shrink = no
sort = yes
startup_notification = false
sticky_history = yes
transparency = 1
word_wrap = yes
max_icon_size = 64
# Align icons left/right/off
icon_position = right
# Paths to default icons.
icon_path = /usr/share/icons/hicolor/32x32/apps/:/usr/share/icons/Adwaita/32x32/actions/
frame_width = 0
frame_color = "#131416"
[shortcuts]
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#0a0b0c"
foreground = "#b5bd68"
timeout = 8
[urgency_normal]
background = "#b5bd68"
foreground = "#131416"
timeout = 14
[urgency_critical]
background = "#cc6666"
foreground = "#131416"
timeout = 0

View file

@ -1,336 +0,0 @@
[colors]
bg = ${xrdb:background}
fg = ${xrdb:foreground}
black = ${xrdb:color0}
bblack = ${xrdb:color8}
red = ${xrdb:color1}
bred = ${xrdb:color9}
green = ${xrdb:color2}
bgreen = ${xrdb:color10}
yellow = ${xrdb:color3}
byellow = ${xrdb:color11}
blue = ${xrdb:color4}
bblue = ${xrdb:color12}
magenta = ${xrdb:color5}
bmagenta = ${xrdb:color13}
cyan = ${xrdb:color6}
bcyan = ${xrdb:color14}
white = ${xrdb:color7}
bwhite = ${xrdb:color15}
bg-alt = #0F1013
fg-alt = #25282a
icons = #555856
alert = ${colors.red}
[global/wm]
margin-top = 0
margin-bottom = 24
[bar/main]
monitor = ${env:MONITOR}
monitor-strict = true
enable-ipc = true
wm-restack = bspwm
# REQUIRED to move the window with hideit.sh
override-redirect = true
background =
foreground = ${colors.fg}
width = 100%
height = 24
offset-x = 0
offset-y = 8
bottom = 1
overline-size = 0
overline-color = #f00
underline-size = 0
underline-color = #00f
border-bottom-size = 0
padding-left = 2
padding-right = 2
module-margin-left = 0
module-margin-right = 0
font-0 = "Fira Code:pixelsize=9;2"
font-1 = "Wuncon Siji:pixelsize=12;2"
font-2 = "Siji:pixelsize=10;2"
; modules-left = volume pad cpu memory pad pkg mail
modules-left = volume pad cpu memory
modules-center = bspwm
; modules-right = battery wlan app-rslsync app-redshift pad date
modules-right = battery wlan app-redshift pad date
;tray-position = center
;tray-padding = 2
;tray-transparent = true
;tray-background = #0063ff
[module/bspwm]
type = internal/bspwm
pin-workspaces = true
enable-click = true
ws-icon-0 = 1;
ws-icon-1 = 2;
ws-icon-2 = 3;
ws-icon-3 = 4;
ws-icon-4 = 5;
ws-icon-default = x
format = <label-state> <label-mode>
label-padding = 1
label-focused = %icon%
label-focused-background = #33000000
label-focused-foreground = ${colors.green}
; label-focused-underline = ${colors.magenta}
; label-focused-foreground = ${xrdb:color2}
label-focused-padding = 1
label-occupied = %icon%
label-occupied-foreground = ${colors.icons}
label-occupied-padding = 1
; label-urgent = %icon%
label-urgent-foreground = ${colors.red}
; label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-empty = %icon%
label-empty-foreground = ${colors.fg-alt}
label-empty-padding = 1
[module/date]
type = internal/date
interval = 5
label = %date% %time%
date = %A, %h %d
date-alt = %Y-%m-%d
time = %I:%M %p
time-alt = %H:%M:%S
format-prefix = ""
format-prefix-padding = 1
; format-prefix-background = ${colors.bg-alt}
format-prefix-foreground = ${colors.icons}
; format-underline = ${xrdb:color4}
[module/xwindow]
type = internal/xwindow
label = %title:0:80:...%
label-padding-left = 2
; [module/mpd]
; type = internal/mpd
; host = /home/hlissner/.config/mpd/mpd.sock
;
; format-online = <label-song> <toggle>
; format-padding = 5
;
; label-song-maxlen = 45
; label-song-ellipsis = true
;
; icon-prev = 
; icon-seekb = 
; icon-stop = 
; icon-play = 
; icon-pause = 
; icon-next = 
; icon-seekf = 
;
; icon-random = 
; icon-repeat = 
;
; toggle-on-foreground = ${colors.fg}
; toggle-off-foreground = #66
[module/cpu]
type = internal/cpu
interval = 2
format = <bar-load>
format-prefix = ""
format-foreground = ${colors.icons}
; format-underline = #f90000
; label = %percentage%%
format-padding = 1
bar-load-indicator =
bar-load-width = 6
bar-load-foreground-0 = ${colors.green}
bar-load-foreground-1 = ${colors.green}
bar-load-foreground-2 = ${colors.yellow}
bar-load-foreground-3 = ${colors.red}
bar-load-foreground-4 = ${colors.red}
bar-load-fill = |
bar-load-empty = ¦
bar-load-empty-foreground = ${colors.fg-alt}
[module/memory]
type = internal/memory
interval = 3
format = <bar-used>
format-prefix = ""
format-prefix-foreground = ${colors.icons}
; format-underline = #4bffdc
; label = %percentage_used%%
format-padding-left = 1
; Only applies if <bar-used> is used
bar-used-indicator =
bar-used-width = 6
bar-used-foreground-0 = ${colors.green}
bar-used-foreground-1 = ${colors.green}
bar-used-foreground-2 = ${colors.yellow}
bar-used-foreground-3 = ${colors.red}
bar-used-foreground-4 = ${colors.red}
bar-used-fill = |
bar-used-empty = ¦
bar-used-empty-foreground = ${colors.fg-alt}
[module/wlan]
type = internal/network
interface = ${env:WLP:wlp3s0}
interval = 3.0
format-connected = <ramp-signal>
format-disconnected = !
format-disconnected-foreground = ${colors.red}
; label-connected =
; label-disconnected = !
; label-disconnected-foreground = ${colors.red}
ramp-signal-0 = 
ramp-signal-0-foreground = ${colors.yellow}
ramp-signal-1 = 
ramp-signal-1-foreground = ${colors.yellow}
ramp-signal-2 = 
ramp-signal-2-foreground = ${colors.yellow}
ramp-signal-3 = 
ramp-signal-3-foreground = ${colors.icons}
ramp-signal-4 = 
ramp-signal-4-foreground = ${colors.icons}
; [module/eth]
; type = internal/network
; interface = ${env:ETH:enp2s0}
; interval = 4.0
;
; ; format-connected-underline = #55aa55
; ; format-connected-prefix = " "
; format-connected-foreground-foreground = ${colors.fg-alt}
; label-connected = %local_ip%
;
; format-disconnected-underline = ${self.format-connected-underline}
; label-disconnected = %ifname% disconnected
; label-disconnected-foreground = ${colors.fg-alt}
[module/volume]
type = internal/volume
; format-volume = <label-volume> <bar-volume>
format-volume = <ramp-volume> <bar-volume>
; label-volume = " "
label-volume-foreground = ${colors.fg}
; format-muted-prefix = " "
format-muted-foreground = ${colors.red}
label-muted = 
bar-volume-width = 8
bar-volume-foreground-0 = ${colors.blue}
bar-volume-foreground-1 = ${colors.blue}
bar-volume-foreground-2 = ${colors.blue}
bar-volume-foreground-3 = ${colors.blue}
bar-volume-foreground-4 = ${colors.blue}
bar-volume-foreground-5 = ${colors.blue}
bar-volume-foreground-6 = ${colors.blue}
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-indicator-foreground = #ff
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.fg-alt}
; Only applies if <ramp-volume> is used
ramp-volume-0 = 
ramp-volume-1 = 
ramp-volume-2 = 
[module/battery]
type = internal/battery
battery = BAT0
adapter = ADP1
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.fg-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.fg-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.fg-alt}
animation-charging-framerate = 750
;=====================================================
; Custom scripts
;=====================================================
[module/pad]
type = custom/text
content = " "
content-foreground = ${colors.fg-alt}
[module/pkg]
type = custom/ipc
hook-0 = ~/.config/polybar/modules/updates
initial = 1
click-left = polybar-msg -p %pid% hook pkg 1
format-padding = 1
[module/mail]
type = custom/ipc
hook-0 = ~/.config/polybar/modules/mail
initial = 1
click-left = polybar-msg -p %pid% hook mail 1
format-padding-right = 1
[module/app-redshift]
type = custom/script
exec = echo 1
exec-if = pgrep -x redshift
format = ""
format-foreground = ${colors.icons}
interval = 2
[module/app-rslsync]
type = custom/script
exec = echo 1
exec-if = pgrep -x rslsync
format = ""
format-foreground = ${colors.icons}
interval = 60
; vim:ft=dosini

View file

@ -1,21 +0,0 @@
#!/usr/bin/env bash
# Specifying the icon(s) in the script
# This allows us to change its appearance conditionally
pgrep -x redshift &> /dev/null
if [[ $? -eq 0 ]]; then
temp=$(redshift -p 2>/dev/null | grep temp | cut -d' ' -f3)
temp=${temp//K/}
fi
# OPTIONAL: Append ' ${temp}K' after $icon
if [[ -z $temp ]]; then
echo "%{F#65737E}$icon" # Greyed out (not running)
elif [[ $temp -ge 5000 ]]; then
echo "%{F#8FA1B3}$icon" # Blue
elif [[ $temp -ge 4000 ]]; then
echo "%{F#EBCB8B}$icon" # Yellow
else
echo "%{F#D08770}$icon" # Orange
fi

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
icon=""
if pgrep -x rslsync &> /dev/null; then
echo "%{F#e5e8e6}$icon"
else
echo "%{F#65737E}$icon"
fi

View file

@ -1,92 +0,0 @@
#!/usr/bin/env python3
import imaplib
import os
import sys
import socket
from subprocess import Popen
CONFIG_FILE = os.path.expanduser("~/.secrets/email")
CACHE_FILE = "/tmp/polybar-mail"
ICON = ""
try:
import gnupg
from pathlib import Path
except ImportError:
print("%{{F{}}}*".format("#555856", ICON))
sys.exit(1)
#
def internet_is_on():
try:
host = socket.gethostbyname("www.google.com")
socket.create_connection((host, 80), 2)
return True
except:
pass
return False
def unread_count(address, password):
imap = imaplib.IMAP4_SSL('imap.gmail.com', 993)
imap.login(address, password)
imap.select('INBOX')
status, resp = imap.search(None, 'UNSEEN')
imap.close()
imap.logout()
return len(resp[0].split())
def ding():
Popen(["{}/bin/ding".format(os.getenv("DOTFILES", os.expanduser("~/.dotfiles")))])
#
def main():
try:
if not internet_is_on():
raise IOError("Internet is off")
secrets = Path(CONFIG_FILE)
if not secrets.exists():
raise IOError("Can't find secrets")
gpg = gnupg.GPG()
gpgdata = gpg.decrypt(secrets.read_bytes())
if not gpgdata.ok:
raise IOError("Couldn't decrypt secrets: {}".format(gpgdata.status))
accounts = [line.split(':') for line in gpgdata.data.decode('utf-8').strip().split('\n')]
last_total = 0
cache = Path(CACHE_FILE)
if cache.exists():
cache_text = cache.read_text()
last_total = int(cache.read_text())
total = 0
for addr, pwd in accounts:
total += unread_count(addr, pwd)
if total != last_total:
ding()
if total != 0:
print("%{{F{}}}{}{}".format("#f0c674", ICON, total))
else:
print("%{{F{}}}{}".format("#555856", ICON))
cache.write_text(str(total))
except IOError as e:
print("ERROR: {}".format(e), file=sys.stderr)
print("%{{F{}}}{}!".format("#cc6666", ICON))
sys.exit(1)
#
if __name__ == '__main__':
if sys.argv[1:]:
print("%{{F{}}}{}".format("#555856", ICON))
else:
main()

View file

@ -1,7 +0,0 @@
#!/usr/bin/env bash
killall -q polybar
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
polybar main >>$XDG_DATA_HOME/polybar.log 2>&1 &
echo 'Polybar launched...'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB