Many changes

This commit is contained in:
2024-01-25 00:55:35 -07:00
commit f5f1a2b69c
56 changed files with 4123 additions and 0 deletions

144
host/configuration.nix Normal file
View File

@@ -0,0 +1,144 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, inputs, ... }:
let
username = "dakedres";
in {
custom.username = username;
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
./user.nix
];
users.users.${username} = {
isNormalUser = true;
description = "Dakedres";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.fish;
};
# We live in a society
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# That's what it's called
networking.hostName = "vulpes";
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# I don't need no fig leaves
security.sudo.wheelNeedsPassword = false;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Boise";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "us";
xkb.options = "caps:swapescape,altwin:swap_alt_win";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
services.flatpak.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
git
wget
micro
openconnect
btop
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@@ -0,0 +1,39 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/81248e4c-95cf-4427-9df1-57f39b62a5a3";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E50D-8471";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/25b9170e-c60a-49c1-929a-0fe6fc1e15ea"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

112
host/home.nix Normal file
View File

@@ -0,0 +1,112 @@
{ pkgs, lib, ... }:
let
terminal = "kitty";
# newm = inputs.newmpkgs.packages.${system}.newm-atha;
packages = [
# Utility
pkgs.bitwarden
pkgs.vimiv-qt
# Visual
pkgs.imagemagick
pkgs.kate
#Games
pkgs.prismlauncher-qt5
# Env
pkgs.eww-wayland
pkgs.socat
pkgs.jq
];
nonFreePackages = [
"discord"
];
in {
imports = [ ../colors/monokai-dark ];
custom.wallpaper = ../wallpapers/blip-blip-blip-blip.jpg;
home = {
sessionVariables = {
EDITOR = "kate";
BROWSER = "qutebrowser";
TERMINAL = "kitty";
TERM = "kitty";
FILEMANAGER = "kitty lf";
# Tell Electron apps it's wayland
NIXOS_OZONE_WL = 1;
};
sessionPath = [
"$HOME/.local/bin"
];
stateVersion = "23.11";
};
# Add packages
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) nonFreePackages;
home.packages =
map (name: pkgs.${name}) nonFreePackages
++ packages;
xdg.mimeApps = {
enable = true;
};
# Directories
xdg.userDirs = {
createDirectories = false;
download = "$HOME/downloads";
music = "$HOME/music";
};
# Openers
xdg.mimeApps.defaultApplications = {
"inode/directory" = [
# "lf.desktop"
"kitty-open.desktop"
];
};
# Standard programs
programs.bat = {
enable = true;
config = {
paging = "never";
};
};
# lf
programs.lf = {
enable = true;
commands = {
q = "quit"; # Why didn't they do this btw
};
keybindings = {
"<enter>" = "$$OPENER $f";
};
};
xdg.desktopEntries.lf = {
name = "LF";
genericName = "File browser";
exec = "lf %U";
terminal = true;
mimeType = [ "inode/directory" ];
};
# Take over my xsession
xsession.enable = true;
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

33
host/homeOptions.nix Normal file
View File

@@ -0,0 +1,33 @@
{ lib, ... }: {
options.custom = {
wallpaper = lib.mkOption {
type = lib.types.path;
};
colors =
let
colorOption = lib.mkOption {
type = lib.types.str;
default = "#000000";
};
in
{
base00 = colorOption;
base01 = colorOption;
base02 = colorOption;
base03 = colorOption;
base04 = colorOption;
base05 = colorOption;
base06 = colorOption;
base07 = colorOption;
base08 = colorOption;
base09 = colorOption;
base0A = colorOption;
base0B = colorOption;
base0C = colorOption;
base0D = colorOption;
base0E = colorOption;
base0F = colorOption;
};
};
}

10
host/modules.nix Normal file
View File

@@ -0,0 +1,10 @@
[
../modules/fish
../modules/qutebrowser
../modules/kitty
../modules/ncspot
../modules/bspwm
../modules/blueman
]

176
host/swhkdrc Normal file
View File

