nix: Continue nixification

This commit is contained in:
Donovan Glover 2023-05-11 12:38:42 -04:00
parent 5322fc02b8
commit c45a96764f
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
13 changed files with 79 additions and 533 deletions

View File

@ -1,13 +0,0 @@
# New Start: A modern Arch workflow built with an emphasis on functionality.
# Copyright (C) 2017 Donovan Glover
# Use the terminal instead of a GTK window when prompting for passwords
pinentry-program /usr/bin/pinentry-curses
# Cache the given input for 12 hours
default-cache-ttl 43200
# Invalidate the cache entry after 12 hours have passed
max-cache-ttl 43200
# vim:ft=dosini

View File

@ -1,22 +0,0 @@
# New Start: A modern Arch workflow built with an emphasis on functionality.
# Copyright (C) 2017-2023 Donovan Glover
# Use SHA512 instead of SHA256
personal-digest-preferences SHA512
cert-digest-algo SHA512
# Use AES256 instead of AES128 or CAST5
cipher-algo AES256
# Prefer encryption algorithms in this order
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
personal-cipher-preferences TWOFISH CAMELLIA256 AES 3DES
# Prevent the recipient id from being leaked in the message
throw-keyids
# Always show long key IDs
keyid-format 0xlong
# Always show full fingerprints of keys
with-fingerprint

View File

@ -1,26 +0,0 @@
# GPG
GPG is the standard encryption tool.
## Use Cases
gpg can be used to:
- Sign things with your signing subkey
- Read encrypted messages sent to you with your encryption subkey
- Send encrypted messages to other people with their public key
- Verify the authenticity of someone's messages and other data with their public key
You should not use gpg if:
- You should use gpg.
## Usage
Export `GPG_TTY` in your shell's init script. This is how you would do it in [fish](/fish):
```fish
export GPG_TTY=(tty)
```
[gnupg]: https://github.com/gpg/gnupg

View File

@ -1,11 +1,7 @@
{ config, lib, nixpkgs, home-manager, hyprland, ... }: {
imports = [ home-manager.nixosModule ];
home-manager.users.user = { pkgs, ... }: {
xdg = {
userDirs = {
enable = true;
};
};
xdg = { userDirs = { enable = true; }; };
home.file.".icons/default/index.theme".text = ''
[icon theme]
Inherits=phinger-cursors
@ -33,6 +29,26 @@
}
active_on_launch: True
'';
xdg.configFile."ranger/rc.conf".text = ''
set line_numbers absolute
set padding_right false
set vcs_aware true
set show_hidden true
set confirm_on_delete always
set save_console_history false
set mouse_enabled false
set tilde_in_titlebar true
alias r rename
alias d delete
map DD shell trash %s
set use_preview_script true
set preview_files true
set preview_images true
set preview_images_method kitty
'';
gtk = {
enable = true;
cursorTheme = {
@ -64,8 +80,8 @@
wayland_titlebar_color = "background";
listen_on = "unix:/tmp/kitty";
open_url_with = "librewolf";
window_padding_width = 10;
tab_bar_margin_width = 10;
window_padding_width = 5;
tab_bar_margin_width = 5;
};
};
xdg.configFile."kitty/diff.conf".text = ''
@ -119,9 +135,10 @@
layer = "bottom";
position = "top";
height = 30;
modules-left = [ "wlr/taskbar" "tray" ];
modules-center = [ "hyprland/window" ];
modules-right = [ "battery" "backlight" "wireplumber" "clock" ];
modules-left = [ "hyprland/window" ];
modules-center = [ "wlr/workspaces" ];
modules-right =
[ "tray" "wireplumber" "backlight" "battery" "clock" ];
};
};
};
@ -244,6 +261,58 @@
{ key = "U"; command = "update_database"; }
{ key = "m"; command = "add_random_items"; }
];
settings = {
ncmpcpp_directory = "~/.config/ncmpcpp";
user_interface = "alternative";
autocenter_mode = "yes";
allow_for_physical_item_deletion = "no";
mouse_support = "no";
execute_on_song_change = "~/.config/mpd/mpdnotify";
mpd_crossfade_time = 3;
};
};
programs.lf = {
enable = true;
};
services.gpg-agent = {
enable = true;
pinentryFlavor = "curses";
defaultCacheTtl = 43200;
maxCacheTtl = 43200;
};
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
cycle = false;
extraConfig = {
modi = "drun,filebrowser";
font = "Noto Sans CJK JP 12";
show-icons = true;
bw = 0;
display-drun = "";
display-window = "";
display-combi = "";
icon-theme = "Papirus";
terminal = "kitty";
drun-match-fields = "name";
drun-display-format = "{name}";
me-select-entry = "";
me-accept-entry = "MousePrimary";
};
};
programs.gpg = {
enable = true;
# homedir = "${config.xdg.dataHome}/gnupg"
settings = {
personal-digest-preferences = "SHA512";
cert-digest-algo = "SHA512";
cipher-algo = "AES256";
default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
personal-cipher-preferences = "TWOFISH CAMELLIA256 AES 3DES";
throw-keyids = true;
keyid-format = "0xlong";
with-fingerprint = true;
};
};
};
}