@@ -0,0 +1,176 @@
#
# wm independent hotkeys
#
# Open kitty
alt + Return
kitty
# Open floating kitty
alt + shift + Return
bsp-float kitty
# launch program
alt + @space
rofi -show run
# launch program as root
alt + shift + @space
rofi-ask rofi -show drun -run-command "sudo -A {cmd}"
# make sxhkd reload its configuration files:
alt + Escape
pkill -USR1 -x sxhkd; notify-send 'Key daemon reloaded'
# Start a qutebrowser search
alt + o
qutesearch
# Show keybinds
alt + slash
sxhkd-help
# Show clipmenu
alt + v
rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}'
alt + shift + v
greenclip clear
#
# bspwm hotkeys
#
# quit/restart bspwm
alt + shift + {q,r}
bspc {quit,wm -r}
# close and kill
alt + {_,shift + }w
bspc node -{c,k}
alt + q
bspc node -c
# alternate between the tiled and monocle layout
alt + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
alt + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest window
alt + g
bspc node -s biggest.window
# Reveal hidden kitty (scratchpad)
alt + super + Return
bsp-toggle-visibility KittyScratch "kitty --class KittyScratch"
# flameshot
alt + Print
flameshot gui
#
# state/flags
#
# set the window state
alt + {z,shift + z,x,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
alt + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
alt + {h,j,k,l,Left,Down,Up,Right}
bspc node -{f} {west,south,north,east,west,south,north,east}
# focus the node for the given path jump
alt + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous window in the current desktop
alt + {a,d}
bspc node -f {next,prev}.local.!hidden.window
# focus the next/previous desktop in the current monitor
alt + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
alt + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
alt + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
alt + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
#
# preselect
#
# preselect the direction
alt + ctrl + shift {h,j,k,l,Left,Down,Up,Right}
bspc node -p {west,south,north,east,west,south,north,east}
# preselect the ratio
alt + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
alt + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
alt + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# Resize a window by moving one of its side outward/inward
alt + s ; {h,j,k,l,Left,Down,Up,Right}
STEP=20; SELECTION={1,2,3,4,1,2,3,4}; \
bspc node -z $(echo "left -$STEP 0,bottom 0 $STEP,top 0 -$STEP,right $STEP 0" | cut -d',' -f$SELECTION) || \
bspc node -z $(echo "right -$STEP 0,top 0 $STEP,bottom 0 -$STEP,left $STEP 0" | cut -d',' -f$SELECTION)
# move a floating window
alt + {h,j,k,l}
bspc node -v {-30 0,0 20,0 -30,20 0}
# move a not-floating window
alt + shift + {h,j,k,l,Left,Down,Up,Right}
bsp-smove {west,south,north,east,west,south,north,east}
#
# tabs
#
# move in/out of tabbed container
alt + ctrl + {h,j,k,l,Left,Down,Up,Right}
tabc-smart-detach {west,south,north,east,west,south,north,east}
# tab/untab window
alt + t
id=$(bspc query -N -n); \
[[ "$(tabc printclass $id)" == "tabbed" ]] \
&& tabc detach $id \
|| tabc create $id
# toggle autoattach in tabbed container
alt + shift + t
tabc autoattach $(bspc query -N -n)

41
host/user.nix Normal file
View File

@@ -0,0 +1,41 @@
{ config, lib, inputs, ... }:
let
modules = import ./modules.nix;
username = config.custom.username;
in {
options.custom = {
username = lib.mkOption {
type = lib.types.str;
default = "dakedres";
};
};
config.home-manager.users."${username}" = {
imports =
(builtins.filter
(path: builtins.pathExists path)
(builtins.map
(path: path + "/home.nix")
modules
)
) ++ [
./home.nix
./homeOptions.nix
];
config.home = {
username = username;
homeDirectory = "/home/${username}";
};
};
imports =
(builtins.filter
(path: builtins.pathExists path)
(builtins.map
(path: path + "/default.nix")
modules
)
);
}