View File

@ -1,136 +0,0 @@
# New Start: A modern Arch workflow built with an emphasis on functionality.
# Copyright (C) 2017 Donovan Glover
# Prevent the mouse from interfering with ncmpcpp
def_key "mouse"
dummy
# Disable the arrow keys
def_key "left"
dummy
def_key "down"
dummy
def_key "up"
dummy
def_key "right"
dummy
def_key "shift-up"
dummy
def_key "shift-down"
dummy
# Disable other functionality we don't want
def_key "P"
dummy
def_key "L"
dummy
def_key "+"
dummy
def_key "!"
dummy
# Use the home row as an alternative to arrow keys
# This also lets you use the h/l keys like ranger to
# move through directories and other structures. It
# also lets you use l to play songs and add tracks
# to the current playlist.
def_key "h"
previous_column
def_key "h"
jump_to_parent_directory
def_key "j"
scroll_down
def_key "k"
scroll_up
def_key "l"
next_column
def_key "l"
enter_directory
def_key "l"
play_item
# Use the home row for selecting and moving things
def_key "K"
move_sort_order_up
def_key "K"
move_selected_items_up
def_key "J"
move_sort_order_down
def_key "J"
move_selected_items_down
def_key "H"
select_item
scroll_down
def_key "L"
select_item
scroll_up
# Easily clear the current selection
def_key "'"
remove_selection
# Easily scroll up and down, vim style
# Using "d" and "u" directly is also supported, similar to VimFx
def_key "ctrl-u"
page_up
def_key "ctrl-d"
page_down
def_key "u"
page_up
def_key "d"
page_down
# Use n for next and N for previous, just like vim
def_key "n"
next_found_item
def_key "N"
previous_found_item
# Easily switch between the playlist and browser views
def_key "t"
next_screen
# Sane movement defaults (g = top, G = bottom)
def_key "g"
move_home
def_key "G"
move_end
# Use "w" and "b" to go to the next and previous tracks respectively
def_key "w"
next
def_key "b"
previous
# Use ";" and "," to move through the track
def_key ";"
seek_forward
def_key ","
seek_backward
# Use "f" to apply filters (used often)
def_key "f"
apply_filter
# Use "i" instead of insert to select items
def_key "i"
select_item
# Set x to delete since we don't use crossfade. This
# is similar to the functionality seen in VimFx.
def_key "x"
delete_playlist_items
def_key "x"
delete_browser_items
def_key "x"
delete_stored_playlist
# Use "U" to update the music database
def_key "U"
update_database
# Add random songs to the current playlist
def_key "m"
add_random_items
# vim:ft=conf

View File

@ -1,33 +0,0 @@
# New Start: A modern Arch workflow built with an emphasis on functionality.
# Copyright (C) 2017-2018 Donovan Glover
# Change the directory from ~/.ncmpcpp to ~/.config/ncmpcpp
ncmpcpp_directory = "~/.config/ncmpcpp"
# Load music files from the ~/Music directory
mpd_music_dir = "~/Music"
# Always use the "new" user interface
user_interface = "alternative"
# Always center the new song when changing tracks
autocenter_mode = "yes"
# Let files be physically deleted inside ncmpcpp
# Change to "yes" if you want to physically delete songs while listing to them
allow_for_physical_item_deletion = "no"
# Disable mouse support
mouse_support = "no"
execute_on_song_change = "~/.config/mpd/mpdnotify"
# Visualizer support
visualizer_data_source = "/tmp/mpd.fifo"
visualizer_output_name = "my_fifo"
visualizer_in_stereo = "yes"
visualizer_type = "spectrum"
visualizer_look = "+|"
# Cross-fading
mpd_crossfade_time = 3

View File

@ -1,18 +0,0 @@
# ncmpcpp
[ncmpcpp][ncmpcpp] is a music player client for the terminal.
## Use Cases
ncmpcpp can be used to:
- Manage your entire music library from a pretty terminal interface
- Let your music player have a color scheme consistent to your setup
- Add music functionality in your rice screenshot
You should not use ncmpcpp if:
- You use a desktop environment that already has a music player
- You do not want to use mpd
[ncmpcpp]: https://github.com/arybczak/ncmpcpp

View File

@ -1,48 +0,0 @@
# New Start: A modern Arch workflow built with an emphasis on functionality.
# Copyright (C) 2017-2018 Donovan Glover
# Make it easier to 1) know what view we're in and 2) select files
set line_numbers absolute
# Remove the unused space on the right since we won't be using a mouse
set padding_right false
# Show version control information
set vcs_aware true
# Show hidden files
set show_hidden true
# Always confirm that you want to delete something
set confirm_on_delete always
# Don't save the console history on exit
set save_console_history false
# Disable the mouse input to avoid opening random stuff
set mouse_enabled false
# Add icons
default_linemode devicons
# Alias r to rename
alias r rename
# Alias d to delete
alias d delete
# Make it easy to trash stuff
map DD shell trash %s
# Alias w to wal
alias w shell -fs wal -o "$HOME/.config/wal/done.sh" -i %f
set use_preview_script true
set preview_files true
set preview_images true
set preview_images_method kitty
# Replace $HOME with ~
set tilde_in_titlebar true
# vim:ft=dosini

View File

@ -1,17 +0,0 @@
# ranger
[ranger][ranger] is a file browser for the terminal with image support.
## Use Cases
ranger can be used to:
- Easily see all filenames in directories as you browse through them
- Show image previews in the terminal (with [kitty](/kitty))
- Use a file browser even through a tty
You should not use ranger if:
- You should use ranger.
[ranger]: https://github.com/ranger/ranger

View File

@ -1,26 +0,0 @@
configuration {
modi: ["drun", "filebrowser"];
font: "Noto Sans CJK JP 12";
show-icons: true;
bw: 0;
display-drun: "";
display-window: "";
display-combi: "";
icon-theme: "Papirus";
terminal: "kitty";
drun-match-fields: "name";
drun-display-format: "{name}";
window {
hide-active-window: true;
}
me-select-entry: "";
me-accept-entry: "MousePrimary";
}
@theme "~/.cache/wal/rofi.rasi"
listview {
cycle: false;
}
// vim:syn=java

View File

@ -1,69 +0,0 @@
#!/bin/sh
# New Start: A modern Arch workflow built with an emphasis on functionality.
# Copyright (C) 2018 Donovan Glover
# This script will find the X server DPI and apply the necessary
# settings to make Rofi, X, GNOME, and KDE applications have the
# proper scaling, with no intervention from the user necessary.
# Note that XDG_CURRENT_DESKTOP is required for KDE/Qt applications to
# have the proper theming in non-Plasma environments. In contrast, GNOME
# respects its theming even when XDG_CURRENT_DESKTOP is not set to it
# (through settings.ini).
# Note that the xcursor size is specified with:
#
# 1. The X server resource database (xrdb), of which cursor size is
# only applied BEFORE your window manager starts
# 2. The xsetroot command, which affects the cursor shown on the root
# window (your desktop)
# 3. The XCURSOR_SIZE environment variable, which affects the current
# program
#
# There are a few things to take away from this:
#
# 1. The root window (desktop) cursor size MUST be changed with xsetroot
# 2. KDE applications will honor XCURSOR_SIZE but NOT xsetroot
# 3. GTK applications will honor xsetroot but NOT XCURSOR_SIZE
#
# Additionally,
#
# 4. SOME X applications require XCURSOR_SIZE to be set and will NOT
# honor xsetroot
# 5. SOME X applications require xsetroot to be set and will NOT
# honor XCURSOR_SIZE
#
# So for a consistent variable cursor DPI environment, one has to set BOTH
# xsetroot and XCURSOR_SIZE
#
# Note that existing windows will NOT have their X cursor size changed
# if they don't depend on xsetroot. Because of this, and because of the
# fact that active windows will not handle DPI changes anyway, you should
# probably have no GUIs running when switching DPI.
# Kill rofi if it's already running to make this a simple toggle script.
if pgrep -x rofi; then
killall rofi
exit
fi
ROFI_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2)
ROFI_SCALE=$(expr $ROFI_DPI / 96)
ROFI_DPI_SCALE=$(awk "BEGIN { print "1/$ROFI_SCALE" }")
CURSOR_THEME=${XCURSOR_THEME:-phinger-cursors}
CURSOR_SIZE=$((16 * $ROFI_SCALE))
xsetroot -xcf "/usr/share/icons/$CURSOR_THEME/cursors/left_ptr" "$CURSOR_SIZE"
env \
QT_AUTO_SCREEN_SCALE_FACTOR="0" \
QT_FONT_DPI="$ROFI_DPI" \
QT_SCREEN_SCALE_FACTORS="VGA-1=$ROFI_SCALE;" \
GDK_SCALE="$ROFI_SCALE" \
GDK_DPI_SCALE="$ROFI_DPI_SCALE" \
XCURSOR_SIZE="$CURSOR_SIZE" \
rofi \
-show drun \
-dpi "$ROFI_DPI" \
-m -1

View File

@ -1,98 +0,0 @@
/*
Based on Newman Sánchez's Launchpad theme.
https://github.com/newmanls/rofi-themes-collection
*/
* {{
font: "Noto Sans CJK JP Bold 12";
bg0: #242424dd;
bg1: #363636;
bg2: #f5f5f520;
bg3: #f5f5f540;
bg4: #0860f2E6;
fg0: #f5f5f5;
fg1: #f5f5f580;
background-color: transparent;
foreground: {foreground};
text-color: @fg0;
padding: 0px;
margin: 0px;
}}
window {{
fullscreen: true;
padding: 1em;
background-color: @bg0;
background-color: rgba({background.rgb}, 0.9);
}}
mainbox {{
padding: 8px;
}}
inputbar {{
background-color: @bg2;
margin: 0px calc( 50% - 230px );
padding: 4px 8px;
spacing: 8px;
border: 1px;
border-radius: 2px;
border-color: @bg3;
children: [icon-search,entry];
}}
prompt {{
enabled: false;
}}
icon-search {{
expand: false;
filename: "search";
vertical-align: 0.5;
}}
entry {{
placeholder: "Search";
placeholder-color: @bg2;
}}
listview {{
/*margin: 48px calc( 50% - 560px );*/
margin: 86px calc( 50% - 560px );
spacing: 48px;
/*columns: 5;*/
columns: 5;
fixed-columns: true;
}}
element, element-text, element-icon {{
cursor: pointer;
}}
element {{
padding: 8px;
spacing: 4px;
orientation: vertical;
border-radius: 16px;
}}
element selected {{
background-color: {color8};
}}
element-icon {{
size: 5em;
horizontal-align: 0.5;
}}
element-text {{
horizontal-align: 0.5;
}}
// vim:syn=css

View File

@ -1,17 +0,0 @@
# rofi
[rofi][rofi] is an application launcher, window switcher, and dmenu replacement.
## Use Cases
rofi can be used to:
- Launch applications based on `.desktop` files
- Show all open windows and switch between them
- Parse dmenu-like input
You should not use rofi if:
- Your desktop environment already has an application launcher and window switcher
[rofi]: https://github.com/DaveDavenport/rofi